code: public void encode(AsnOutputStream aos) throws EncodeException {
  
          if (invokeId == null)
              throw new EncodeException("No Invoke ID set.");
  
          try {
              aos.writeTag(Tag.CLASS_CONTEXT_SPECIFIC, false, _TAG);
              int pos = aos.StartContentDefiniteLength();
  
              aos.writeInteger(this.invokeId);
  
              if (this.operationCode != null && this.parameter != null) {
                  aos.writeTag(Tag.CLASS_UNIVERSAL, false, Tag.SEQUENCE);
                  int pos2 = aos.StartContentDefiniteLength();
                  this.operationCode.encode(aos);
                  this.parameter.encode(aos);
                  aos.FinalizeContent(pos2);
              }
  
              aos.FinalizeContent(pos);
  
          } catch (IOException e) {
              throw new EncodeException("IOException while encoding ReturnResult: " + e.getMessage(), e);
          } catch (AsnException e) {
              throw new EncodeException("AsnException while encoding ReturnResult: " + e.getMessage(), e);
          }
      }
docs: /*
  (non-Javadoc)
  
  @see org.restcomm.protocols.ss7.tcap.asn.Encodable#encode(org.mobicents.protocols .asn.AsnOutputStream)