com.ibm.wsdl.util.IOUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of org.apache.cxf Show documentation
Show all versions of org.apache.cxf Show documentation
Apache CXF is an open-source services framework that aids in
the development of services using front-end programming APIs, like JAX-WS
and JAX-RS.
/*
* (c) Copyright IBM Corp 2001, 2005
*/
package com.ibm.wsdl.util;
import java.io.*;
/**
* This file is a collection of input/output utilities.
*
* @author Sanjiva Weerawarana
* @author Matthew J. Duftler
*/
public class IOUtils {
// debug flag - generates debug stuff if true
static boolean debug = false;
//////////////////////////////////////////////////////////////////////////
public static String getStringFromReader (Reader reader) throws IOException {
BufferedReader bufIn = new BufferedReader(reader);
StringWriter swOut = new StringWriter();
PrintWriter pwOut = new PrintWriter(swOut);
String tempLine;
while ((tempLine = bufIn.readLine()) != null) {
pwOut.println(tempLine);
}
pwOut.flush();
return swOut.toString();
}
}