流中的内容格式转换(UTF-8转GBK)
public static InputStream transCharset(InputStream in) throws IOException {
BufferedReader buf = null;
OutputStreamWriter pw=null;
String str = null;
String allstr="";
//用于输入换行符的字节码
byte[] c=new byte[2];
c[0]=0x0d;
c[1]=0x0a;
String t=new String(c);
buf = new BufferedReader(new InputStreamReader(in, "UTF-8"));
while((str = buf.readLine()) != null){
allstr=allstr+str+t;
}
buf.close();
return new ByteArrayInputStream(allstr.getBytes("GBK"));
}