Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void writeImage(BufferedImage image, File file) throws IOException {
- //Slow
- ImageIO.write(image, "PNG", file);
- //Mildly faster
- BufferedOutputStream imageOutputStream = new BufferedOutputStream(new FileOutputStream(file));
- ImageIO.write(image, "PNG", imageOutputStream);
- imageOutputStream.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement