public static byte [ ] decodeSequenceOptionalElement ( byte [ ] element ) { int index = 0 ; // check tag checkArgument ( ( element [ 0 ] & 0xE0 ) == 0xA0 , "Expected optional sequence element tag" ) ; index ++ ; // read length int length = decodeLength ( element , index ) ; index += encodedLengthSize ( length ) ; checkArgument ( length + index == element . length , "Invalid optional sequence element" ) ; return Arrays . copyOfRange ( element , index , index + length ) ; }
Decodes a optional element of a sequence .