コード例 #1
0
 /*
  * (non-Javadoc)
  *
  * @see org.mobicents.protocols.ss7.tcap.asn.Encodable#encode(org.mobicents.protocols .asn.AsnOutputStream)
  */
 public void encode(AsnOutputStream aos) throws EncodeException {
   try {
     aos.writeOctetString(
         Tag.CLASS_PRIVATE, ProtocolVersion._TAG_PROTOCOL_VERSION, new byte[] {(byte) this.data});
   } catch (IOException e) {
     throw new EncodeException("IOException while encoding ProtocolVersion: " + e.getMessage(), e);
   } catch (AsnException e) {
     throw new EncodeException(
         "AsnException while encoding ProtocolVersion: " + e.getMessage(), e);
   }
 }
コード例 #2
0
  public void encodeData(AsnOutputStream asnOs) throws MAPException {

    if (this.ussdString == null) throw new MAPException("ussdString must not be null");

    try {
      asnOs.writeOctetString(new byte[] {(byte) this.ussdDataCodingSch.getCode()});

      ((USSDStringImpl) this.ussdString).encodeAll(asnOs);

    } catch (IOException e) {
      throw new MAPException("IOException when encoding UnstructuredSSResponseIndication", e);
    } catch (AsnException e) {
      throw new MAPException("AsnException when encoding UnstructuredSSResponseIndication", e);
    }
  }