cami
Class FileFetcher

java.lang.Object
  extended by java.lang.Thread
      extended by cami.FileFetcher
All Implemented Interfaces:
java.lang.Runnable

public class FileFetcher
extends java.lang.Thread

FileFetcher loads the content of an InputStream in a separeted Thread in the background.

Author:
Camillo Bruni

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
static int BUFFER_SIZE
          Standard Buffer-Size, this one is rather small, but for an internet connection... you know these fucking 56k-Modems still live outthere in the savage!
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
FileFetcher(java.io.InputStream in, java.io.File f)
           
FileFetcher(java.io.InputStream in, java.io.File f, int bufferSize)
           
 
Method Summary
 long getBytesWritten()
          Returns the number of bytes loaded from the inputStream
 void run()
           
 void stopFetching()
          stops to whole process... and finishes the file.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BUFFER_SIZE

public static final int BUFFER_SIZE
Standard Buffer-Size, this one is rather small, but for an internet connection... you know these fucking 56k-Modems still live outthere in the savage!

See Also:
Constant Field Values
Constructor Detail

FileFetcher

public FileFetcher(java.io.InputStream in,
                   java.io.File f)

FileFetcher

public FileFetcher(java.io.InputStream in,
                   java.io.File f,
                   int bufferSize)
Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

stopFetching

public void stopFetching()
stops to whole process... and finishes the file.


getBytesWritten

public long getBytesWritten()
Returns the number of bytes loaded from the inputStream

Returns: