/** * Parse a byte buffer and send back an integer * * @param value The byte buffer to parse * @return An integer * @throws LongDecoderException Thrown if the byte stream does not contains an integer */ public static long parse( BerValue value ) throws LongDecoderException { return parseLong( value ); }
/** * Reset the TLV, so it can be reused for the next PDU decoding. */ public void reset() { tag = 0; length = 0; lengthNbBytes = 0; value.reset(); expectedLength = 0; }
/** * {@inheritDoc} */ @Override public int getTlvId() { return tlv.getId(); }
/** * {@inheritDoc} */ @Override public int computeLength() { seqLength = 1 + 1 + BerValue.getNbBytes( getFlags() ); valueLength = 1 + TLV.getNbBytes( seqLength ) + seqLength; return valueLength; }
/** * {@inheritDoc} */ @Override public void updateParent() { TLV parentTlv = tlv.getParent(); while ( ( parentTlv != null ) && ( parentTlv.getExpectedLength() == 0 ) ) { parentTlv = parentTlv.getParent(); } this.parentTLV = parentTlv; }
/** * Creates a new GrammarTransition object. * * @param previousState the previous state * @param currentState The current state * @param currentTag the current TLV's tag */ public GrammarTransition( Enum<?> previousState, Enum<?> currentState, UniversalTag currentTag ) { this.previousState = previousState; this.currentState = currentState; this.currentTag = currentTag.getValue(); }
/** * Creates a new TLV object. * * @param id the TLV's id */ public TLV( int id ) { tag = 0; length = 0; lengthNbBytes = 0; value = new BerValue(); this.id = id; expectedLength = 0; }
/** * Parse a byte buffer and send back an integer * * @param value The byte buffer to parse * @return An integer * @throws IntegerDecoderException Thrown if the byte stream does not contains an integer */ public static int parse( BerValue value ) throws IntegerDecoderException { return parseInt( value ); }
/** * {@inheritDoc} */ @Override public void rewind() { int start = stream.position() - 1 - tlv.getLengthNbBytes(); stream.position( start ); }
/** * {@inheritDoc} */ @Override public int computeLength() { seqLength = 1 + 1 + BerValue.getNbBytes( getFlags() ); valueLength = 1 + TLV.getNbBytes( seqLength ) + seqLength; return valueLength; }
/** * {@inheritDoc} */ @Override public void updateParent() { TLV parentTlv = tlv.getParent(); while ( ( parentTlv != null ) && ( parentTlv.getExpectedLength() == 0 ) ) { parentTlv = parentTlv.getParent(); } this.parentTLV = parentTlv; }
/** * Creates a new GrammarTransition object. * * @param previousState the previous state * @param currentState The current state * @param currentTag the current TLV's tag */ public GrammarTransition( Enum<?> previousState, Enum<?> currentState, UniversalTag currentTag ) { this.previousState = previousState; this.currentState = currentState; this.currentTag = currentTag.getValue(); }
/** * {@inheritDoc} */ @Override public int getTlvId() { return tlv.getId(); }
/** * Creates a new TLV object. * * @param id the TLV's id */ public TLV( int id ) { tag = 0; length = 0; lengthNbBytes = 0; value = new BerValue(); this.id = id; expectedLength = 0; }
/** * Parse a byte buffer and send back an integer * * @param value The byte buffer to parse * @return An integer * @throws LongDecoderException Thrown if the byte stream does not contains an integer */ public static long parse( BerValue value ) throws LongDecoderException { return parseLong( value ); }
/** * Reset the TLV, so it can be reused for the next PDU decoding. */ public void reset() { tag = 0; length = 0; lengthNbBytes = 0; value.reset(); expectedLength = 0; }
/** * Parse a byte buffer and send back an integer * * @param value The byte buffer to parse * @return An integer * @throws IntegerDecoderException Thrown if the byte stream does not contains an integer */ public static int parse( BerValue value ) throws IntegerDecoderException { return parseInt( value ); }
/** * {@inheritDoc} */ @Override public void rewind() { int start = stream.position() - 1 - tlv.getLengthNbBytes(); stream.position( start ); }
/** * {@inheritDoc} */ @Override public int computeLength() { seqLength = 1 + 1 + BerValue.getNbBytes( getFlags() ); valueLength = 1 + TLV.getNbBytes( seqLength ) + seqLength; return valueLength; }
/** * Creates a new GrammarTransition object. * * @param previousState the previous state * @param currentState The current state * @param currentTag the current TLV's tag * @param action The action to execute. It could be null. */ public GrammarTransition( Enum<?> previousState, Enum<?> currentState, UniversalTag currentTag, Action<C> action ) { this.previousState = previousState; this.currentState = currentState; this.action = action; this.currentTag = currentTag.getValue(); }