code: public void encodeData(AsnOutputStream asnOs) throws MAPException {
          if (this.routeingNumber != null)
              ((RouteingNumberImpl) this.routeingNumber).encodeAll(asnOs, Tag.CLASS_CONTEXT_SPECIFIC, _ID_routeingNumber);
  
          if (this.imsi != null)
              ((IMSIImpl) this.imsi).encodeAll(asnOs, Tag.CLASS_CONTEXT_SPECIFIC, _ID_imsi);
  
          if (this.msisdn != null)
              ((ISDNAddressStringImpl) this.msisdn).encodeAll(asnOs, Tag.CLASS_CONTEXT_SPECIFIC, _ID_msisdn);
  
          if (this.numberPortabilityStatus != null) {
              try {
                  asnOs.writeInteger(Tag.CLASS_CONTEXT_SPECIFIC, _ID_numberPortabilityStatus,
                          this.numberPortabilityStatus.getType());
              } catch (IOException e) {
                  throw new MAPException("IOException when encoding " + _PrimitiveName + ": " + e.getMessage(), e);
              } catch (AsnException e) {
                  throw new MAPException("AsnException when encoding " + _PrimitiveName + ": " + e.getMessage(), e);
              }
          }
  
          if (this.extensionContainer != null)
              ((MAPExtensionContainerImpl) this.extensionContainer).encodeAll(asnOs, Tag.CLASS_CONTEXT_SPECIFIC,
                      _ID_extensionContainer);
      }
docs: /*
  (non-Javadoc)
  
  @see org.restcomm.protocols.ss7.map.primitives.MAPAsnPrimitive#encodeData (org.mobicents.protocols.asn.AsnOutputStream)