public class DecompressorThreadManager
extends java.lang.Object
Constructor and Description |
---|
DecompressorThreadManager(java.io.PipedInputStream inputStream,
java.util.List<? extends Compressor> decompressors,
long maxLen)
Creates a new DecompressorThreadManager
|
Modifier and Type | Method and Description |
---|---|
java.io.PipedInputStream |
execute()
Creates and executes a new thread for each decompressor,
chaining the output of the previous to the next.
|
java.lang.Throwable |
getError()
Returns an exception which was thrown during decompression
|
void |
onFailure(java.lang.Throwable t)
Informs the manager that a nonrecoverable exception has occured in the
decompression threads
|
void |
onFinish()
Marks that the decompression of the stream has finished and wakes
threads blocking on completion
|
void |
waitFinished()
Blocks until all threads have finished executing and cleaning up.
|
public DecompressorThreadManager(java.io.PipedInputStream inputStream, java.util.List<? extends Compressor> decompressors, long maxLen) throws java.io.IOException
inputStream
- The stream that will be decompressed, if compressedmaxLen
- The maximum number of bytes to extractjava.io.IOException
public java.io.PipedInputStream execute() throws java.lang.Throwable
java.lang.Throwable
public void onFailure(java.lang.Throwable t)
e
- The thrown exceptionpublic void onFinish()
public void waitFinished() throws java.lang.Throwable
java.lang.Throwable
public java.lang.Throwable getError()