public static void main(String[] args) throws UnsupportedEncodingException {
String c = "中";
byte[] bs = c.getBytes("GBK");
for (int i = 0; i > 7) & 0x1) + (byte) ((b >> 6) & 0x1) + (byte) ((b >> 5) & 0x1) + (byte) ((b >> 4) & 0x1)
+ (byte) ((b >> 3) & 0x1) + (byte) ((b >> 2) & 0x1)
+ (byte) ((b >> 1) & 0x1) + (byte) ((b >> 0) & 0x1);
}
上例的“中”的输出结果:11010110 11010000