Add ImageIO.java for jdpi.awt wrapper

This commit is contained in:
Duy Tran Khanh committed 2021-01-17 17:25:30 +07:00
1 parent e5aabc8641
commit 425f6eddbe
1 file changed
+31
@@ -0,0 +1,31 @@
package jdpi.imageio;
import java.io.*;
import java.net.URL;
import jdpi.awt.*;
import jdpi.awt.image.*;
public class ImageIO {
public static void setUseCache(boolean set) {
}
public static BufferedImage read(InputStream is) throws IOException {
return new BufferedImage(javax.imageio.ImageIO.read(is));
}
public static BufferedImage read(File input) throws IOException {
return read(new FileInputStream(input));
}
public static BufferedImage read(URL input) throws IOException {
BufferedImage img = read(input.openStream());
input.close();
return img;
}
public static boolean write(RenderedImage im, String formatName, File output) {
System.out.println("ImageIO.write stub " + output);
return true;
}
}