code: public static boolean isWebpHeader(
        final byte[] imageHeaderBytes,
        final int offset,
        final int headerSize) {
      return headerSize >= SIMPLE_WEBP_HEADER_LENGTH &&
          matchBytePattern(imageHeaderBytes, offset, WEBP_RIFF_BYTES) &&
          matchBytePattern(imageHeaderBytes, offset + 8, WEBP_NAME_BYTES);
    }
docs: 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