Find byte[] in byte[] with Java
If you want to look for a particular chunk of bytes in a PNG file, don't scan it naïvely byte by byte.  Not only would it be slow, you could also accidentally match some data that happens to look like a marker.

Instead, you should take advantage of the chunk layout described in the PNG specification.  Each chunk is tagged with a type and a length.  If the tag is of a type that you are not interested in, seek ahead to the next chunk — the length field will tell you how many bytes to skip.