Пример #1
0
  private void _decode(AsnInputStream ansIS, int length)
      throws MAPParsingComponentException, IOException, AsnException {

    AsnInputStream ais = ansIS.readSequenceStreamData(length);

    int tag = ais.readTag();

    // ussd-DataCodingScheme USSD-DataCodingScheme
    if (ais.getTagClass() != Tag.CLASS_UNIVERSAL || !ais.isTagPrimitive())
      throw new MAPParsingComponentException(
          "Error while decoding UnstructuredSSResponseIndication: Parameter ussd-DataCodingScheme bad tag class or not primitive",
          MAPParsingComponentExceptionReason.MistypedParameter);

    int length1 = ais.readLength();
    this.ussdDataCodingSch = new CBSDataCodingSchemeImpl(ais.readOctetStringData(length1)[0]);

    tag = ais.readTag();

    // ussd-String USSD-String
    if (ais.getTagClass() != Tag.CLASS_UNIVERSAL || !ais.isTagPrimitive())
      throw new MAPParsingComponentException(
          "Error while decoding UnstructuredSSResponseIndication: Parameter ussd-String bad tag class or not primitive",
          MAPParsingComponentExceptionReason.MistypedParameter);

    this.ussdString = new USSDStringImpl(this.ussdDataCodingSch);
    ((USSDStringImpl) this.ussdString).decodeAll(ais);
  }
Пример #2
0
  @Override
  public void decodeAll(AsnInputStream ansIS) throws CAPParsingComponentException {

    try {
      int length = ansIS.readLength();
      this._decode(ansIS, length);
    } catch (IOException e) {
      throw new CAPParsingComponentException(
          "IOException when decoding " + _PrimitiveName + ": " + e.getMessage(),
          e,
          CAPParsingComponentExceptionReason.MistypedParameter);
    }
  }
Пример #3
0
  public void decodeAll(AsnInputStream ansIS) throws MAPParsingComponentException {

    try {
      int length = ansIS.readLength();
      this._decode(ansIS, length);
    } catch (IOException e) {
      throw new MAPParsingComponentException(
          "IOException when decoding UnstructuredSSResponseIndication: " + e.getMessage(),
          e,
          MAPParsingComponentExceptionReason.MistypedParameter);
    } catch (AsnException e) {
      throw new MAPParsingComponentException(
          "AsnException when decoding UnstructuredSSResponseIndication: " + e.getMessage(),
          e,
          MAPParsingComponentExceptionReason.MistypedParameter);
    }
  }