cdm/src/main/java/ucar/nc2/util/IO.java
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);
  }
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);
  }
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.

@param is the inputStream to read from.
@return String holding the contents, or an error message.
@throws java.io.IOException on io error
Read the contents from the inputStream and place into a String with any error messages put in the return String .