Lilikriana’s Blog

I Share You Everything I Have

Fungsi Konversi InputStream ke String

public String convertInputStreamtoString (InputStream in) throws IOException {
     StringBuffer out = new StringBuffer();
     byte[] b = new byte[4096];
     for (int n; (n = in.read(b)) != -1;) {
     out.append(new String(b, 0, n));
     }
     return out.toString();
}

Advertisement

March 13, 2009 - Posted by | Java Programming

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.