Skip to content

Commit

Permalink
Merge branch '2.10'
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Jan 15, 2019
2 parents 2ad2a88 + 54ef645 commit 00c3d1d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,8 @@ public void close() throws IOException
if (_handleFirstLine) {
_handleFirstLine();
}
_writer.close(_ioContext.isResourceManaged() || isEnabled(StreamWriteFeature.AUTO_CLOSE_TARGET));
_writer.close(_ioContext.isResourceManaged() || isEnabled(StreamWriteFeature.AUTO_CLOSE_TARGET),
isEnabled(StreamWriteFeature.FLUSH_PASSED_TO_STREAM));
}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -872,12 +872,12 @@ public void flush(boolean flushStream) throws IOException
}
}

public void close(boolean autoClose) throws IOException
public void close(boolean autoClose, boolean flushStream) throws IOException
{
_flushBuffer();
if (autoClose) {
_out.close();
} else {
} else if (flushStream) {
// If we can't close it, we should at least flush
_out.flush();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,9 @@ private final void _writeFieldName(String name)
@Override
public final void flush() throws IOException
{
_writer.flush();
if (isEnabled(StreamWriteFeature.FLUSH_PASSED_TO_STREAM)) {
_writer.flush();
}
}

@Override
Expand All @@ -436,7 +438,7 @@ public void close() throws IOException
if (_writer != null) {
if (_ioContext.isResourceManaged() || isEnabled(StreamWriteFeature.AUTO_CLOSE_TARGET)) {
_writer.close();
} else if (isEnabled(StreamWriteFeature.FLUSH_PASSED_TO_STREAM)) {
} else if (isEnabled(StreamWriteFeature.FLUSH_PASSED_TO_STREAM)) {
// If we can't close it, we should at least flush
_writer.flush();
}
Expand Down

0 comments on commit 00c3d1d

Please sign in to comment.