code: public void decode(AsnInputStream ais) throws ParseException {
  
          try {
              AsnInputStream localAis = ais.readSequenceStream();
  
              int tag = localAis.readTag();
              if (tag != Tag.INTEGER && localAis.getTagClass() != Tag.CLASS_UNIVERSAL)
                  throw new ParseException(PAbortCauseType.IncorrectTxPortion, null,
                          "Error while decoding AARE-apdu.result: bad tag or tag class: tag=" + tag + ", tagClass="
                                  + localAis.getTagClass());
  
              // y, its a bit of enum, should be ok to cast :)
              long t = localAis.readInteger();
              this.resultType = ResultType.getFromInt(t);
          } catch (IOException e) {
              throw new ParseException(PAbortCauseType.BadlyFormattedTxPortion, null, "IOException while decoding Result: "
                      + e.getMessage(), e);
          } catch (AsnException e) {
              throw new ParseException(PAbortCauseType.BadlyFormattedTxPortion, null, "AsnException while decoding Result: "
                      + e.getMessage(), e);
          }
      }
docs: /*
  (non-Javadoc)
  
  @see org.restcomm.protocols.ss7.tcap.asn.Encodable#decode(org.mobicents.protocols .asn.AsnInputStream)