package es; import java.io.*; import javax.imageio.*; import java.awt.image.*; class PostProcess { public String FileOps(BufferedImage bi,String strDirOutputImg){ String strMissatgeRetorn=""; boolean bFlagFileNotFound=false; try { FileOutputStream fop = new FileOutputStream(strDirOutputImg); ImageIO.write(bi,"png",fop); } catch (IOException ioe){ strMissatgeRetorn="Directorio o nombre del archivo no válido"; bFlagFileNotFound=true; } if(!bFlagFileNotFound) strMissatgeRetorn="Hecho! "; return strMissatgeRetorn; } }