Closeable
, Flushable
, AutoCloseable
public class ZipFileOutputStream extends BufferedOutputStream
OutputStream
to a provided File
: In case the
file points to a ZIP compressed file, then a therein to be contained file
with the same name excluding the ".zip" extension is created by the
OutputStream
.buf, count
out
Constructor | Description |
---|---|
ZipFileOutputStream(File aFile) |
Instantiates a new zip file output stream impl.
|
ZipFileOutputStream(File parent,
String child) |
Instantiates a new zip file output stream impl.
|
ZipFileOutputStream(String pathname) |
Instantiates a new zip file output stream impl.
|
ZipFileOutputStream(String parent,
String child) |
Instantiates a new zip file output stream impl.
|
ZipFileOutputStream(URI uri) |
Instantiates a new zip file output stream impl.
|
Modifier and Type | Method | Description |
---|---|---|
protected static OutputStream |
toOutputStream(File aFile) |
Returns an
OutputStream to the provided File . |
flush, write, write
close, write
public ZipFileOutputStream(File parent, String child) throws ZipException, FileNotFoundException, IOException
parent
- the parentchild
- the childZipException
- the zip exceptionFileNotFoundException
- the file not found exceptionIOException
- Signals that an I/O exception has occurred.public ZipFileOutputStream(String parent, String child) throws ZipException, FileNotFoundException, IOException
parent
- the parentchild
- the childZipException
- the zip exceptionFileNotFoundException
- the file not found exceptionIOException
- Signals that an I/O exception has occurred.public ZipFileOutputStream(String pathname) throws ZipException, FileNotFoundException, IOException
pathname
- the pathnameZipException
- the zip exceptionFileNotFoundException
- the file not found exceptionIOException
- Signals that an I/O exception has occurred.public ZipFileOutputStream(URI uri) throws ZipException, FileNotFoundException, IOException
uri
- the uriZipException
- the zip exceptionFileNotFoundException
- the file not found exceptionIOException
- Signals that an I/O exception has occurred.public ZipFileOutputStream(File aFile) throws ZipException, FileNotFoundException, IOException
aFile
- the fileZipException
- the zip exceptionFileNotFoundException
- the file not found exceptionIOException
- Signals that an I/O exception has occurred.protected static OutputStream toOutputStream(File aFile) throws ZipException, IOException, FileNotFoundException
OutputStream
to the provided File
. In case the
file points to a ZIP compressed file (it has the file suffix ".zip"),
then the data written to the OutputStream
is being ZIP
compressed.aFile
- The File
for which to get the OutputStream
.OutputStream
, in case of a ZIP compressed File
was specified (with suffix ".zip"), then a compressed
OutputStream
is returned.ZipException
- in case there were problems when accessing the ZIP
compressed File
.IOException
- in case there were problems working with the
File
.FileNotFoundException
- in case there was none such File
found.Copyright © 2021. All rights reserved.