Java JPEG Image Check isJPEG(byte[] b)

Here you can find the source of isJPEG(byte[] b)

Description

is JPEG

License

Apache License

Declaration

private static boolean isJPEG(byte[] b) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    private static boolean isJPEG(byte[] b) {
        if (b.length < 2) {
            return false;
        }// www.  ja  v  a  2s  .c o m
        return (b[0] == (byte) 0xFF) && (b[1] == (byte) 0xD8);
    }
}