ch.javasoft.io
Class Streams

java.lang.Object
  extended by ch.javasoft.io.Streams

public class Streams
extends Object

Helper class with static methods related to input/output streams


Method Summary
static void transfer(InputStream src, OutputStream dst)
          Reads from src and writes to dst, using a byte buffer of size 1024.
static void transfer(InputStream src, OutputStream dst, byte[] buffer)
          Reads from src and writes to dst, using the given byte buffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

transfer

public static void transfer(InputStream src,
                            OutputStream dst)
                     throws IOException
Reads from src and writes to dst, using a byte buffer of size 1024.

Parameters:
src - source input stream to read from
dst - destination output stream to write to
Throws:
IOException - if reading from the input stream or writing to the output stream throws such an exception

transfer

public static void transfer(InputStream src,
                            OutputStream dst,
                            byte[] buffer)
                     throws IOException
Reads from src and writes to dst, using the given byte buffer.

Parameters:
src - source input stream to read from
dst - destination output stream to write to
buffer - the byte buffer to use for the byte transfer
Throws:
IOException - if reading from the input stream or writing to the output stream throws such an exception