Skip to content

Instantly share code, notes, and snippets.

@mr5z
Last active September 2, 2015 01: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 mr5z/a993484b8c06ce7cbca8 to your computer and use it in GitHub Desktop.
Save mr5z/a993484b8c06ce7cbca8 to your computer and use it in GitHub Desktop.
public static String convertStreamToString(InputStream inputStream) {
Scanner scanner = new Scanner(inputStream).useDelimiter("\\A");
String value = scanner.hasNext() ? scanner.next() : "";
scanner.close();
return value;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment