2012年11月19日
摘要: native的Socket发送字节流默认是GB2312的,所以在Java方面需要指定GB2312byte[] buffer = new byte[50];StringBuffer strBuf = new StringBuffer();InputStream input = receiver.getInputStream();while((len = input.read(buffer)) != -1) { String newStr = new String(buffer, 0, len, "GB2312"); strBuf.append(newStr);}referen 阅读全文
posted @ 2012-11-19 14:23 GloriousOnion 阅读(855) 评论(0) 推荐(0) 编辑