public static boolean startsWith(final byte[] buffer, final byte[] search) {
        if (search == null) {
            return false;
        }
        if (buffer == null) {
            return false;
        }
        if (search.length > buffer.length) {
            return false;
        }
        for (int i = 0; i < search.length; i++) {
            if (search[i] != buffer[i]) {
                return false;
            }
        }
        return true;
    }
Consumes the {@code InputStream} (without closing it) searching for a quad. It will stop either when the quad is found, or when there are no more bytes
in the input stream.

<p>
Returns {@code true} if it found the quad, and {@code false} otherwise.

@param quad a quad (the needle)
@param in  an input stream (the haystack)
@return {@code true} if it found the quad, and {@code false} otherwise
@throws IOException if it fails to read from the given input stream
src/main/java/org/apache/commons/imaging/common/BinaryFunctions.java