checks if imageheaderbytes starts with soi start of image marker , followed by 0xff . if headersize is lower than 3 false is returned . description of jpeg format can be found here : http://www.w3.org/graphics/jpeg/itu-t81.pdf annex b deals with compressed data format concode_field_sep byte[] GIF_HEADER_89A concode_elem_sep byte[] JPEG_HEADER concode_elem_sep byte[] PNG_HEADER concode_elem_sep byte[] BMP_HEADER concode_elem_sep int GIF_HEADER_LENGTH concode_elem_sep int EXTENDED_WEBP_HEADER_LENGTH concode_elem_sep int SIMPLE_WEBP_HEADER_LENGTH concode_elem_sep byte[] GIF_HEADER_87A concode_elem_sep int MAX_HEADER_LENGTH concode_field_sep boolean isGifHeader concode_elem_sep ImageFormat getImageFormat concode_elem_sep ImageFormat getImageFormat concode_elem_sep byte[] asciiBytes concode_elem_sep boolean isPngHeader concode_elem_sep int readHeaderFromStream concode_elem_sep boolean matchBytePattern concode_elem_sep ImageFormat doGetImageFormat concode_elem_sep boolean isBmpHeader concode_elem_sep ImageFormat getImageFormat_WrapIOException concode_elem_sep ImageFormat getWebpFormat
boolean function ( final byte [ ] arg0 , final int arg1 ) { return arg1 >= JPEG_HEADER . length && matchBytePattern ( arg0 , 0 , JPEG_HEADER ) ; }