|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
cami.FileSizeChecker
public class FileSizeChecker
This class blocks a Thread until a certain filesize is reached.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
static int |
LOOP_BREAK
number of times the check-loop will be repeated without any changes, until it will be breaked. |
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
FileSizeChecker(java.io.File f,
int minimalSize)
|
|
| Method Summary | |
|---|---|
void |
run()
loop as long as the file hasn't reached the minimalSize. |
| 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 |
|---|
public static final int LOOP_BREAK
BufferedWriter normally writes
8192 bytes a time, so with a nice 56k modem this can take
more than 2 seconds! But the check is performed 100 times per second, so
at least 200-400 loops should be granted.
| Constructor Detail |
|---|
public FileSizeChecker(java.io.File f,
int minimalSize)
f - the file to checkminimalSize - minimal filesize in bytes| Method Detail |
|---|
public void run()
minimalSize.
As soon as the wanted filesize is reached, this thread is stopped and the
programm can continue.
run in interface java.lang.Runnablerun in class java.lang.Thread
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||