public static List < TLV > getlistTLV ( final byte [ ] pData , final ITag ... pTag ) { List < TLV > list = new ArrayList < TLV > ( ) ; TLVInputStream stream = new TLVInputStream ( new ByteArrayInputStream ( pData ) ) ; try { while ( stream . available ( ) > 0 ) { TLV tlv = TlvUtil . getNextTLV ( stream ) ; if ( tlv == null ) { break ; } if ( ArrayUtils . contains ( pTag , tlv . getTag ( ) ) ) { list . add ( tlv ) ; } else if ( tlv . getTag ( ) . isConstructed ( ) ) { list . addAll ( TlvUtil . getlistTLV ( tlv . getValueBytes ( ) , pTag ) ) ; } } } catch ( IOException e ) { LOGGER . error ( e . getMessage ( ) , e ) ; } finally { IOUtils . closeQuietly ( stream ) ; } return list ; }
Method used to get the list of TLV corresponding to tags specified in parameters