StreamUtils
public static String streamToString(InputStream is) throws Exception{
? ? ?BufferedReader reader = new BufferedReader(new InputStreamReader(is));
? ? ?StringBuilder builder = new StringBuilder();
? ? ?String line;
? ? ?while((line=reader.readLine())!=null){
? ? ?builder.append(line+"\r\n");
? ? ?}
? ? ?return builder.toString();
? ? ??
? ? ?}
?}
標簽: