字节到流

得到了 byte[],转成流:
Java代码 复制代码  收藏代码
  1. byte[] responseBody = getMethod.getResponseBody();   
  2.             SAXReader saxReader = new SAXReader();   
  3.             InputStream in = new ByteArrayInputStream(responseBody);   
  4.             InputStreamReader strInStream = new InputStreamReader(in, "GBK");  
byte[] responseBody = getMethod.getResponseBody();
			SAXReader saxReader = new SAXReader();
			InputStream in = new ByteArrayInputStream(responseBody);
			InputStreamReader strInStream = new InputStreamReader(in, "GBK");

此时strInStream就可以使用了

你可能感兴趣的:(java)