code: public static String readAll(final InputStream inputStream, Charset charset) throws IOException {
      return new ByteSource() {
        @Override
        public InputStream openStream() {
          return inputStream;
        }
      }.asCharSource(charset).read();
    }
docs: Reads all input into memory, close the steam, and return as a String. Reads
  the input
  
  @param inputStream InputStream to read from.
  @param charset the charset to interpret the input as.
  @return String contents of the stream.
  @throws IOException if there is an problem reading from the stream.