public class LZMACompressor extends Object implements com.google.gwt.core.client.Scheduler.RepeatingCommand
| Modifier and Type | Field and Description |
|---|---|
static CompressionMode |
DEFAULT_COMPRESSION_MODE
The default compression mode (
3). |
| Constructor and Description |
|---|
LZMACompressor(InputStream input,
OutputStream output)
Construct an encoder with unknown input length and using the
default compression mode. |
LZMACompressor(InputStream input,
OutputStream output,
long length)
Construct an encoder with unknown using the
default compression mode. |
LZMACompressor(InputStream input,
OutputStream output,
long length,
CompressionMode mode)
Primary constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
execute()
Process the next chunk of data.
|
IOException |
getException()
Get the exception thrown during the previous execution round, if any.
|
double |
getProgress()
Determine how much of the input data has been compressed so far.
|
public static final CompressionMode DEFAULT_COMPRESSION_MODE
3).public LZMACompressor(InputStream input, OutputStream output) throws IOException
default compression mode.
This is a convenience constructor, equivalent to:
LZMACompressor(input, output, -1, DEFAULT_COMPRESSION_MODE)
IOExceptionpublic LZMACompressor(InputStream input, OutputStream output, long length) throws IOException
default compression mode.
This is a convenience constructor, equivalent to:
LZMACompressor(input, output, length, DEFAULT_COMPRESSION_MODE)
IOExceptionpublic LZMACompressor(InputStream input, OutputStream output, long length, CompressionMode mode) throws IOException
The given length limits how much data will be read from the input and
will be encoded at the beginning of the compressed output. This allows decompressors
to determine the uncompressed length without having to decompress the entire content,
and causes the decompressor to stop decompressing at that point. If the length is not
known, -1 should be used.
The input and output streams will not be closed when the operation completes.
input - uncompressed inputoutput - compressed outputlength - length of the input data if known, otherwise -1mode - compression modeIllegalArgumentException - if length is less than -1IllegalArgumentException - if mode is nullIOException - if input or output doespublic boolean execute()
IOException is thrown during processing,
this returns false and getException() will return the caught exception.execute in interface com.google.gwt.core.client.Scheduler.RepeatingCommandtrue if there is more work to do, otherwise falseIllegalStateException - if this compression operation has already completedpublic double getProgress()
-1 was given to the constructor, then this always returns zero.public IOException getException()
null if none was ever thrownCopyright © 2015. All rights reserved.