org.homeunix.thecave.moss.util
Class StreamFunctions

java.lang.Object
  extended by org.homeunix.thecave.moss.util.StreamFunctions

public class StreamFunctions
extends java.lang.Object

Provides some convenience methods for copying between streams.

Author:
wyatt

Constructor Summary
StreamFunctions()
           
 
Method Summary
static void copyInputStreamToOutputStream(java.io.InputStream is, java.io.OutputStream os)
          Copy the contents of the given input stream to the given output stream.
static byte[] getBytes(java.io.InputStream is)
          Returns a byte array of the contents of the given input stream.
static java.lang.String getString(java.io.InputStream is)
          Returns a string representation of the bytes in the given input stream, in UTF8 encoding.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamFunctions

public StreamFunctions()
Method Detail

copyInputStreamToOutputStream

public static void copyInputStreamToOutputStream(java.io.InputStream is,
                                                 java.io.OutputStream os)
                                          throws java.io.IOException
Copy the contents of the given input stream to the given output stream.

Parameters:
is -
os -
Throws:
java.io.IOException

getString

public static java.lang.String getString(java.io.InputStream is)
                                  throws java.io.IOException
Returns a string representation of the bytes in the given input stream, in UTF8 encoding.

Parameters:
is -
Returns:
Throws:
java.io.IOException

getBytes

public static byte[] getBytes(java.io.InputStream is)
                       throws java.io.IOException
Returns a byte array of the contents of the given input stream.

Parameters:
is -
Returns:
Throws:
java.io.IOException