public static final boolean matchSequence ( byte [ ] sequence , byte [ ] buffer , int offset ) { boolean _result = ( sequence . length < ( buffer . length - offset ) ) ; if ( _result ) { for ( int _index = 0 ; _index < sequence . length ; _index ++ ) { if ( buffer [ _index ] != sequence [ _index ] ) { _result = false ; break ; } } } return _result ; }
Verify that each byte of a buffer match the corresponding byte of a given sequence starting from an offset .