Package org.dellroad.lzma.client
Class LZMADecompressor
- java.lang.Object
-
- org.dellroad.lzma.client.LZMADecompressor
-
- All Implemented Interfaces:
com.google.gwt.core.client.Scheduler.RepeatingCommand
- Direct Known Subclasses:
LZMAByteArrayDecompressor
public class LZMADecompressor extends Object implements com.google.gwt.core.client.Scheduler.RepeatingCommand
LZMA decompressor.
-
-
Constructor Summary
Constructors Constructor Description LZMADecompressor(InputStream input, OutputStream output)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanexecute()Process the next chunk of data.IOExceptiongetException()Get the exception thrown during the previous execution round, if any.doublegetProgress()Determine how much of the output data has been generated so far.
-
-
-
Constructor Detail
-
LZMADecompressor
public LZMADecompressor(InputStream input, OutputStream output) throws IOException
Constructor.Decompression will stop when one of the following is true:
- An "end of file" marker is read from the compressed data
- The decompressed output reaches the length encoded in the compressed data
- The end of
inputis reached
The input and output streams will not be closed when the operation completes.
- Parameters:
input- compressed inputoutput- uncompressed output- Throws:
IOException- ifinputoroutputcauses an exceptionIOException- if the compressed data is truncated or corrupted
-
-
Method Detail
-
execute
public boolean execute()
Process the next chunk of data. If anIOExceptionis thrown during processing, this returnsfalseandgetException()will return the caught exception.- Specified by:
executein interfacecom.google.gwt.core.client.Scheduler.RepeatingCommand- Returns:
trueif there is more work to do, otherwisefalse- Throws:
IllegalStateException- if this compression operation has already completed
-
getProgress
public double getProgress()
Determine how much of the output data has been generated so far. If a length of-1was encoded in the compressed data, then this always returns zero.- Returns:
- a value from 0.0 to 1.0
-
getException
public IOException getException()
Get the exception thrown during the previous execution round, if any. Note: this method must be checked after compression is complete to determine if there was an error.- Returns:
- thrown exception, or
nullif none was ever thrown
-
-