jxUtil 0.6

org.sourceforge.jxutil.io
Class StreamCopier

java.lang.Object
  |
  +--org.sourceforge.jxutil.io.StreamCopier
All Implemented Interfaces:
Runnable

public final class StreamCopier
extends Object
implements Runnable

Copy a byte stream synchronously or asynchronously to current thread.


Field Summary
private  int bufSize
           
static int defaultBufSize
           
private  IOException ex
           
private  long inputLength
           
private  InputStream is
           
private  OutputStream os
           
private  long transferred
           
 
Constructor Summary
StreamCopier(InputStream is, long inputLength, OutputStream os)
           
StreamCopier(InputStream is, OutputStream os)
           
 
Method Summary
 void check()
           
static void copy(InputStream in, long inputLength, OutputStream out)
           
static void copy(InputStream in, OutputStream out)
           
static void copyThread(InputStream in, long inputLength, OutputStream out)
           
static void copyThread(InputStream in, OutputStream out)
           
 int getBufSize()
           
 long getTransferred()
           
 void run()
           
 void setBufSize(int bufSize)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bufSize

private int bufSize

defaultBufSize

public static int defaultBufSize

ex

private IOException ex

inputLength

private final long inputLength

is

private final InputStream is

os

private final OutputStream os

transferred

private long transferred
Constructor Detail

StreamCopier

public StreamCopier(InputStream is,
                    long inputLength,
                    OutputStream os)

StreamCopier

public StreamCopier(InputStream is,
                    OutputStream os)
Method Detail

check

public final void check()
                 throws IOException
IOException

copy

public static void copy(InputStream in,
                        long inputLength,
                        OutputStream out)
                 throws IOException
IOException

copy

public static void copy(InputStream in,
                        OutputStream out)
                 throws IOException
IOException

copyThread

public static void copyThread(InputStream in,
                              long inputLength,
                              OutputStream out)
                       throws IOException,
                              InterruptedException
IOException
InterruptedException

copyThread

public static void copyThread(InputStream in,
                              OutputStream out)
                       throws IOException,
                              InterruptedException
IOException
InterruptedException

getBufSize

public final int getBufSize()

getTransferred

public final long getTransferred()

run

public final void run()
Specified by:
run in interface Runnable

setBufSize

public final void setBufSize(int bufSize)

jxUtil 0.6

Copyright © 2001,2002 Keve Müller, et al.; see LICENSE file for details.