//取得GB2312编码的字节
byte[] bytesGB2312 = str.getBytes(“GB2312”);
byte[] bytesDefault = str.getBytes();
String newStrGB = new String(bytesGB2312, “GB2312”);
String newStrDefault = new String(bytesDefault);
InputStream in = xxx;
InputStreamReader reader = InputStreamReader( in, “GB2312”);
char aChar = reader.read();