public static int indexOf(byte[] bytes, int bpos, int blen, byte[] search, int spos, int slen, boolean partial) {
        if (bytes == null || search == null || bpos < 0 || blen <= 0 || spos < 0 || slen < 0
                || bytes.length < (bpos + blen) || search.length < (spos + slen) || (!partial && blen < slen)) {
            return -1;
        } else if (slen == 0) {
            return 0;
        }

        return partial ? indexOfPartial(bytes, bpos, blen, search, spos, slen)
                : indexOfFull(bytes, bpos, blen, search, spos, slen);
    }
Returns the index of the first occurrence of the specified {@code search}
array within the given {@code bytes} array, considering specified positions
and lengths for both arrays and partial matching at the end of the bytes
array.

@param bytes   the byte array in which to search for the specified
               {@code search} array.
@param bpos    the starting position in the {@code bytes} array from which to
               search
@param blen    the number of bytes in the {@code bytes} array to consider for
               searching
@param search  the byte array to search for within the {@code bytes} array.
@param spos    the starting position in the {@code search} array to consider
               for matching
@param slen    the number of bytes in the {@code search} array to consider
               for matching
@param partial whether partial match should be considered
@return the index of the first occurrence of the search array within the
        bytes array, or -1 if the search array is not found
clickhouse-data/src/main/java/com/clickhouse/data/ClickHouseByteUtils.java