org.nakedobjects.metamodel.commons.lang
Class IoUtils

java.lang.Object
  extended by org.nakedobjects.metamodel.commons.lang.IoUtils

public final class IoUtils
extends java.lang.Object


Method Summary
static void closeSafely(java.io.BufferedReader reader)
           
static void closeSafely(java.io.InputStream in)
           
static int copy(java.io.InputStream input, java.io.OutputStream output)
          Copy bytes from an InputStream to an OutputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

copy

public static int copy(java.io.InputStream input,
                       java.io.OutputStream output)
                throws java.io.IOException
Copy bytes from an InputStream to an OutputStream.

This method buffers the input internally, so there is no need to use a BufferedInputStream.

Parameters:
input - the InputStream to read from
output - the OutputStream to write to
Returns:
the number of bytes copied
Throws:
java.lang.IllegalArgumentException - if the input or output is null
java.io.IOException - if an I/O error occurs
Since:
Commons IO 1.1

closeSafely

public static void closeSafely(java.io.InputStream in)

closeSafely

public static void closeSafely(java.io.BufferedReader reader)


Copyright © 2001-2009 Naked Objects Group Ltd.. All Rights Reserved.