| java.lang.Object org.openrdf.sail.nativerdf.datastore.DataFile
DataFile | public class DataFile (Code) | | 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.
author: Arjohn Kampman |
Inner Class :public class DataIterator | |
Method Summary | |
public void | clear() Discards all stored data. | public void | close() Closes the data file, releasing any file locks that it might have. | public byte[] | getData(long offset) Gets the data that is stored at the specified offset.
Parameters: offset - An offset in the data file, must be larger than 0. | public File | getFile() | public DataIterator | iterator() Gets an iterator that can be used to iterate over all stored data. | public long | storeData(byte[] data) Stores the specified data and returns the byte-offset at which it has been
stored.
Parameters: data - The data to store, must not be null. | public void | sync() Syncs any unstored data to the hash file. |
getData | public byte[] getData(long offset) throws IOException(Code) | | Gets the data that is stored at the specified offset.
Parameters: offset - An offset in the data file, must be larger than 0. The data that was found on the specified offset. exception: IOException - If an I/O error occurred. |
iterator | public DataIterator iterator()(Code) | | Gets an iterator that can be used to iterate over all stored data.
a DataIterator. |
storeData | public long storeData(byte[] data) throws IOException(Code) | | Stores the specified data and returns the byte-offset at which it has been
stored.
Parameters: data - The data to store, must not be null. The byte-offset in the file at which the data was stored. |
sync | public void sync() throws IOException(Code) | | Syncs any unstored data to the hash file.
|
|
|