|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectch.javasoft.jbase.RandomAccessFilePersistor
public class RandomAccessFilePersistor
The RandomAccessFilePersistor implements
RandomAccessPersister using RandomAccessFiles.
| Constructor Summary | |
|---|---|
|
RandomAccessFilePersistor(File file)
|
protected |
RandomAccessFilePersistor(File file,
RandomAccessFile raf)
|
|
RandomAccessFilePersistor(File folder,
String fileName)
|
| Method Summary | |
|---|---|
void |
close(boolean erase)
Closes this persistor, subsequent read or write calls will cause an exception. |
RandomAccessFilePersistor |
createReadCopy(ReadWriteLock lock)
Returns a copy of this persistor for read access. |
void |
flush()
Ensures that any possibly cached data is written to the underlying store |
DataInput |
getInput()
Returns a data input object to read from. |
DataOutput |
getOutput()
Returns a data input object to write to. |
long |
getPosition()
Returns the current byte position. |
void |
setLength(long byteLength)
Sets the length of the storage. |
void |
setPosition(long bytePos)
Sets the byte offset position. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RandomAccessFilePersistor(File folder,
String fileName)
throws FileNotFoundException
FileNotFoundException
public RandomAccessFilePersistor(File file)
throws FileNotFoundException
FileNotFoundException
protected RandomAccessFilePersistor(File file,
RandomAccessFile raf)
throws FileNotFoundException
FileNotFoundException| Method Detail |
|---|
public long getPosition()
throws IOException
RandomAccessPersister
getPosition in interface RandomAccessPersisterIOException
public void setPosition(long bytePos)
throws IOException
RandomAccessPersister
setPosition in interface RandomAccessPersisterIOException
public void setLength(long byteLength)
throws IOException
RandomAccessPersister
setLength in interface RandomAccessPersisterIOException
public void flush()
throws IOException
RandomAccessPersister
flush in interface RandomAccessPersisterIOException
public void close(boolean erase)
throws IOException
RandomAccessPersister
close in interface RandomAccessPersistererase - if true, underlying files are deleted upon close
IOException
public DataInput getInput()
throws IOException
RandomAccessPersister
getInput in interface RandomAccessPersisterIOException
public DataOutput getOutput()
throws IOException
RandomAccessPersister
getOutput in interface RandomAccessPersisterIOException
public RandomAccessFilePersistor createReadCopy(ReadWriteLock lock)
throws IOException
getOutput() or setLength(long) causes an
UnsupportedOperationException.
createReadCopy in interface StatefulcreateReadCopy in interface RandomAccessPersisterlock - A read/write lock, the write lock is held. The lock,
however, might also be used for other functionality of the
returned read copy, for instance, if the read copy has to
be put in sync with the main object.
IOExceptionStateful.createReadCopy(ReadWriteLock)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||