org.apache.fop.tools
Class IOUtil

java.lang.Object
  extended byorg.apache.fop.tools.IOUtil

public class IOUtil
extends java.lang.Object

I/O utilities. This class should be replaced as soon as Jakarta Commons IO announces its first release.


Constructor Summary
IOUtil()
           
 
Method Summary
static void copyStream(java.io.InputStream in, java.io.OutputStream out)
          Copies the contents of the InputStream over to the OutputStream.
static byte[] toByteArray(java.io.InputStream in, int initialTargetBufferSize)
          Loads the contents of the InputStream to a byte array.
 
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

copyStream

public static void copyStream(java.io.InputStream in,
                              java.io.OutputStream out)
                       throws java.io.IOException
Copies the contents of the InputStream over to the OutputStream. This method doesn't close the streams.

Parameters:
in - InputStream to read from
out - OutputStream to write to
Throws:
java.io.IOException - In case of an I/O problem

toByteArray

public static byte[] toByteArray(java.io.InputStream in,
                                 int initialTargetBufferSize)
                          throws java.io.IOException
Loads the contents of the InputStream to a byte array. The InputStream isn't closed.

Parameters:
in - InputStream to read from
initialTargetBufferSize - initial number of bytes to allocate (expected size to avoid a lot of reallocations)
Returns:
byte[] the array of bytes requested
Throws:
java.io.IOException - In case of an I/O problem


Copyright ? 1999-2003 Apache Software Foundation. All Rights Reserved.