code: public void encodeData(AsnOutputStream asnOs) throws MAPException {
  
          if (this.csgId == null)
              throw new MAPException("Parametr csgId must not be null");
  
          try {
              ((CSGIdImpl) this.csgId).encodeAll(asnOs, Tag.CLASS_CONTEXT_SPECIFIC, _ID_csgId);
  
              if (this.extensionContainer != null)
                  ((MAPExtensionContainerImpl) this.extensionContainer).encodeAll(asnOs, Tag.CLASS_CONTEXT_SPECIFIC,
                          _ID_extensionContainer);
  
              byte[] buf = new byte[1];
              if (this.accessMode != null) {
                  buf[0] = (byte) (int) this.accessMode;
                  asnOs.writeOctetString(Tag.CLASS_CONTEXT_SPECIFIC, _ID_accessMode, buf);
              }
  
              if (this.cmi != null) {
                  buf[0] = (byte) (int) this.cmi;
                  asnOs.writeOctetString(Tag.CLASS_CONTEXT_SPECIFIC, _ID_cmi, buf);
              }
          } 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);
          }
      }
docs: /*
  (non-Javadoc)
  
  @see org.restcomm.protocols.ss7.map.primitives.MAPAsnPrimitive#encodeData (org.mobicents.protocols.asn.AsnOutputStream)