public static byte [ ] getValue ( final byte [ ] pData , final ITag ... pTag ) { byte [ ] ret = null ; if ( pData != null ) { 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 ( ) ) ) { return tlv . getValueBytes ( ) ; } else if ( tlv . getTag ( ) . isConstructed ( ) ) { ret = TlvUtil . getValue ( tlv . getValueBytes ( ) , pTag ) ; if ( ret != null ) { break ; } } } } catch ( IOException e ) { LOGGER . error ( e . getMessage ( ) , e ) ; } finally { IOUtils . closeQuietly ( stream ) ; } } return ret ; }
Method used to get Tag value