Package java.util.zip

Examples of java.util.zip.ZipOutputStream.closeEntry()


  byte[] data = new byte[(int)inEnt.getSize()];
  in.read(data); // read data for this old entry
  in.closeEntry();
  out.putNextEntry(outEnt);
  out.write(data); // copy it to the new entry
  out.closeEntry();
}
in.close();

in = new JarInputStream(new FileInputStream(toJar));
// copy the files from the old JAR to the new, but don't close the new JAR yet
View Full Code Here


  in.read(data); // read data for this old entry
  in.closeEntry();
try{
    out.putNextEntry(outEnt);
    out.write(data); // copy it to the new entry
    out.closeEntry();
}
catch (IOException ioe) {
    System.out.println("exception trying to put entry "+outEnt.getName());
    out.closeEntry();
}
View Full Code Here

    out.write(data); // copy it to the new entry
    out.closeEntry();
}
catch (IOException ioe) {
    System.out.println("exception trying to put entry "+outEnt.getName());
    out.closeEntry();
}

}
// and *now* we close the new JAR file.
out.close();
View Full Code Here

      ZipEntry ze = new ZipEntry("foo");
      byte[] data = "some-content".getBytes("UTF-8");
      ze.setSize(data.length);
      tos.putNextEntry(ze);
      tos.write(data);
      tos.closeEntry();
      tos.flush();
      tos.finish();
    } finally {
      tos.close();
    }
View Full Code Here

        output.delete();

        ZipOutputStream out = new ZipOutputStream(new FileOutputStream(output));

        out.putNextEntry(new ZipEntry("org/test/TestA.class"));
        out.closeEntry();
        out.putNextEntry(new ZipEntry("org/test/TestB.class"));
        out.closeEntry();
        out.close();
        return output;
    }
View Full Code Here

        ZipOutputStream out = new ZipOutputStream(new FileOutputStream(output));

        out.putNextEntry(new ZipEntry("org/test/TestA.class"));
        out.closeEntry();
        out.putNextEntry(new ZipEntry("org/test/TestB.class"));
        out.closeEntry();
        out.close();
        return output;
    }
}
View Full Code Here

        XMLWriter outx = new XMLWriter(new PrintWriter(new OutputStreamWriter(out,"UTF-8")),file.toURI());
        NativeExport export = new NativeExport();
        export.setDelayedImageWriting(true);
        ExportProcessor.process(export, outx, ((SketchDocument)context.getDocument()));
        outx.flush();
        out.closeEntry();

        List images = export.getDelayedImages();
        Map<String,BufferedImage> writtenImages = new HashMap<String,BufferedImage>();
        for(Object i : images) {
            if(i instanceof SImage) {
View Full Code Here

                if(!writtenImages.containsKey(image.getRelativeURL())) {
                    ZipEntry ie = new ZipEntry(dir+"/resources/"+image.getRelativeURL());
                    out.putNextEntry(ie);
                    ImageIO.write(image.getBufferedImage(),"png",out);
                    out.flush();
                    out.closeEntry();
                    writtenImages.put(image.getRelativeURL(),image.getBufferedImage());
                }
            }
            if(i instanceof PatternPaint) {
                PatternPaint paint = (PatternPaint) i;
View Full Code Here

                    u.p("saving the real pattern paint  with relative url " + paint.getRelativeURL());
                    ZipEntry ie = new ZipEntry(dir+"/resources/"+ paint.getRelativeURL());
                    out.putNextEntry(ie);
                    ImageIO.write(paint.getImage(),"png",out);
                    out.flush();
                    out.closeEntry();
                    writtenImages.put(paint.getRelativeURL(),paint.getImage());
                }
            }
        }
        out.close();
View Full Code Here

        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;
            if(image instanceof SImage) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.