code: public void seekRecordStart(CobolTypeFinder recordMatcher)
              throws IOException {
          int signatureLen = recordMatcher.getSignatureLen();
          if (signatureLen > hostBytes.length) {
              throw new IllegalArgumentException(
                      "The record matcher signature length is longer that the total record length");
          }
          int bytesRead = readFully(hostBytes, 0, signatureLen);
          if (bytesRead < signatureLen) {
              throw new IOException(
                      "Not enough bytes left for a record signature");
          }
          while (true) {
              if (recordMatcher.match(hostBytes, 0, signatureLen)) {
                  break;
              }
              // Shift the buffer one byte to the left
              System.arraycopy(hostBytes, 1, hostBytes, 0, signatureLen - 1);
  
              // Read one byte at end of buffer
              bytesRead += readFully(hostBytes, signatureLen - 1, 1);
          }
  
          // Keep track of the record part that was read to match the signature
          setBytesPrefetched(signatureLen);
  
          // Keep tally of how many bytes were read
          this.bytesRead += bytesRead;
  
          // Consider all bytes before the found record to be already processed
          this.bytesProcessed = this.bytesRead - signatureLen;
      }
docs: Match incoming data with the start of record pattern.
  <p/>
  After the initial try, slides one byte at a time until the start of a
  record is found.
  
  @param recordMatcher matches the start of a record
  @throws IOException typically if file does not contain a matching record
  start