public void decode(AsnInputStream ais) throws ParseException {

        this.correlationId = null;
        this.correlationInvoke = null;
        this.operationCode = null;
        this.parameter = null;

        try {
            if (ais.getTag() == Invoke._TAG_INVOKE_NOT_LAST)
                this.setNotLast(true);
            else
                this.setNotLast(false);

            AsnInputStream localAis = ais.readSequenceStream();

            // invokeId & correlationId
            byte[] buf = TcapFactory.readComponentId(localAis, 0, 2);
            if (buf.length >= 1)
                this.setInvokeId((long) buf[0]);
            if (buf.length >= 2)
                this.setCorrelationId((long) buf[1]);

            // operationCode
            if (localAis.available() == 0)
                throw new ParseException(RejectProblem.generalBadlyStructuredCompPortion, "OperationCode is not found when decoding Invoke");
            int tag = localAis.readTag();
            if ((tag != OperationCode._TAG_NATIONAL && tag != OperationCode._TAG_PRIVATE) || localAis.getTagClass() != Tag.CLASS_PRIVATE
                    || !localAis.isTagPrimitive()) {
                throw new ParseException(RejectProblem.generalIncorrectComponentPortion,
                        "OperationCode in Invoke has bad tag or tag class or is not primitive: tag=" + tag + ", tagClass=" + localAis.getTagClass());
            }
            this.operationCode = TcapFactory.createOperationCode(localAis);

            // Parameter
            this.parameter = TcapFactory.readParameter(localAis);
        } catch (IOException e) {
            throw new ParseException(RejectProblem.generalBadlyStructuredCompPortion,
                    "IOException while decoding Invoke: " + e.getMessage(), e);
        } catch (AsnException e) {
            throw new ParseException(RejectProblem.generalBadlyStructuredCompPortion,
                    "AsnException while decoding Invoke: " + e.getMessage(), e);
        } catch (ParseException e) {
            e.setInvokeId(this.invokeId);
            throw e;
        }
    }
public void decode ( AsnInputStream ais ) throws ParseException { this . correlationId = null ; this . correlationInvoke = null ; this . operationCode = null ; this . parameter = null ; try { if ( ais . getTag ( ) == Invoke . _TAG_INVOKE_NOT_LAST ) this . setNotLast ( true ) ; else this . setNotLast ( false ) ; AsnInputStream localAis = ais . readSequenceStream ( ) ; byte [ ] buf = TcapFactory . readComponentId ( localAis , 0 , 2 ) ; if ( buf . length >= 1 ) this . setInvokeId ( ( long ) buf [ 0 ] ) ; if ( buf . length >= 2 ) this . setCorrelationId ( ( long ) buf [ 1 ] ) ; if ( localAis . available ( ) == 0 ) throw new ParseException ( RejectProblem . generalBadlyStructuredCompPortion , "OperationCode is not found when decoding Invoke" ) ; int tag = localAis . readTag ( ) ; if ( ( tag != OperationCode . _TAG_NATIONAL && tag != OperationCode . _TAG_PRIVATE ) || localAis . getTagClass ( ) != Tag . CLASS_PRIVATE || ! localAis . isTagPrimitive ( ) ) { throw new ParseException ( RejectProblem . generalIncorrectComponentPortion , "OperationCode in Invoke has bad tag or tag class or is not primitive: tag=" + tag + ", tagClass=" + localAis . getTagClass ( ) ) ; } this . operationCode = TcapFactory . createOperationCode ( localAis ) ; this . parameter = TcapFactory . readParameter ( localAis ) ; } catch ( IOException e ) { throw new ParseException ( RejectProblem . generalBadlyStructuredCompPortion , "IOException while decoding Invoke: " + e . getMessage ( ) , e ) ; } catch ( AsnException e ) { throw new ParseException ( RejectProblem . generalBadlyStructuredCompPortion , "AsnException while decoding Invoke: " + e . getMessage ( ) , e ) ; } catch ( ParseException e ) { e . setInvokeId ( this . invokeId ) ; throw e ; } }
/*
(non-Javadoc)

@see org.restcomm.protocols.ss7.tcap.asn.Encodable#decode(org.mobicents.protocols .asn.AsnInputStream)