public class ZipWriter extends Object implements AutoCloseable
Constructor and Description |
---|
ZipWriter(ZipOutputStream out)
Creates a new
ZipWriter with the specified ZipOutputStream . |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the writer.
|
void |
write(String name,
byte[] bytes)
Write a ZIP file entry with the specified
name and bytes . |
public ZipWriter(ZipOutputStream out)
ZipWriter
with the specified ZipOutputStream
.out
- The ZipOutputStream
.NullPointerException
- If out
is null.public void write(String name, byte[] bytes) throws IOException, ZipException
name
and bytes
.name
- The name of the ZIP file entry.bytes
- The content byte
array.IOException
- If an I/O error has occurred.ZipException
- If a ZIP error has occurred.public void close() throws IOException
close
in interface AutoCloseable
IOException
- If an I/O error has occurred.Copyright © 2020 LibJ. All rights reserved.