标签:stackoverflow问题精选 inputstream string转换
StringWriter writer = new StringWriter(); IOUtils.copy(inputStream, writer, encoding); String theString = writer.toString();
String theString = IOUtils.toString(inputStream, encoding)
static String convertStreamToString(java.io.InputStream is) { java.util.Scanner s = new java.util.Scanner(is).useDelimiter("\\A"); return s.hasNext() ? s.next() : "";}
【Stackoverflow好问题】将InputStream转换为String
标签:stackoverflow问题精选 inputstream string转换
原文地址:http://blog.csdn.net/lizeyang/article/details/40042369