code: public void encode(AsnOutputStream aos) throws EncodeException {
  
          if (this.getProblem() == null)
              throw new EncodeException("Error encoding Reject: RejectProblem must not be null");
  
          try {
              // tag
              aos.writeTag(Tag.CLASS_PRIVATE, false, Reject._TAG_REJECT);
              int pos = aos.StartContentDefiniteLength();
  
              // correlationId
              byte[] buf;
              if (this.correlationId != null) {
                  buf = new byte[1];
                  buf[0] = (byte) (long) this.correlationId;
              } else {
                  buf = new byte[0];
              }
              aos.writeOctetString(Tag.CLASS_PRIVATE, Component._TAG_INVOKE_ID, buf);
  
              // rejectProblem
              aos.writeInteger(Tag.CLASS_PRIVATE, Reject._TAG_REJECT_PROBLEM, this.rejectProblem.getType());
  
              // Empty parameter
              aos.writeTag(Tag.CLASS_PRIVATE, false, Parameter._TAG_SEQUENCE);
              aos.writeLength(0);
  
              aos.FinalizeContent(pos);
  
          } catch (IOException e) {
              throw new EncodeException("IOException while encoding Reject: " + e.getMessage(), e);
          } catch (AsnException e) {
              throw new EncodeException("AsnException while encoding Reject: " + e.getMessage(), e);
          }
      }
docs: /*
  (non-Javadoc)
  
  @see org.restcomm.protocols.ss7.tcap.asn.Encodable#encode(org.mobicents.protocols .asn.AsnOutputStream)