code: public void encodeData(AsnOutputStream asnOs) throws MAPException {
  
          if (this.ssCode == null)
              throw new MAPException("Error while encoding " + _PrimitiveName + ": ssCode required.");
  
          if (this.ssStatus == null)
              throw new MAPException("Error while encoding " + _PrimitiveName + ": ssStatus required.");
  
          if (this.basicServiceGroupList != null
                  && (this.basicServiceGroupList.size() < 1 || this.basicServiceGroupList.size() > 32)) {
              throw new MAPException("Error while encoding " + _PrimitiveName
                      + ": Parameter basicServiceGroupList size must be from 1 to 32, found: "
                      + this.basicServiceGroupList.size());
          }
  
          try {
  
              ((SSCodeImpl) this.ssCode).encodeAll(asnOs);
  
              ((ExtSSStatusImpl) this.ssStatus).encodeAll(asnOs, Tag.CLASS_CONTEXT_SPECIFIC, _TAG_ss_Status);
  
              if (this.ssSubscriptionOption != null) {
                  ((SSSubscriptionOptionImpl) this.ssSubscriptionOption).encodeAll(asnOs);
              }
  
              if (this.basicServiceGroupList != null) {
                  asnOs.writeTag(Tag.CLASS_UNIVERSAL, false, Tag.SEQUENCE);
                  int pos = asnOs.StartContentDefiniteLength();
                  for (ExtBasicServiceCode serviceItem : this.basicServiceGroupList) {
                      ((ExtBasicServiceCodeImpl) serviceItem).encodeAll(asnOs);
                  }
                  asnOs.FinalizeContent(pos);
              }
  
              if (this.extensionContainer != null)
                  ((MAPExtensionContainerImpl) this.extensionContainer).encodeAll(asnOs, Tag.CLASS_CONTEXT_SPECIFIC,
                          _TAG_extensionContainer);
          } 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)