public static String readAll(InputStream stream, Charset charset) throws IOException {
        return new String(stream.readAllBytes(), charset);
    }
Read an input stream completely into a string
vespajlib/src/main/java/com/yahoo/io/IOUtils.java