public static boolean matchesRange(ByteBuffer buffer,int start,byte[] pattern){
  for (int i=0; i < pattern.length; ++i) {
    if (pattern[i] != buffer.get(start + i)) {
      return false;
    }
  }
  return true;
}

public static boolean matchesRange ( ByteBuffer buffer , int start , byte [ ] pattern ) { for ( int i = 0 ; i < pattern . length ; ++ i ) { if ( pattern [ i ] != buffer . get ( start + i ) ) { return false ; } } return true ; }
matches a pattern of bytes against the given buffer starting at the given offset .
