code: public void encode(AsnOutputStream aos) throws EncodeException {
  
          // if (this.originatingTransactionId == null)
          // throw new ParseException("Error encoding TC-Begin: originatingTransactionId must not be null");
  
          try {
              aos.writeTag(Tag.CLASS_APPLICATION, false, _TAG);
              int pos = aos.StartContentDefiniteLength();
  
              // Utils.writeTransactionId(aos, this.originatingTransactionId, Tag.CLASS_APPLICATION, _TAG_OTX);
              aos.writeOctetString(Tag.CLASS_APPLICATION, _TAG_OTX, this.originatingTransactionId);
  
              if (this.dp != null)
                  this.dp.encode(aos);
  
              if (component != null) {
                  aos.writeTag(Tag.CLASS_APPLICATION, false, Component._COMPONENT_TAG);
                  int pos2 = aos.StartContentDefiniteLength();
                  for (Component c : this.component) {
                      c.encode(aos);
                  }
                  aos.FinalizeContent(pos2);
              }
  
              aos.FinalizeContent(pos);
  
          } catch (IOException e) {
              throw new EncodeException("IOException while encoding TC-Begin: " + e.getMessage(), e);
          } catch (AsnException e) {
              throw new EncodeException("AsnException while encoding TC-Begin: " + e.getMessage(), e);
          }
  
      }
docs: /*
  (non-Javadoc)
  
  @see org.restcomm.protocols.ss7.tcap.asn.Encodable#encode(org.mobicents.protocols .asn.AsnOutputStream)