B2G/gecko/dom/mobilemessage/src/ril/WspPduHelper.jsm
/**
   * @param data
   *        A wrapped object containing raw PDU data.
   * @param length
   *        Number of octets to read.
   *
   * @return A decoded integer value or an octets array of max 30 elements.
   */
@param data
A wrapped object containing raw PDU data.
@param length
Number of octets to read.

@return A decoded integer value or an octets array of max 30 elements.
@param data A wrapped object containing raw PDU data . @param length Number of octets to read . @return A decoded integer value or an octets array of max 30 elements .
function decodeMultiOctetInteger(data, length) {
    if (length < 7) {
      let value = 0;
      while (length--) {
        value = value * 256 + Octet.decode(data);
      }
      return value;
    }
    return Octet.decodeMultiple(data, data.offset + length);
  }
function decodeMultiOctetInteger ( data , length ) { if ( length < 7 ) { let value = 0 ; while ( length -- ) { value = value * 256 + Octet . decode ( data ) ; } return value ; } return Octet . decodeMultiple ( data , data . offset + length ) ; }
@param data
        A wrapped object containing raw PDU data.
@param data A wrapped object containing raw PDU data .
// Return a integer instead of an array as possible. For a multi-octet // integer, there are only maximum 53 bits for integer in javascript. We // will get an inaccurate one beyond that. We can't neither use bitwise // operation here, for it will be limited in 32 bits.