Advertisement
Guest User

Untitled

a guest
Sep 12th, 2014
11,583
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.37 KB | None | 0 0
  1.     public static void writeImage(BufferedImage image, File file) throws IOException {
  2.         //Slow
  3.         ImageIO.write(image, "PNG", file);
  4.  
  5.         //Mildly faster
  6.         BufferedOutputStream imageOutputStream = new BufferedOutputStream(new FileOutputStream(file));
  7.         ImageIO.write(image, "PNG", imageOutputStream);
  8.         imageOutputStream.close();
  9.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement