Author: asoldano
Date: 2014-03-07 05:32:48 -0500 (Fri, 07 Mar 2014)
New Revision: 18472
Modified:
common/trunk/src/main/java/org/jboss/ws/common/IOUtils.java
Log:
[JBWS-3769] Proper deal with carriage returns
Modified: common/trunk/src/main/java/org/jboss/ws/common/IOUtils.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/IOUtils.java 2014-03-07 09:28:24 UTC
(rev 18471)
+++ common/trunk/src/main/java/org/jboss/ws/common/IOUtils.java 2014-03-07 10:32:48 UTC
(rev 18472)
@@ -63,21 +63,9 @@
public static String readAndCloseStream(InputStream is, String charsetName) throws
IOException
{
- final StringBuilder sb = new StringBuilder();
- final BufferedReader br = new BufferedReader(new InputStreamReader(is,
charsetName));
- String line;
- try
- {
- while ((line = br.readLine()) != null)
- {
- sb.append(line);
- }
- }
- finally
- {
- br.close();
- }
- return sb.toString();
+ final ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ copyStream(bos, is);
+ return bos.toString(charsetName);
}
/** Copy the input stream to the output stream
Show replies by date