code: @Override
      public final int indexOf(final int maxBytes, final byte... bytes) throws IOException, ByteNotFoundException,
              IllegalArgumentException {
          if (bytes.length == 0) {
              throw new IllegalArgumentException("No bytes specified. Not sure what you want me to look for");
          }
  
          final int start = getReaderIndex();
          int index = -1;
  
          while (hasReadableBytes() && getReaderIndex() - start < maxBytes && index == -1) {
              if (isByteInArray(readByte(), bytes)) {
                  index = getReaderIndex() - 1;
              }
          }
  
          setReaderIndex(start);
  
          if (getReaderIndex() - start >= maxBytes) {
              throw new ByteNotFoundException(maxBytes, bytes);
          }
  
          return index;
      }
docs: {@inheritDoc}