static public String readContents ( InputStream is , String charset ) throws IOException { ByteArrayOutputStream bout = new ByteArrayOutputStream ( 10 * default_file_buffersize ) ; IO . copy ( is , bout ) ; return bout . toString ( charset ) ; }
Read the contents from the inputStream and place into a String with any error messages put in the return String .