|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.fjank.jcache.persistence.CacheFileAdapter
public class CacheFileAdapter
Provides thread safe access to the underlying random access file.
| Constructor Summary | |
|---|---|
CacheFileAdapter(File file)
Creates a new CacheFileAdapter object. |
|
| Method Summary | |
|---|---|
void |
append(byte[] data)
|
org.fjank.jcache.persistence.DiskElementDescriptor |
appendObject(CacheObject obj)
adds an object to the diskcache. |
void |
close()
|
static DiskCacheObject |
deSerialize(byte[] data)
|
long |
length()
|
byte[] |
read(long pos)
reads from the diskfile, and return the raw bytes contained at that pos. |
Serializable |
readObject(long pos)
reads an object starting at the position,. |
void |
reset()
|
static byte[] |
serialize(Serializable obj)
|
String |
toString()
returns a String representation of this object. |
void |
write(byte[] data,
long pos)
|
void |
writeObject(Serializable obj,
long pos)
writes an object down to the cachefile |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public CacheFileAdapter(File file)
file - the file to adapt to
DiskCacheException - if any exceptioins occur.| Method Detail |
|---|
public String toString()
toString in class Objectpublic byte[] read(long pos)
pos - the position to start at.
public Serializable readObject(long pos)
throws DiskCacheException
pos - the position to start at
DiskCacheException
DiskCacheException - if any exceptions occur.
public void append(byte[] data)
throws DiskCacheException
DiskCacheException
public void write(byte[] data,
long pos)
public void writeObject(Serializable obj,
long pos)
obj - the object to writepos - the position to start at.
DiskCacheException - if any exception occur.public org.fjank.jcache.persistence.DiskElementDescriptor appendObject(CacheObject obj)
obj - the object to add.
DiskCacheException - if any exceptions occur.public long length()
public void close()
public void reset()
public static byte[] serialize(Serializable obj)
public static DiskCacheObject deSerialize(byte[] data)
throws DiskCacheException
DiskCacheException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||