org.marre.util
Class IOUtil

java.lang.Object
  extended byorg.marre.util.IOUtil

public final class IOUtil
extends java.lang.Object

Contains various utiity functions related to io operations.

Version:
$Id: IOUtil.java,v 1.1 2005/04/07 19:58:36 c95men Exp $
Author:
Markus

Method Summary
static int copy(java.io.InputStream in, java.io.OutputStream out)
          Copy data from in to out using a default temporary buffer.
static int copy(java.io.InputStream in, java.io.OutputStream out, byte[] workbuff)
          Copy data from in to out using the workbuff as temporary storage.
static int copy(java.io.InputStream in, java.io.OutputStream out, int workbuffsize)
          Copy data from in to out using a temporary buffer of workbuffsize bytes.
 
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 in,
                       java.io.OutputStream out,
                       byte[] workbuff)
                throws java.io.IOException
Copy data from in to out using the workbuff as temporary storage.

Parameters:
in - stream to read from
out - stream to write to
workbuff - buffer to use as temporary storage while copying
Returns:
number of bytes copied
Throws:
java.io.IOException - if an I/O error occurs

copy

public static int copy(java.io.InputStream in,
                       java.io.OutputStream out,
                       int workbuffsize)
                throws java.io.IOException
Copy data from in to out using a temporary buffer of workbuffsize bytes.

Parameters:
in - stream to read from
out - stream to write to
workbuffsize - how large the work buffer should be
Returns:
number of bytes copied
Throws:
java.io.IOException - if an I/O error occurs

copy

public static int copy(java.io.InputStream in,
                       java.io.OutputStream out)
                throws java.io.IOException
Copy data from in to out using a default temporary buffer.

Parameters:
in - stream to read from
out - stream to write to
Returns:
number of bytes copied
Throws:
java.io.IOException - if an I/O error occurs


Copyright © 2002-2005 Markus Eriksson. All Rights Reserved.