public static void saveAsZip(OutputStream fout, String fileName, URI fileURI, SketchDocument doc) throws IOException {
ZipOutputStream out = new ZipOutputStream(fout);
String dir = fileName.replace(".leoz", "");
ZipEntry entry = new ZipEntry(dir+"/leo.xml");
out.putNextEntry(entry);
XMLWriter outx = new XMLWriter(new PrintWriter(new OutputStreamWriter(out,"UTF-8")),fileURI);
NativeExport export = new NativeExport();
export.setDelayedImageWriting(true);
ExportProcessor.process(export, outx, doc);
outx.flush();
out.closeEntry();
List images = export.getDelayedImages();
for(Object image : images) {
BufferedImage img = null;
String relUrl = null;