✗
public class ZipOutputStream
extends java.util.zip.DeflaterOutputStream
implements java.util.zip.ZipConstants
Fields
- ✓public static final int DEFLATED = 8
- ✓public static final int STORED = 0
Constructors
- ✓public ZipOutputStream(java.io.OutputStream arg0)
- ✓public ZipOutputStream(java.io.OutputStream arg0, java.nio.charset.Charset arg1)
Methods
- ✓public void close() throws java.io.IOException
- ✓public void closeEntry() throws java.io.IOException
- ✓public void finish() throws java.io.IOException
- ✗public void putNextEntry(java.util.zip.ZipEntry arg0) throws java.io.IOExceptionComparing jdk-20-ga and jdk-21+35
putNextEntry
Begins writing a new ZIP file entry and positions the stream to the start of the entry data. Closes the current entry if still active.The default compression method will be used if no compression method was specified for the entry. When writing a compressed (DEFLATED) entry, and the compressed size has not been explicitly set with the
ZipEntry.setCompressedSize(long)method, then the compressed size will be set to the actual compressed size after deflation.The current time will be used if the entry has no set modification time.
- API Note:
- When writing a directory entry, the STORED compression method should be used and the size and CRC-32 values should be set to 0: This allows optimal performance when processing directory entries.
ZipEntry e = new ZipEntry(entryName); if (e.isDirectory()) { e.setMethod(ZipEntry.STORED); e.setSize(0); e.setCrc(0); } stream.putNextEntry(e); - Parameters:
e- the ZIP entry to be written- Throws:
ZipException- if a ZIP format error has occurredIOException- if an I/O error has occurred
- ✓public void setComment(java.lang.String arg0)
- ✓public void setLevel(int arg0)
- ✓public void setMethod(int arg0)
- ✓public void write(byte[] arg0, int arg1, int arg2) throws java.io.IOException
Summary
| Elements | Comments | Descriptions | Total | |||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Added | Changed | Removed | Added | Changed | Removed | Added | Changed | Removed | ||
| putNextEntry(ZipEntry) | 1 | 1 | ||||||||
| Total | 1 | 1 | ||||||||