SnappyOutputStream.close() throws an exception if already closed
Closed this issue · 1 comments
jn1 commented
The close() method calls flush() before checking whether the stream is already closed. If the stream is closed, flush() fails with an exception. I suggest enclosing the entire method in the "if (!closed)" check as follows:
@Override
public void close()
throws IOException
{
if (!closed) {
try {
flush();
out.close();
}
finally {
closed = true;
recycler.releaseOutputBuffer(outputBuffer);
recycler.releaseEncodeBuffer(buffer);
}
}
}
electrum commented
Fixed. Thanks for finding this bug!