Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import com.mongodb.MongoCompressor;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.zip.Deflater;
Expand Down Expand Up @@ -48,6 +49,15 @@ InputStream getInputStream(final InputStream source) {

@Override
OutputStream getOutputStream(final OutputStream source) {
return new DeflaterOutputStream(source, new Deflater(level));
return new DeflaterOutputStream(source, new Deflater(level)) {
@Override
public void close() throws IOException {
try {
super.close();
} finally {
def.end();
}
}
};
}
}