/**
* {@inheritDoc}
*/
public void action( ETypeInfo2Container eTypeInfo2Container ) throws DecoderException
{
TLV tlv = eTypeInfo2Container.getCurrentTLV();
// The Length should not be null
if ( tlv.getLength() == 0 )
{
LOG.error( I18n.err( I18n.ERR_04066 ) );
// This will generate a PROTOCOL_ERROR
throw new DecoderException( I18n.err( I18n.ERR_04067 ) );
}
// Now, let's decode the ETYPE-INFO2-ENTRY
Asn1Decoder etypeInfo2EntryDecoder = new Asn1Decoder();
ETypeInfo2EntryContainer etypeInfo2EntryContainer = new ETypeInfo2EntryContainer();
etypeInfo2EntryContainer.setStream( eTypeInfo2Container.getStream() );
// Compute the start position in the stream for the ETypeInfoEntry to decode :
// We have to move back to the ETypeInfoEntry tag
eTypeInfo2Container.rewind();
// Decode the ETypeInfo2Entry PDU
try
{
etypeInfo2EntryDecoder.decode( eTypeInfo2Container.getStream(), etypeInfo2EntryContainer );
}
catch ( DecoderException de )
{
throw de;
}
// Update the expected length for the current TLV
tlv.setExpectedLength( tlv.getExpectedLength() - tlv.getLength() );
// Update the parent
eTypeInfo2Container.updateParent();
// Store the ETypeInfoEntry in the container