B2G/gecko/dom/mobilemessage/src/ril/WspPduHelper.jsm
/**
   * @param multiStream
   *        An exsiting nsIMultiplexInputStream.
   * @param array
   *        An octet array.
   * @param length
   *        Max number of octets to be coverted into an input stream.
   */
@param multiStream
An exsiting nsIMultiplexInputStream.
@param array
An octet array.
@param length
Max number of octets to be coverted into an input stream.
@param multiStream An exsiting nsIMultiplexInputStream . @param array An octet array . @param length Max number of octets to be coverted into an input stream .
function appendArrayToMultiStream(multiStream, array, length) {
    let storageStream = Cc["@mozilla.org/storagestream;1"]
                        .createInstance(Ci.nsIStorageStream);
    storageStream.init(4096, length, null);
    let boStream = Cc["@mozilla.org/binaryoutputstream;1"]
                   .createInstance(Ci.nsIBinaryOutputStream);
    boStream.setOutputStream(storageStream.getOutputStream(0));
    boStream.writeByteArray(array, length);
    boStream.close();
    multiStream.appendStream(storageStream.newInputStream(0));
  }
function appendArrayToMultiStream ( multiStream , array , length ) { let storageStream = Cc [ "@mozilla.org/storagestream;1" ] . createInstance ( Ci . nsIStorageStream ) ; storageStream . init ( 4096 , length , null ) ; let boStream = Cc [ "@mozilla.org/binaryoutputstream;1" ] . createInstance ( Ci . nsIBinaryOutputStream ) ; boStream . setOutputStream ( storageStream . getOutputStream ( 0 ) ) ; boStream . writeByteArray ( array , length ) ; boStream . close ( ) ; multiStream . appendStream ( storageStream . newInputStream ( 0 ) ) ; }
@param multiStream
        An exsiting nsIMultiplexInputStream.
@param multiStream An exsiting nsIMultiplexInputStream .