rem: convStream.init( inStream, charset, 0, 0x0000 ); var str = ""; var str_ = {}; while (convStream.readString( -1, str_ )) { str += str_.value; 
add: try { convStream.init( inStream, charset, 0, 0x0000 ); var str = ""; var str_ = {}; while (convStream.readString( -1, str_ )) { str += str_.value; } } catch (exc) { throw new Components.Exception( "error converting stream: " + errorToString(exc) + "\ncharset: " + charset + "\npartially read string: " + str, exc ); 
context: function streamToString( inStream, charset ){    if (LOG_LEVEL > 2) {        logMessage( "streamToString()",                    "inStream.available() = " + inStream.available() +                    ", charset = " + charset );    }    // byte-array to string:    var convStream =        Components.classes["@mozilla.org/intl/converter-input-stream;1"]        .createInstance(Components.interfaces.nsIConverterInputStream);    convStream.init( inStream, charset, 0, 0x0000 );    var str = "";    var str_ = {};    while (convStream.readString( -1, str_ )) {        str += str_.value;    }    return str;}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/188119b7f6030137779a9d95b9ad28b7b33fed6e/calWcapRequest.js/buggy/calendar/providers/wcap/calWcapRequest.js