* value has been decoded, <code>END</code> if whe still need to get some
* more bytes.
*/
private boolean treatValuePendingState( ByteBuffer stream, Asn1Container container )
{
TLV currentTlv = container.getCurrentTLV();
int length = currentTlv.getLength();
int currentLength = currentTlv.getValue().getCurrentLength();
int nbBytes = stream.remaining();
if ( ( currentLength + nbBytes ) < length )
{
currentTlv.getValue().addData( stream );
container.setState( TLVStateEnum.VALUE_STATE_PENDING );
return END;
}
else
{
int remaining = length - currentLength;
byte[] data = new byte[remaining];
stream.get( data, 0, remaining );
currentTlv.getValue().addData( data );
container.setState( TLVStateEnum.TLV_STATE_DONE );
return MORE;
}
}