code: public void decode(AsnInputStream ais) throws ParseException {
  
          try {
              this.setLocalOriginated(false);
  
              AsnInputStream localAis = ais.readSequenceStream();
  
              int tag = localAis.readTag();
              if (localAis.getTagClass() != Tag.CLASS_UNIVERSAL) {
                  throw new ParseException(null, GeneralProblemType.MistypedComponent,
                          "Error while decoding Reject: bad tag class for InvokeID or NULL: tagClass = " + localAis.getTagClass());
              }
              switch (tag) {
                  case _TAG_IID:
                      this.invokeId = localAis.readInteger();
                      break;
                  case Tag.NULL:
                      localAis.readNull();
                      break;
              }
  
              tag = localAis.readTag();
              if (localAis.getTagClass() != Tag.CLASS_CONTEXT_SPECIFIC) {
                  throw new ParseException(null, GeneralProblemType.MistypedComponent,
                          "Error while decoding Reject: bad tag class for a problem: tagClass = " + localAis.getTagClass());
              }
              ProblemType pt = ProblemType.getFromInt(tag);
              if (pt == null) {
                  throw new ParseException(null, GeneralProblemType.MistypedComponent,
                          "Error while decoding Reject: ProblemType not found");
              }
              this.problem = TcapFactory.createProblem(pt, localAis);
  
          } catch (IOException e) {
              throw new ParseException(null, GeneralProblemType.BadlyStructuredComponent, "IOException while decoding Reject: "
                      + e.getMessage(), e);
          } catch (AsnException e) {
              throw new ParseException(null, GeneralProblemType.BadlyStructuredComponent, "AsnException while decoding Reject: "
                      + e.getMessage(), e);
          }
  
      }
docs: /*
  (non-Javadoc)
  
  @see org.restcomm.protocols.ss7.tcap.asn.Encodable#decode(org.mobicents.protocols .asn.AsnInputStream)