尽管通常可以依靠PNG,JPG和GIF,但受支持的类型可能会因制造商和版本而异。
import javax.imageio.ImageIO;public class QuickTest { public static void main(String[] args) throws Exception { String[] types = ImageIO.getReaderFileSuffixes(); System.out.println("This JRE supports image types:"); for (String type : types) { System.out.println("Type: " + type); } }}在这里/现在输出
This JRE supports image types:Type: bmpType: jpgType: wbmpType: jpegType: pngType: gif



