Skip to content

Instantly share code, notes, and snippets.

@PanosJee
Created February 1, 2012 22:16
Show Gist options
  • Save PanosJee/1719818 to your computer and use it in GitHub Desktop.
Save PanosJee/1719818 to your computer and use it in GitHub Desktop.
oss-android-2
public static String ReadInputStream(InputStream in) throws IOException {
StringBuffer stream = new StringBuffer();
byte[] b = new byte[4096];
for (int n; (n = in.read(b)) != -1;) {
stream.append(new String(b, 0, n));
}
return stream.toString();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment