B2G/gecko/toolkit/devtools/webconsole/NetworkHelper.jsm
/**
   * Reads all available bytes from aStream and converts them to aCharset.
   *
   * @param nsIInputStream aStream
   * @param string aCharset
   * @returns string
   *          UTF-16 encoded string based on the content of aStream and aCharset.
   */
Reads all available bytes from aStream and converts them to aCharset.
@param nsIInputStream aStream
@param string aCharset
@returns string
UTF-16 encoded string based on the content of aStream and aCharset.
Reads all available bytes from aStream and converts them to aCharset . @param nsIInputStream aStream @param string aCharset @returns string UTF - 16 encoded string based on the content of aStream and aCharset .
function NH_readAndConvertFromStream(aStream, aCharset)
  {
    let text = null;
    try {
      text = NetUtil.readInputStreamToString(aStream, aStream.available())
      return this.convertToUnicode(text, aCharset);
    }
    catch (err) {
      return text;
    }
  }
function NH_readAndConvertFromStream ( aStream , aCharset ) { let text = null ; try { text = NetUtil . readInputStreamToString ( aStream , aStream . available ( ) ) return this . convertToUnicode ( text , aCharset ) ; } catch ( err ) { return text ; } }
Reads all available bytes from aStream and converts them to aCharset.
Reads all available bytes from aStream and converts them to aCharset .