Here you can find the source of bufferedImageToFile(BufferedImage src, String path)
public static boolean bufferedImageToFile(BufferedImage src, String path)
//package com.java2s; //License from project: Open Source License import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import javax.imageio.ImageIO; public class Main { public static boolean bufferedImageToFile(BufferedImage src, String path) { try {//w w w .ja va 2 s. c o m File outputFile = new File(path); ImageIO.write(src, "png", outputFile); return true; } catch (IOException e) { e.printStackTrace(); } return false; } }