can't use decoder after stream has been exhausted
public class Deflate64CompressorInputStream extends CompressorInputStream implements InputStreamStatistics {
private InputStream originalStream;
private HuffmanDecoder decoder;
+ private long compressedBytesRead;
private final byte[] oneByte = new byte[1];
/**
@@ -78,6 +79,7 @@ public int read(byte[] b, int off, int len) throws IOException {
int read = -1;
if (decoder != null) {
read = decoder.decode(b, off, len);
+ compressedBytesRead = decoder.getBytesRead();
count(read);
if (read == -1) {
closeDecoder();
@@ -105,7 +107,7 @@ public void close() throws IOException {
*/
@Override
public long getCompressedCount() {
- return decoder.getBytesRead();
+ return compressedBytesRead;
}
/**
