public class StreamUtils {/**
* 将流信息转化成字符串
* @param in
* @return
* @throws IOException
*/
public static String parserStream(InputStream in) throws IOException{
//字符流,读取流
BufferedReader br = new BufferedReader(new InputStreamReader(in));
//写入流
StringWriter sw = new StringWriter();
//缓存区
String str = null;
//读写操作
while((str = br.readLine()) != null){
//写操作
sw.write(str);
}
//关流
sw.close();
br.close();
return sw.toString();
}
}