static ThreadGroup LZ_COMP_TG = new ThreadGroup("LZMACompress");
public LZMAOutputStream(OutputStream out, LzmaProfile compressionProfile) throws IOException {
compressedOutput = new CountingOutputStream(out);
closed = false;
uncompressedDigest = new byte[0];
// The LZMA Encoder requires an input stream and thus does not make a good
// filter. We need to create a pipe and and use an auxiliary thread to compress
// the data.
inputPipe = new PipedInputStream();
uncompressedSize = new CountingOutputStream(new PipedOutputStream((PipedInputStream) inputPipe));
try {
outputPipe = new DigestOutputStream(uncompressedSize, MessageDigest.getInstance("SHA1"));
} catch (NoSuchAlgorithmException e) {
throw new IOException("Could not create LZMAOutputStream", e);
}