Class ZipOutputStream
java.lang.Object
java.io.OutputStream
net.lingala.zip4j.io.outputstream.ZipOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate CompressedOutputStream
private CountingOutputStream
private CRC32
private boolean
private FileHeader
private FileHeaderFactory
private HeaderWriter
private LocalFileHeader
private char[]
private RawIO
private boolean
private long
private Zip4jConfig
private ZipModel
-
Constructor Summary
ConstructorsConstructorDescriptionZipOutputStream
(OutputStream outputStream) ZipOutputStream
(OutputStream outputStream, char[] password) ZipOutputStream
(OutputStream outputStream, char[] password, Charset charset) ZipOutputStream
(OutputStream outputStream, char[] password, Zip4jConfig zip4jConfig, ZipModel zipModel) ZipOutputStream
(OutputStream outputStream, Charset charset) -
Method Summary
Modifier and TypeMethodDescriptionprivate ZipParameters
cloneAndPrepareZipParameters
(ZipParameters zipParameters) void
close()
private void
private void
initializeAndWriteFileHeader
(ZipParameters zipParameters) private CipherOutputStream
<?> initializeCipherOutputStream
(ZipEntryOutputStream zipEntryOutputStream, ZipParameters zipParameters) private CompressedOutputStream
initializeCompressedOutputStream
(CipherOutputStream<?> cipherOutputStream, ZipParameters zipParameters) private CompressedOutputStream
initializeCompressedOutputStream
(ZipParameters zipParameters) private ZipModel
initializeZipModel
(ZipModel zipModel, CountingOutputStream countingOutputStream) void
putNextEntry
(ZipParameters zipParameters) private void
reset()
void
setComment
(String comment) private void
verifyZipParameters
(ZipParameters zipParameters) void
write
(byte[] b) void
write
(byte[] b, int off, int len) void
write
(int b) private boolean
writeCrc
(FileHeader fileHeader) private void
Methods inherited from class java.io.OutputStream
flush
-
Field Details
-
countingOutputStream
-
password
private char[] password -
zipModel
-
compressedOutputStream
-
fileHeader
-
localFileHeader
-
fileHeaderFactory
-
headerWriter
-
crc32
-
rawIO
-
uncompressedSizeForThisEntry
private long uncompressedSizeForThisEntry -
zip4jConfig
-
streamClosed
private boolean streamClosed -
entryClosed
private boolean entryClosed
-
-
Constructor Details
-
ZipOutputStream
- Throws:
IOException
-
ZipOutputStream
- Throws:
IOException
-
ZipOutputStream
- Throws:
IOException
-
ZipOutputStream
public ZipOutputStream(OutputStream outputStream, char[] password, Charset charset) throws IOException - Throws:
IOException
-
ZipOutputStream
public ZipOutputStream(OutputStream outputStream, char[] password, Zip4jConfig zip4jConfig, ZipModel zipModel) throws IOException - Throws:
IOException
-
-
Method Details
-
putNextEntry
- Throws:
IOException
-
write
- Specified by:
write
in classOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
closeEntry
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
-
setComment
- Throws:
IOException
-
ensureStreamOpen
- Throws:
IOException
-
initializeZipModel
-
initializeAndWriteFileHeader
- Throws:
IOException
-
reset
- Throws:
IOException
-
writeSplitZipHeaderIfApplicable
- Throws:
IOException
-
initializeCompressedOutputStream
private CompressedOutputStream initializeCompressedOutputStream(ZipParameters zipParameters) throws IOException - Throws:
IOException
-
initializeCipherOutputStream
private CipherOutputStream<?> initializeCipherOutputStream(ZipEntryOutputStream zipEntryOutputStream, ZipParameters zipParameters) throws IOException - Throws:
IOException
-
initializeCompressedOutputStream
private CompressedOutputStream initializeCompressedOutputStream(CipherOutputStream<?> cipherOutputStream, ZipParameters zipParameters) -
verifyZipParameters
-
writeCrc
-
cloneAndPrepareZipParameters
-