diff --git a/core-common/src/main/java/org/glassfish/jersey/logging/LoggingInterceptor.java b/core-common/src/main/java/org/glassfish/jersey/logging/LoggingInterceptor.java index 5863c7bee5..c90d8b6470 100644 --- a/core-common/src/main/java/org/glassfish/jersey/logging/LoggingInterceptor.java +++ b/core-common/src/main/java/org/glassfish/jersey/logging/LoggingInterceptor.java @@ -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 @@ -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); + } } }