Package jetbrains.buildServer.zip
Class ZipOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.FilterOutputStream
-
- jetbrains.buildServer.zip.ZipOutputStream
-
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
public abstract class ZipOutputStream extends FilterOutputStream
An output stream filter for writing files in the ZIP file format. Only compressed (deflated) entries are supported.
Instances of this class are not thread safe.
- Since:
- 2017.2.4, 2018.1
- Author:
- Andrey Shcheglov <mailto:andrey.shcheglov@jetbrains.com>
- See Also:
Deflater
-
-
Field Summary
-
Fields inherited from class java.io.FilterOutputStream
out
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the ZIP output stream as well as the stream being filtered.voidwrite(byte[] data, int offset, int length)Writes an array of bytes to the current ZIP entry data.voidwrite(int b)Writes a byte to the compressed output stream.-
Methods inherited from class java.io.FilterOutputStream
flush, write
-
-
-
-
Method Detail
-
write
public final void write(int b) throws IOExceptionWrites a byte to the compressed output stream. This method will block until the byte can be written.
- Overrides:
writein classFilterOutputStream- Parameters:
b- thebyteto be written.- Throws:
IOException- if an I/O error has occurred.
-
write
public final void write(@NotNull byte[] data, int offset, int length) throws IOExceptionWrites an array of bytes to the current ZIP entry data. This method will block until all the bytes are written.
- Overrides:
writein classFilterOutputStream- Parameters:
data- the data to be written.offset- the start offset in the data.length- the number of bytes that are written.- Throws:
ZipException- if a ZIP file error has occurred.IOException- if an I/O error has occurred.InterruptedIOException- if the thread has been interrupted.
-
close
public final void close() throws IOExceptionCloses the ZIP output stream as well as the stream being filtered.
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classFilterOutputStream- Throws:
ZipException- if a ZIP file error has occurred.IOException- if an I/O error has occurred.
-
-