public class RAFCircularBuffer<T extends java.io.Serializable>
extends java.lang.Object
RandomAccessFile
as the backing store.Modifier and Type | Class and Description |
---|---|
static interface |
RAFCircularBuffer.Filter<K> |
Constructor and Description |
---|
RAFCircularBuffer(java.io.File file,
int sizeInKB,
boolean gzip) |
Modifier and Type | Method and Description |
---|---|
java.util.Iterator<T> |
_backwardIter()
Deprecated.
|
java.util.Iterator<T> |
_forwardIter()
Deprecated.
|
void |
close() |
protected T |
deserializeObject(java.io.InputStream stream) |
void |
exportBuffer(java.io.OutputStream outputStream) |
long |
getFileSize() |
java.util.List<T> |
iterateBackward(RAFCircularBuffer.Filter<? super T> filter) |
java.util.List<T> |
iterateForward(RAFCircularBuffer.Filter<T> filter) |
static void |
main(java.lang.String[] args) |
void |
reset() |
protected void |
serializeObject(T object,
java.io.OutputStream stream)
Gives subclasses the chance to affect how data is written.
|
void |
write(T object) |
public RAFCircularBuffer(java.io.File file, int sizeInKB, boolean gzip) throws java.io.IOException
file
- The file to use as the buffersizeInKB
- must be at least 1gzip
- A flag for whether or not new records should be stored with Gzip compressionjava.io.IOException
public void reset()
public long getFileSize() throws java.io.IOException
java.io.IOException
public void exportBuffer(java.io.OutputStream outputStream) throws java.io.IOException
java.io.IOException
protected void serializeObject(T object, java.io.OutputStream stream) throws java.io.IOException
java.io.IOException
protected T deserializeObject(java.io.InputStream stream) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
public void write(T object) throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
java.io.IOException
public java.util.List<T> iterateForward(RAFCircularBuffer.Filter<T> filter)
public java.util.List<T> iterateBackward(RAFCircularBuffer.Filter<? super T> filter)
@Deprecated public java.util.Iterator<T> _forwardIter()
@Deprecated public java.util.Iterator<T> _backwardIter()
public static void main(java.lang.String[] args)