Return-Path: Delivered-To: apmail-incubator-cxf-commits-archive@locus.apache.org Received: (qmail 5919 invoked from network); 27 Mar 2008 02:24:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Mar 2008 02:24:27 -0000 Received: (qmail 71502 invoked by uid 500); 27 Mar 2008 02:24:27 -0000 Delivered-To: apmail-incubator-cxf-commits-archive@incubator.apache.org Received: (qmail 71369 invoked by uid 500); 27 Mar 2008 02:24:26 -0000 Mailing-List: contact cxf-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cxf-dev@incubator.apache.org Delivered-To: mailing list cxf-commits@incubator.apache.org Received: (qmail 71360 invoked by uid 99); 27 Mar 2008 02:24:26 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Mar 2008 19:24:26 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Mar 2008 02:23:44 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id AA5771A9832; Wed, 26 Mar 2008 19:24:03 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r641690 - /incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/IOUtils.java Date: Thu, 27 Mar 2008 02:24:03 -0000 To: cxf-commits@incubator.apache.org From: gmazza@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080327022403.AA5771A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: gmazza Date: Wed Mar 26 19:24:01 2008 New Revision: 641690 URL: http://svn.apache.org/viewvc?rev=641690&view=rev Log: Fixed checkstyle errors. Modified: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/IOUtils.java Modified: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/IOUtils.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/IOUtils.java?rev=641690&r1=641689&r2=641690&view=diff ============================================================================== --- incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/IOUtils.java (original) +++ incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/IOUtils.java Wed Mar 26 19:24:01 2008 @@ -30,38 +30,36 @@ public final class IOUtils { private static final int DEFAULT_BUFFER_SIZE = 1024 * 4; - + private IOUtils() { - + } - + public static int copy(final InputStream input, final OutputStream output) - throws IOException { + throws IOException { return copy(input, output, DEFAULT_BUFFER_SIZE); } - public static int copyAndCloseInput(final InputStream input, final OutputStream output) - throws IOException { + public static int copyAndCloseInput(final InputStream input, + final OutputStream output) throws IOException { try { return copy(input, output, DEFAULT_BUFFER_SIZE); } finally { input.close(); } } + public static int copyAndCloseInput(final InputStream input, - final OutputStream output, - int bufferSize) - throws IOException { + final OutputStream output, int bufferSize) throws IOException { try { return copy(input, output, bufferSize); } finally { input.close(); } } - public static int copy(final InputStream input, - final OutputStream output, - int bufferSize) - throws IOException { + + public static int copy(final InputStream input, final OutputStream output, + int bufferSize) throws IOException { int avail = input.available(); if (avail > 262144) { avail = 262144; @@ -80,10 +78,9 @@ } return total; } - public static void copy(final Reader input, - final Writer output, - final int bufferSize) - throws IOException { + + public static void copy(final Reader input, final Writer output, + final int bufferSize) throws IOException { final char[] buffer = new char[bufferSize]; int n = 0; n = input.read(buffer); @@ -93,14 +90,12 @@ } } - - public static String toString(final InputStream input) - throws IOException { + public static String toString(final InputStream input) throws IOException { return toString(input, DEFAULT_BUFFER_SIZE); } - - public static String toString(final InputStream input, int bufferSize) - throws IOException { + + public static String toString(final InputStream input, int bufferSize) + throws IOException { int avail = input.available(); if (avail > bufferSize) { @@ -118,10 +113,9 @@ input.close(); return buf.toString(); } - - public static String toString(final Reader input) - throws IOException { - + + public static String toString(final Reader input) throws IOException { + StringBuilder buf = new StringBuilder(); final char[] buffer = new char[DEFAULT_BUFFER_SIZE]; int n = 0; @@ -133,28 +127,31 @@ input.close(); return buf.toString(); } - - public static String readStringFromStream(InputStream in) throws IOException { + + public static String readStringFromStream(InputStream in) + throws IOException { StringBuilder sb = new StringBuilder(1024); for (int i = in.read(); i != -1; i = in.read()) { - sb.append((char)i); + sb.append((char) i); } in.close(); return sb.toString(); } - + /** - * Load the InputStream into memory and return a ByteArrayInputStream that - * represents it. Closes the in stream. + * Load the InputStream into memory and return a ByteArrayInputStream that + * represents it. Closes the in stream. + * * @param in * @return * @throws IOException */ - public static ByteArrayInputStream loadIntoBAIS(InputStream in) throws IOException { + public static ByteArrayInputStream loadIntoBAIS(InputStream in) + throws IOException { int i = in.available(); if (i < DEFAULT_BUFFER_SIZE) { i = DEFAULT_BUFFER_SIZE;