Skip to content

Commit ae1631d

Browse files
authored
Fix #4522 - override write method in LoggingStream (#4531)
* Fix #4522 - override write method in LoggingStream Signed-off-by: tvallin <[email protected]>
1 parent 3ff9de8 commit ae1631d

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

core-common/src/main/java/org/glassfish/jersey/logging/LoggingInterceptor.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2019 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2020 Oracle and/or its affiliates. All rights reserved.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -285,6 +285,17 @@ public void write(final int i) throws IOException {
285285
}
286286
out.write(i);
287287
}
288+
289+
@Override
290+
public void write(byte[] ba, int off, int len) throws IOException {
291+
if ((off | len | ba.length - (len + off) | off + len) < 0) {
292+
throw new IndexOutOfBoundsException();
293+
}
294+
if ((baos.size() + len) <= maxEntitySize) {
295+
baos.write(ba, off, len);
296+
}
297+
out.write(ba, off, len);
298+
}
288299
}
289300

290301
}

0 commit comments

Comments
 (0)