se.kmr.scam.client.http.util
Class IOUtil

java.lang.Object
  extended byse.kmr.scam.client.http.util.IOUtil

public class IOUtil
extends Object

IO utillities

Version:
$Revision: 1.4 $
Author:
Jöran
Created:
den 14 december 2002

Constructor Summary
IOUtil()
           
 
Method Summary
static long streamCopy(InputStream source, OutputStream sink)
          Binary copies bytes from an input stream to an output stream.
 
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

streamCopy

public static long streamCopy(InputStream source,
                              OutputStream sink)
                       throws IOException
Binary copies bytes from an input stream to an output stream. The process is buffered, so you shouldn't need BufferedInput/OutputStreams. Flushes when it's finished, but does not close either stream. Returns the number of bytes copied.

Parameters:
source - the input stream
sink - the output stream
Returns:
number of bytes copied
Throws:
IOException - thrown in case of exception reading from or writing to stream


Copyright © 2003 SCAM. All Rights Reserved.