|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface RandomAccessPersister
Abstraction of storage which can be accessed randomly, such as
RandomAccessFiles.
Random access of a storage device means setting a byte offset, and reading or writing at this offset position in the sequal.
| Method Summary | |
|---|---|
void |
close(boolean erase)
Closes this persistor, subsequent read or write calls will cause an exception. |
RandomAccessPersister |
createReadCopy(ReadWriteLock lock)
Override to specialize return type |
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. |
| Method Detail |
|---|
long getPosition()
throws IOException
IOException
void setPosition(long bytePos)
throws IOException
IOException
void setLength(long byteLength)
throws IOException
IOException
DataInput getInput()
throws IOException
IOException
DataOutput getOutput()
throws IOException
IOException
void flush()
throws IOException
IOException
void close(boolean erase)
throws IOException
erase - if true, underlying files are deleted upon close
IOException
RandomAccessPersister createReadCopy(ReadWriteLock lock)
throws IOException
createReadCopy in interface Statefullock - 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 | |||||||||