Visitar URL original
Issue #53 -Fixed calling flush on closed LZ4BlockOutputStream · lihuibng/lz4-java@4ebcf34 · GitHub
Skip to content

Commit 4ebcf34

Browse files
Will Drostejpountz
authored andcommitted
Issue lz4#53 -Fixed calling flush on closed LZ4BlockOutputStream
1 parent 04bb2f4 commit 4ebcf34

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

‎.gitignore‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ dist
33
bin
44
lib
55
!src/build
6+
.idea
7+
out
8+
*/*.iml

‎src/java/net/jpountz/lz4/LZ4BlockOutputStream.java‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,12 @@ private void flushBufferedData() throws IOException {
218218
*/
219219
@Override
220220
public void flush() throws IOException {
221-
if (syncFlush) {
222-
flushBufferedData();
221+
if (out != null) {
222+
if (syncFlush) {
223+
flushBufferedData();
224+
}
225+
out.flush();
223226
}
224-
out.flush();
225227
}
226228

227229
/**

0 commit comments

Comments
 (0)