code: public static String streamToString(InputStream inputStream) {
          Scanner scanner = new Scanner(inputStream);
          String ret = scanner.useDelimiter("\\A").next();
          scanner.close();
          return ret;
      }
docs: Convert a given {@link InputStream} to a {@link String}.
  
  @param inputStream an input stream
  @return the string in the input stream