public static boolean equalConstantByteArray ( byte value , int len , byte [ ] arr ) { if ( arr == null || arr . length != len ) { return false ; } for ( int k = 0 ; k < len ; k ++ ) { if ( arr [ k ] != value ) { return false ; } } return true ; }
Checks if the given byte array starts with a constant sequence of bytes of the given value and length .