srecord noeq PicturesByMD5(File dir) { settable S extension = ".jpeg"; File imageFile(S md5) { ret newFile(dir, assertMD5(md5) + extension); } bool has(S md5) { ret isFile(imageFile(md5)); } BufferedImage get(S md5) { ret loadImage2(imageFile(md5)); } bool put(S md5, byte[] imageData) { if (has(md5)) false; saveBinaryFile(imageFile(md5), imageData); true; } }