document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1.  import java.awt.image.*;  
  2.  import javax.imageio.*;  
  3.  import java.io.*;  
  4.  import java.util.*;  
  5.  public class ImgFileManager  
  6.  {  
  7.    private static final String IMAGE_FORMAT = "jpg";  
  8.    public static Image loadImage(File imageFile){  
  9.      try{  
  10.        BufferedImage image = ImageIO.read(imageFile);  
  11.        if(image == null || image.getWidth(null) < 0){  
  12.          return null;  
  13.        }  
  14.        return new Image(image);  
  15.      }  
  16.      catch(IOException exc){  
  17.        return null;  
  18.      }  
  19.    }  
  20.    public static void saveImage(Image image, File file)  
  21.    {  
  22.      try{  
  23.        ImageIO.write(image, IMAGE_FORMAT, file);  
  24.      }  
  25.      catch(IOException exc){  
  26.        return;  
  27.      }  
  28.    }  
  29.  }  
');