//
// Filter chain:
// user stream -> CountingInputStream(uncompressedSize) -> DigestInputStream ->
// Encoder -> PipedOutputStream -> PipedInputStream ->
// CountingInputStream(compressedSize)
uncompressedSize = new CountingInputStream(in);
try {
uncompressedDigest = new DigestInputStream(uncompressedSize,
MessageDigest.getInstance("SHA1"));
} catch (NoSuchAlgorithmException e) {
throw new IOException("Could not create LZMACompessionFilter", e);
}
inputPipe = new PipedInputStream();
outputPipe = new PipedOutputStream(inputPipe);
compressedSize = new CountingInputStream(inputPipe);
lzma = new Encoder();
lzma.SetDictionarySize(compressionProfile.dictionarySize);
lzma.SetNumFastBytes(compressionProfile.fastBytes);
lzma.SetMatchFinder(compressionProfile.matchFinder);
lzma.SetLcLpPb(compressionProfile.lc, compressionProfile.lp, compressionProfile.pb);