Class 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 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 input is reached

        The input and output streams will not be closed when the operation completes.

        Parameters:
        input - compressed input
        output - uncompressed output
        Throws:
        IOException - if input or output causes an exception
        IOException - if the compressed data is truncated or corrupted
    • Method Detail

      • execute

        public boolean execute()
        Process the next chunk of data. If an IOException is thrown during processing, this returns false and getException() will return the caught exception.
        Specified by:
        execute in interface com.google.gwt.core.client.Scheduler.RepeatingCommand
        Returns:
        true if there is more work to do, otherwise false
        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 -1 was 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 null if none was ever thrown