public class BufferedOutputStream extends OutputStream
ZipFileHeader
with the encoded size and checksums and not have to use the ZipDataDescriptor
which is
written after the data.Constructor and Description |
---|
BufferedOutputStream(OutputStream outputStream) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
enableBuffer(long maxSizeBuffered,
int maxSizeInMemory)
Set our buffer limits.
|
ZipFileHeader |
finishFileData(long crc32,
long uncompressedSize)
We are done with the writing of the file data so dump everything if the buffer hasn't given up.
|
void |
flush() |
long |
getEncodedSize()
Encoded bytes either buffered or written of the latest file written by
finishFileData(long, long) .. |
File |
getTmpFile()
Exposed for testing purposes.
|
long |
getWriteCount()
Number of byte written to the output-stream.
|
void |
setFileHeader(ZipFileHeader fileHeader)
This saves the file-header and effectively turns on the memory buffer.
|
void |
write(byte[] buffer,
int offset,
int length) |
void |
write(int b) |
write
public BufferedOutputStream(OutputStream outputStream)
public void enableBuffer(long maxSizeBuffered, int maxSizeInMemory)
public void write(int b) throws IOException
write
in class OutputStream
IOException
public void write(byte[] buffer, int offset, int length) throws IOException
write
in class OutputStream
IOException
public ZipFileHeader finishFileData(long crc32, long uncompressedSize) throws IOException
IOException
public long getWriteCount()
public void flush() throws IOException
flush
in interface Flushable
flush
in class OutputStream
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class OutputStream
IOException
public File getTmpFile()
public long getEncodedSize()
finishFileData(long, long)
..public void setFileHeader(ZipFileHeader fileHeader)
This documentation content is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.