public class NewLZMACompressor
extends java.lang.Object
Compressor.COMPRESSOR_TYPE
DEFAULT_COMPRESSORDESCRIPTOR
Constructor and Description |
---|
NewLZMACompressor() |
Modifier and Type | Method and Description |
---|---|
Bucket |
compress(Bucket data,
BucketFactory bf,
long maxReadLength,
long maxWriteLength)
Compress the data.
|
long |
compress(java.io.InputStream input,
java.io.OutputStream output,
long maxReadLength,
long maxWriteLength)
Compress the data.
|
long |
compress(java.io.InputStream is,
java.io.OutputStream os,
long maxReadLength,
long maxWriteLength,
long amountOfDataToCheckCompressionRatio,
int minimumCompressionPercentage)
Compress the data (@see
Compressor.compress(InputStream, OutputStream, long, long) ) with checking of compression effect. |
Bucket |
decompress(Bucket data,
BucketFactory bf,
long maxLength,
long maxCheckSizeLength,
Bucket preferred) |
int |
decompress(byte[] dbuf,
int i,
int j,
byte[] output)
Decompress in RAM only.
|
long |
decompress(java.io.InputStream is,
java.io.OutputStream os,
long maxLength,
long maxCheckSizeBytes)
Decompress data.
|
public Bucket compress(Bucket data, BucketFactory bf, long maxReadLength, long maxWriteLength) throws java.io.IOException, CompressionOutputSizeException
Compressor
data
- The bucket to read from.bf
- The means to create a new bucket.maxReadLength
- The maximum number of bytes to read from the input bucket.maxWriteLength
- The maximum number of bytes to write to the output bucket. If this is exceeded, throw a CompressionOutputSizeException.java.io.IOException
- If an error occurs reading or writing data.CompressionOutputSizeException
- If the compressed data is larger than maxWriteLength.public long compress(java.io.InputStream is, java.io.OutputStream os, long maxReadLength, long maxWriteLength, long amountOfDataToCheckCompressionRatio, int minimumCompressionPercentage) throws java.io.IOException, CompressionRatioException
Compressor
Compressor.compress(InputStream, OutputStream, long, long)
) with checking of compression effect.amountOfDataToCheckCompressionRatio
- The data amount after compression of which we will check whether we have got the desired effect.minimumCompressionPercentage
- The minimal desired compression effect, %. A value of 0 means that the
compression effect will not be checked.CompressionRatioException
- If the desired compression effect is not achieved.java.io.IOException
public Bucket decompress(Bucket data, BucketFactory bf, long maxLength, long maxCheckSizeLength, Bucket preferred) throws java.io.IOException, CompressionOutputSizeException
java.io.IOException
CompressionOutputSizeException
public long decompress(java.io.InputStream is, java.io.OutputStream os, long maxLength, long maxCheckSizeBytes) throws java.io.IOException, CompressionOutputSizeException
Compressor
is
- Where to read the data to decompress fromos
- Where to write the final product tomaxLength
- The maximum length to decompress (we throw if more is present).maxCheckSizeBytes
- If the data is too big, and this is >0, read up to this many bytes in order to try to get the data size.java.io.IOException
CompressionOutputSizeException
public int decompress(byte[] dbuf, int i, int j, byte[] output) throws CompressionOutputSizeException
Compressor
dbuf
- Input buffer.i
- Offset to start reading from.j
- Number of bytes to read.output
- Output buffer.CompressionOutputSizeException
public long compress(java.io.InputStream input, java.io.OutputStream output, long maxReadLength, long maxWriteLength) throws java.io.IOException
Compressor
compress
in interface Compressor
input
- The InputStream to read from.output
- The OutputStream to write to.maxReadLength
- The maximum number of bytes to read from the input bucket.maxWriteLength
- The maximum number of bytes to write to the output bucket. If this is exceeded, throw a CompressionOutputSizeException.java.io.IOException
- If an error occurs reading or writing data.CompressionOutputSizeException
- If the compressed data is larger than maxWriteLength.