Kursus a2fahmi Gratis klik disini


Fahmi Basya Kartapura On October - 9 - 2016

Kamu bisa gunakan metode berikut ini:

private String convertStreamToString(InputStream is) throws IOException{

if (is != null) {

StringBuilder sb = new StringBuilder();
String m_line;

try {

BufferedReader m_reader = new BufferedReader(new InputStreamReader(is));

while ((m_line = m_reader.readLine()) != null) {

sb.append(m_line).append(“\n”);

}

} finally {

is.close();

}

return sb.toString();

} else {

return “”;

}

}

Penutup

Sekian dan terima kasih.




Categories: Java

Leave a Reply