private static boolean matchBytePattern(
      final byte[] byteArray, final int offset, final byte[] pattern) {
    if (pattern == null || byteArray == null) {
      return false;
    }
    if (pattern.length + offset > byteArray.length) {
      return false;
    }

    for (int i = 0; i < pattern.length; ++i) {
      if (byteArray[i + offset] != pattern[i]) {
        return false;
      }
    }

    return true;
  }
Checks if imageHeaderBytes contains WEBP_RIFF_BYTES and WEBP_NAME_BYTES and if the header is
long enough to be WebP's header. WebP file format can be found here: <a
href="https://developers.google.com/speed/webp/docs/riff_container">
https://developers.google.com/speed/webp/docs/riff_container</a>

@param imageHeaderBytes image header bytes
@return true if imageHeaderBytes contains a valid webp header
fbcore/src/main/java/com/facebook/common/webp/WebpSupportStatus.java