code: public void encodeData(AsnOutputStream asnOs) throws MAPException {
          if (this.mlcNumber == null) {
              throw new MAPException("Encoding of " + _PrimitiveName
                      + " failed. Manadatory parameter mlcNumber [0] ISDN-AddressString is not set");
          }
  
          if (this.targetMS == null) {
              throw new MAPException("Encoding of " + _PrimitiveName
                      + " failed. Manadatory parameter targetMS [1] SubscriberIdentity is not set");
          }
  
          ((ISDNAddressStringImpl) this.mlcNumber).encodeAll(asnOs, Tag.CLASS_CONTEXT_SPECIFIC, _TAG_MLC_NUMBER);
  
          try {
              asnOs.writeTag(Tag.CLASS_CONTEXT_SPECIFIC, false, _TAG_TARGET_MS);
              int pos = asnOs.StartContentDefiniteLength();
              ((SubscriberIdentityImpl) this.targetMS).encodeAll(asnOs);
              asnOs.FinalizeContent(pos);
          } catch (AsnException e) {
              throw new MAPException("AsnException while encoding parameter targetMS [1] SubscriberIdentity");
          }
  
          if (this.extensionContainer != null) {
              ((MAPExtensionContainerImpl) this.extensionContainer).encodeAll(asnOs, Tag.CLASS_CONTEXT_SPECIFIC,
                      _TAG_EXTENSION_CONTAINER);
          }
      }
docs: /*
  (non-Javadoc)
  
  @see org.restcomm.protocols.ss7.map.api.primitives.MAPAsnPrimitive#encodeData
  (org.mobicents.protocols.asn.AsnOutputStream)