lz4 / lz4-java

LZ4 compression for Java
Apache License 2.0
1.11k stars 252 forks source link

Issue #53 -Fixed calling flush on closed LZ4BlockOutputStream #54

Closed wdroste closed 9 years ago

jpountz commented 9 years ago

I just checked javadocs for the OutputStream class, and the documentation of the close method states that "A closed stream cannot perform output operations and cannot be reopened.". So I believe calling flush on a closed output stream is considered illegal?

https://docs.oracle.com/javase/7/docs/api/java/io/OutputStream.html#close()

wdroste commented 9 years ago

You are absolutely correct and that's why I stated in the bug, that it was protective measure against other libraries that were auto closing streams.. The code was already protecting so I just finished it..

Regards, Will

On Wed, Nov 19, 2014 at 4:24 PM, Adrien Grand notifications@github.com wrote:

I just checked javadocs for the OutputStream class, and the documentation of the close method states that "A closed stream cannot perform output operations and cannot be reopened.". So I believe calling flush on a closed output stream is considered illegal?

https://docs.oracle.com/javase/7/docs/api/java/io/OutputStream.html#close()

— Reply to this email directly or view it on GitHub https://github.com/jpountz/lz4-java/pull/54#issuecomment-63725732.

jpountz commented 9 years ago

I just merged your commit minus the added dependency. Thanks!