StreamCompressor

abstract class StreamCompressor : Closeable

Encapsulates a Deflater and crc calculator, handling multiple types of output streams. Currently DEFLATED and STORED are the only supported compression methods.

Since

1.10

Functions

Link copied to clipboard
open fun close()
Link copied to clipboard
Create a stream compressor with the default compression level.
open fun create(compressionLevel: Int, bs: ScatterGatherBackingStore): StreamCompressor
Create a stream compressor with the given compression level.
Link copied to clipboard
open fun deflate(source: InputStream, method: Int)
Deflate the given source using the supplied compression method
Link copied to clipboard
open fun getBytesRead(): Long
Return the number of bytes read from the source stream
Link copied to clipboard
The number of bytes written to the output for the last entry
Link copied to clipboard
open fun getCrc32(): Long
The crc32 of the last deflated file
Link copied to clipboard
The total number of bytes written to the output for all files
Link copied to clipboard
open fun writeCounted(data: Array<Byte>)
open fun writeCounted(data: Array<Byte>, offset: Int, length: Int)