|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.gc.iotools.stream.store.ThresholdStore
public class ThresholdStore
Store that puts data in memory until threshold size is reach. At that point data is written to the disk.
| Constructor Summary | |
|---|---|
ThresholdStore(int treshold)
Constructor for ThresholdStore. |
|
ThresholdStore(int treshold,
File file)
Constructor for ThresholdStore. |
|
| Method Summary | |
|---|---|
void |
cleanup()
Cleans up the Store. |
protected void |
finalize()
Clean up the temporary files eventually open. |
int |
get(byte[] bytes,
int offset,
int length)
gets length bytes from the store. |
long |
getSize()
Getter for the field size. |
int |
getTreshold()
Getter for the field treshold. |
void |
put(byte[] bytes,
int offset,
int length)
put |
void |
seek(long position)
Reposition this Store on a previously read position. |
void |
setPosition(long position)
Setter for the field position. |
String |
toString()
Provides a String representation of the state of the Store for debugging purposes. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ThresholdStore(int treshold)
Constructor for ThresholdStore.
treshold - a int.
public ThresholdStore(int treshold,
File file)
Constructor for ThresholdStore.
treshold - a int.file - a File object.| Method Detail |
|---|
public void cleanup()
cleanup in interface Store
protected void finalize()
throws Throwable
finalize in class ObjectThrowable
public int get(byte[] bytes,
int offset,
int length)
throws IOException
length bytes from the store.
get in interface Storebytes - array where to put the data in.offset - offset in the array to start put the data.length - length of the bytes got from the store.
IOException - when an error occurs in the store, and data can't be
retrieved.public long getSize()
Getter for the field size.
public int getTreshold()
Getter for the field treshold.
public void put(byte[] bytes,
int offset,
int length)
throws IOException
put
put in interface Storebytes - an array of byte.offset - a int.length - a int.
IOException - if any.
public void seek(long position)
throws IOException
Store on a previously read position.
seek in interface SeekableStoreposition - position to read the data from.
IOException - If some error in the internal store happens.
EOFException - If a position is greater than the actual Store
size.public void setPosition(long position)
Setter for the field position.
position - a long.public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||