Remove unnecessary flush in KafkaLZ4BlockOutputStream.close()
Remove unnecessary 'flush', the underlying stream should handle it on close.
Author: Will Droste
Reviewers: Ismael Juma
Closes from wdroste/trunk
@@ -258,10 +258,10 @@ public final class KafkaLZ4BlockOutputStream extends FilterOutputStream {
@Override
public void close() throws IOException {
if (!finished) {
+ // basicallly flush the buffer writing the last block
writeBlock();
+ // write the end block and finish the stream
writeEndMark();
- flush();
- finished = true;
}
if (out != null) {
out.close();
