B2G/gecko/dom/mobilemessage/src/ril/MmsPduHelper.jsm
/**
   * @param data
   *        A wrapped object containing raw PDU data.
   *
   * @return A Date object for absolute expiry or an integer for relative one.
   *
   * @throws CodeError if decoded token equals to neither 128 nor 129.
   */
@param data
A wrapped object containing raw PDU data.

@return A Date object for absolute expiry or an integer for relative one.

@throws CodeError if decoded token equals to neither 128 nor 129.
@param data A wrapped object containing raw PDU data . @return A Date object for absolute expiry or an integer for relative one . @throws CodeError if decoded token equals to neither 128 nor 129 .
function decode(data) {
    let length = WSP.ValueLength.decode(data);
    let end = data.offset + length;
    let token = WSP.Octet.decode(data);
    if ((token != 128) && (token != 129)) {
      throw new WSP.CodeError("Expiry-value: invalid token " + token);
    }
    let result;
    if (token == 128) {
      result = WSP.DateValue.decode(data);
    } else {
      result = WSP.DeltaSecondsValue.decode(data);
    }
    if (data.offset != end) {
      data.offset = end;
    }
    return result;
  }
function decode ( data ) { let length = WSP . ValueLength . decode ( data ) ; let end = data . offset + length ; let token = WSP . Octet . decode ( data ) ; if ( ( token != 128 ) && ( token != 129 ) ) { throw new WSP . CodeError ( "Expiry-value: invalid token " + token ) ; } let result ; if ( token == 128 ) { result = WSP . DateValue . decode ( data ) ; } else { result = WSP . DeltaSecondsValue . decode ( data ) ; } if ( data . offset != end ) { data . offset = end ; } return result ; }
@param data
        A wrapped object containing raw PDU data.
@param data A wrapped object containing raw PDU data .