Repository: cxf Updated Branches: refs/heads/3.1.x-fixes 4a5c6a68a -> f5b75c7a0
CXF-7280 - Append to the stringbuffer directly from the char array instead of using intermediate String Signed-off-by: Colm O hEigeartaigh <[email protected]> This closes #244. Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/f5b75c7a Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/f5b75c7a Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/f5b75c7a Branch: refs/heads/3.1.x-fixes Commit: f5b75c7a061b04a75c12fda170d5caff89c257e1 Parents: 4a5c6a6 Author: Steven Crockett <[email protected]> Authored: Sun Mar 12 12:21:21 2017 +0000 Committer: Colm O hEigeartaigh <[email protected]> Committed: Mon Mar 13 10:53:04 2017 +0000 ---------------------------------------------------------------------- core/src/main/java/org/apache/cxf/helpers/IOUtils.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/f5b75c7a/core/src/main/java/org/apache/cxf/helpers/IOUtils.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/cxf/helpers/IOUtils.java b/core/src/main/java/org/apache/cxf/helpers/IOUtils.java index 5c4d189..cd18ed7 100644 --- a/core/src/main/java/org/apache/cxf/helpers/IOUtils.java +++ b/core/src/main/java/org/apache/cxf/helpers/IOUtils.java @@ -312,13 +312,12 @@ public final class IOUtils { StringBuilder buf = new StringBuilder(); final char[] buffer = new char[bufSize]; try { - int n = 0; - n = input.read(buffer); + int n = input.read(buffer); while (-1 != n) { if (n == 0) { throw new IOException("0 bytes read in violation of InputStream.read(byte[])"); } - buf.append(new String(buffer, 0, n)); + buf.append(buffer, 0, n); n = input.read(buffer); } return buf.toString();
