Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id EA767200C28 for ; Mon, 13 Mar 2017 11:53:11 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id E91D3160B6C; Mon, 13 Mar 2017 10:53:11 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 3FE96160B60 for ; Mon, 13 Mar 2017 11:53:11 +0100 (CET) Received: (qmail 24300 invoked by uid 500); 13 Mar 2017 10:53:10 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 24291 invoked by uid 99); 13 Mar 2017 10:53:10 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Mar 2017 10:53:10 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 5E511DFE7B; Mon, 13 Mar 2017 10:53:10 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: coheigea@apache.org To: commits@cxf.apache.org Message-Id: <57299050819449ea943372c67f619eb0@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: cxf git commit: CXF-7280 - Append to the stringbuffer directly from the char array instead of using intermediate String Date: Mon, 13 Mar 2017 10:53:10 +0000 (UTC) archived-at: Mon, 13 Mar 2017 10:53:12 -0000 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 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 Authored: Sun Mar 12 12:21:21 2017 +0000 Committer: Colm O hEigeartaigh 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();