code: protected static int findSequence(byte[] sequence, byte[] buffer) {
          int pos = -1;
          for (int i = 0; i < buffer.length - sequence.length + 1; i++) {
              if (buffer[i] == sequence[0] && testRemaining(sequence, buffer, i)) {
                  pos = i;
                  break;
              }
          }
          return pos;
      }
docs: Finds the start of the given sequence in the buffer. If not found, -1 is
  returned.
  
  @param sequence the sequence to locate
  @param buffer the buffer to search
  @return the starting position of the sequence in the buffer if found;
  otherwise -1