public String inputstreamToString(InputStream stream){
StringBuilder builder=new StringBuilder();
try {
BufferedReader reader=new BufferedReader(new InputStreamReader(stream));
String str;
while ((str=reader.readLine())!=null){
builder.append(str);
}
} catch (IOException e) {
e.printStackTrace();
}
return builder.toString();
}
StringBuilder builder=new StringBuilder();
try {
BufferedReader reader=new BufferedReader(new InputStreamReader(stream));
String str;
while ((str=reader.readLine())!=null){
builder.append(str);
}
} catch (IOException e) {
e.printStackTrace();
}
return builder.toString();
}