Author: dkulp
Date: Thu Mar 27 12:05:32 2008
New Revision: 641949
URL: http://svn.apache.org/viewvc?rev=641949&view=rev
Log:
Merged revisions 641690 via svnmerge from
https://svn.apache.org/repos/asf/incubator/cxf/trunk
........
r641690 | gmazza | 2008-03-26 22:24:01 -0400 (Wed, 26 Mar 2008) | 1 line
Fixed checkstyle errors.
........
Modified:
incubator/cxf/branches/2.0.x-fixes/ (props changed)
incubator/cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/helpers/IOUtils.java
Propchange: incubator/cxf/branches/2.0.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified:
incubator/cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/helpers/IOUtils.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/helpers/IOUtils.java?rev=641949&r1=641948&r2=641949&view=diff
==============================================================================
---
incubator/cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/helpers/IOUtils.java
(original)
+++
incubator/cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/helpers/IOUtils.java
Thu Mar 27 12:05:32 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;