public static boolean equalIncreasingByteArray ( int start , int len , byte [ ] arr ) { if ( arr == null || arr . length != len ) { return false ; } for ( int k = 0 ; k < len ; k ++ ) { if ( arr [ k ] != ( byte ) ( start + k ) ) { return false ; } } return true ; }
Checks if the given byte array starts with an increasing sequence of bytes of the given length starting from the given value . The array length must be equal to the length checked .