Skip to content

Instantly share code, notes, and snippets.

@dam5s
Created October 5, 2015 19:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dam5s/3c562e53251765c73e33 to your computer and use it in GitHub Desktop.
Save dam5s/3c562e53251765c73e33 to your computer and use it in GitHub Desktop.
Convert InputStream to String.
public static String read(InputStream inputStream) {
Scanner s = new Scanner(inputStream).useDelimiter("\\A");
return s.hasNext() ? s.next() : "";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment