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 void
close()
Closes the ZIP output stream as well as the stream being filtered.void
write(byte[] data, int offset, int length)
Writes an array of bytes to the current ZIP entry data.void
write(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 IOException
Writes a byte to the compressed output stream. This method will block until the byte can be written.
- Overrides:
write
in classFilterOutputStream
- Parameters:
b
- thebyte
to be written.- Throws:
IOException
- if an I/O error has occurred.
-
write
public final void write(@NotNull byte[] data, int offset, int length) throws IOException
Writes an array of bytes to the current ZIP entry data. This method will block until all the bytes are written.
- Overrides:
write
in 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 IOException
Closes the ZIP output stream as well as the stream being filtered.
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classFilterOutputStream
- Throws:
ZipException
- if a ZIP file error has occurred.IOException
- if an I/O error has occurred.
-
-