摘要:
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 阅读全文