code: public void encode(AsnOutputStream aos) throws EncodeException {
  
          if (this.nationalOperationCode == null && this.privateOperationCode == null)
              throw new EncodeException("Operation code: No Operation code set!");
  
          try {
              if (this.type == OperationCodeType.National && this.nationalOperationCode != null) {
                  aos.writeInteger(Tag.CLASS_PRIVATE, OperationCode._TAG_NATIONAL, this.nationalOperationCode);
              } else if (this.type == OperationCodeType.Private && this.privateOperationCode != null) {
                  aos.writeInteger(Tag.CLASS_PRIVATE, OperationCode._TAG_PRIVATE, this.privateOperationCode);
              } else {
                  throw new EncodeException("Operation code: No Operation code set!");
              }
  
          } catch (IOException e) {
              throw new EncodeException("IOException while encoding OperationCode: " + e.getMessage(), e);
          } catch (AsnException e) {
              throw new EncodeException("AsnException while encoding OperationCode: " + e.getMessage(), e);
          }
      }
docs: /*
  (non-Javadoc)
  
  @see org.restcomm.protocols.ss7.tcap.asn.Encodable#encode(org.mobicents.protocols .asn.AsnOutputStream)