code: public static String readAsString(InputStream is) throws IOException {
  		try {
  			// Scanner iterates over tokens in the stream, and in this case
  			// we separate tokens using "beginning of the input boundary" (\A)
  			// thus giving us only one token for the entire contents of the
  			// stream
  			return new Scanner(is, "UTF-8").useDelimiter("\\A").next();
  		} catch (java.util.NoSuchElementException e) {
  			return "";
  		}
  	}
docs: Read data from input stream
  
  @param is
  input stream
  @return string content read from input stream
  @throws IOException
  if cannot read from input stream