Skip to content

Commit

Permalink
add comments to OutputStreamAppender
Browse files Browse the repository at this point in the history
Signed-off-by: Ceki Gulcu <ceki@qos.ch>
  • Loading branch information
ceki committed Sep 21, 2024
1 parent 6d11eff commit 91961ad
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public void stop() {
protected void closeOutputStream() {
if (this.outputStream != null) {
try {
// before closing we have to output out layout's footer
// before closing we have to output out encooder's footer
encoderClose();
this.outputStream.close();
this.outputStream = null;
Expand Down Expand Up @@ -204,6 +204,8 @@ private void writeBytes(byte[] byteArray) throws IOException {
streamWriteLock.lock();

try {
// guard against appender having been stop() in parallel
// note that the encoding step is performed outside the protection of the streamWriteLock
if(isStarted()) {
writeByteArrayToOutputStreamWithPossibleFlush(byteArray);
updateByteCount(byteArray);
Expand Down

0 comments on commit 91961ad

Please sign in to comment.