code: public void encodeData(AsnOutputStream asnOs) throws MAPException {
  
          if (this.cugInterlock == null)
              throw new MAPException("Error while encoding " + _PrimitiveName + ": cugInterlock required.");
  
          if (this.intraCugOptions == null)
              throw new MAPException("Error while encoding " + _PrimitiveName + ": intraCugOptions required.");
  
          try {
  
              asnOs.writeInteger(this.cugIndex);
  
              ((CUGInterlockImpl) this.cugInterlock).encodeAll(asnOs);
  
              asnOs.writeInteger(Tag.CLASS_UNIVERSAL, Tag.ENUMERATED, this.intraCugOptions.getCode());
  
              if (this.basicService != null) {
                  if (this.basicService.size() < 1 || this.basicService.size() > 32) {
                      throw new MAPException("Error while encoding " + _PrimitiveName
                              + ".basicService: basicServiceGroupList must be from 1 to 32 size, found: "
                              + this.basicService.size());
                  }
  
                  asnOs.writeTag(Tag.CLASS_UNIVERSAL, false, Tag.SEQUENCE);
                  int pos = asnOs.StartContentDefiniteLength();
                  for (ExtBasicServiceCode be : this.basicService) {
                      ExtBasicServiceCodeImpl bee = (ExtBasicServiceCodeImpl) be;
                      bee.encodeAll(asnOs);
                  }
                  asnOs.FinalizeContent(pos);
              }
  
              if (this.extensionContainer != null)
                  ((MAPExtensionContainerImpl) this.extensionContainer).encodeAll(asnOs, Tag.CLASS_CONTEXT_SPECIFIC,
                          _TAG_extensionContainer);
          } 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)