net.sourceforge.mflow.util
Class IOUtil

java.lang.Object
  extended bynet.sourceforge.mflow.util.IOUtil

public class IOUtil
extends java.lang.Object

Author:
carrd

Constructor Summary
IOUtil()
           
 
Method Summary
static void closeReader(java.io.Reader r)
          Closes the specified reader, ignoring any exceptions thrown
static void closeStream(java.io.InputStream is)
          Closes the specified stream, ignoring any exceptions thrown
static void closeStream(java.io.OutputStream os)
          Closes the specified stream, ignoring any exceptions thrown
static byte[] readStreamToByteArray(java.io.InputStream input)
          Read all of the data from a stream, returning the contents as a byte array.
static java.lang.String readStreamToString(java.io.InputStream input)
          Read all of the data from a stream, returning the contents as a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IOUtil

public IOUtil()
Method Detail

closeStream

public static void closeStream(java.io.InputStream is)
Closes the specified stream, ignoring any exceptions thrown

Parameters:
is - the stream to close

closeStream

public static void closeStream(java.io.OutputStream os)
Closes the specified stream, ignoring any exceptions thrown

Parameters:
os - the stream to close

closeReader

public static void closeReader(java.io.Reader r)
Closes the specified reader, ignoring any exceptions thrown

Parameters:
r - the reader to close

readStreamToString

public static final java.lang.String readStreamToString(java.io.InputStream input)
                                                 throws java.io.IOException
Read all of the data from a stream, returning the contents as a String. Note that this method is not unicode-aware.

Parameters:
input - The stream to read from.
Returns:
The contents of the stream, as a String.
Throws:
java.io.IOException - If an error occurred while reading from the stream.

readStreamToByteArray

public static final byte[] readStreamToByteArray(java.io.InputStream input)
                                          throws java.io.IOException
Read all of the data from a stream, returning the contents as a byte array.

Parameters:
input - The stream to read from.
Returns:
The contents of the stream, as a byte array.
Throws:
java.io.IOException - If an error occurred while reading from the stream.


Copyright © 2002-2004 MFlow Group. All Rights Reserved.