Skip to content

Commit

Permalink
Fix #4522 - override write method in LoggingStream (#4531)
Browse files Browse the repository at this point in the history
* Fix #4522 - override write method in LoggingStream

Signed-off-by: tvallin <[email protected]>
  • Loading branch information
tvallin committed Jul 27, 2020
1 parent 3ff9de8 commit ae1631d
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2019 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -285,6 +285,17 @@ public void write(final int i) throws IOException {
}
out.write(i);
}

@Override
public void write(byte[] ba, int off, int len) throws IOException {
if ((off | len | ba.length - (len + off) | off + len) < 0) {
throw new IndexOutOfBoundsException();
}
if ((baos.size() + len) <= maxEntitySize) {
baos.write(ba, off, len);
}
out.write(ba, off, len);
}
}

}

1 comment on commit ae1631d

@mkarg
Copy link
Member

@mkarg mkarg commented on ae1631d Jul 31, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tvallin 👍 Thanks for this performance improvement!

Please sign in to comment.