public class ThresholdStore extends Object implements SeekableStore
Constructor and Description |
---|
ThresholdStore(int treshold)
Constructor for ThresholdStore.
|
ThresholdStore(int treshold,
File file)
Constructor for ThresholdStore.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public ThresholdStore(int treshold)
Constructor for ThresholdStore.
treshold
- a int.public void cleanup()
protected void finalize() throws Throwable
public int get(byte[] bytes, int offset, int length) throws IOException
length
bytes from the store.get
in interface Store
bytes
- 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 Store
bytes
- 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 SeekableStore
position
- 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.Copyright © 2008–2016. All rights reserved.