}
// Now, let's decode the HostAddress
Asn1Decoder hostAddressDecoder = new Asn1Decoder();
HostAddressContainer hostAddressContainer = new HostAddressContainer();
hostAddressContainer.setStream( hostAddressesContainer.getStream() );
// Compute the start position in the stream for the HostAdress to decode :
// We have to move back to the HostAddress tag
hostAddressesContainer.rewind();
// Decode the HostAddress PDU
try
{
hostAddressDecoder.decode( hostAddressesContainer.getStream(), hostAddressContainer );
}
catch ( DecoderException de )
{
throw de;
}
// Update the expected length for the current TLV
tlv.setExpectedLength( tlv.getExpectedLength() - tlv.getLength() );
// Update the parent
hostAddressesContainer.updateParent();
// Store the hostAddress in the container
HostAddress hostAddress = hostAddressContainer.getHostAddress();
hostAddressesContainer.addHostAddress( hostAddress );
if ( IS_DEBUG )
{
LOG.debug( "HostAddress added : {}", hostAddress );