|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openrdf.sail.nativerdf.datastore.DataFile
public class DataFile
Class supplying access to a data file. A data file stores data sequentially. Each entry starts with the entry's length (4 bytes), followed by the data itself. File offsets are used to identify entries.
| Nested Class Summary | |
|---|---|
class |
DataFile.DataIterator
An iterator that iterates over the data that is stored in a data file. |
| Constructor Summary | |
|---|---|
DataFile(File file)
|
|
DataFile(File file,
boolean forceSync)
|
|
| Method Summary | |
|---|---|
void |
clear()
Discards all stored data. |
void |
close()
Closes the data file, releasing any file locks that it might have. |
byte[] |
getData(long offset)
Gets the data that is stored at the specified offset. |
File |
getFile()
|
DataFile.DataIterator |
iterator()
Gets an iterator that can be used to iterate over all stored data. |
long |
storeData(byte[] data)
Stores the specified data and returns the byte-offset at which it has been stored. |
void |
sync()
Syncs any unstored data to the hash file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DataFile(File file)
throws IOException
IOException
public DataFile(File file,
boolean forceSync)
throws IOException
IOException| Method Detail |
|---|
public File getFile()
public long storeData(byte[] data)
throws IOException
data - The data to store, must not be null.
IOException
public byte[] getData(long offset)
throws IOException
offset - An offset in the data file, must be larger than 0.
IOException - If an I/O error occurred.
public void clear()
throws IOException
IOException - If an I/O error occurred.
public void sync()
throws IOException
IOException
public void close()
throws IOException
IOExceptionpublic DataFile.DataIterator iterator()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||