import java.io.File;
import java.util.Iterator;
import javax.imageio.ImageIO;
public class Main {
public static void main(String[] argv) throws Exception {
boolean b;
b = canReadMimeType("image/jpg");
b = canReadMimeType("image/jpeg");
}
public static boolean canReadMimeType(String mimeType) {
Iterator iter = ImageIO.getImageReadersByMIMEType(mimeType);
return iter.hasNext();
}
}
|