package util;

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;

public class FileHandler {
	public static BufferedImage loadBufferedImage(String path) {
		try {
			return ImageIO.read(FileHandler.class.getResource(path));
		} catch(IllegalArgumentException e) {
			//e.printStackTrace();
			return null;
		} catch(IOException e) {
			e.printStackTrace();
			return null;
		}
	}
	public static void writeImage(BufferedImage image, String path) {
		try {
			ImageIO.write(image, "png", new File(path));
		} catch (IOException e) {
			// Not supposed to happen.
			e.printStackTrace();
		}
	}
	
	
}

@@ -440,16 +440,19 @@
 %0A%09%09%7D%0A%09%7D%0A
+%09%0A%0A
 %09public 
@@ -468,16 +468,24 @@
 id write
+Buffered
 Image(Bu
@@ -667,10 +667,12 @@
 %0A%09%7D%0A%09%0A%09%0A
+%09%0A
 %7D%0A

add util