|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openstreetmap.osmosis.core.store.RandomAccessObjectStoreReader<T>
T
- The object type being stored.public class RandomAccessObjectStoreReader<T>
Provides read-only access to a random access object store. Each thread accessing the object store must create its own reader. The reader maintains all references to heavyweight resources such as file handles used to access the store eliminating the need for objects such as object iterators to be cleaned up explicitly.
Constructor Summary | |
---|---|
RandomAccessObjectStoreReader(BufferedRandomAccessFileInputStream randomFile,
ObjectReader objectReader)
Creates a new instance. |
Method Summary | |
---|---|
T |
get(long offset)
Reads the object at the specified file offset. |
java.util.Iterator<T> |
iterate()
Iterates over the entire stream of data. |
java.util.Iterator<T> |
iterate(long offset)
Iterates over the entire stream of data. |
long |
length()
Returns the length of data. |
long |
position()
Returns the current read position. |
void |
release()
Performs resource cleanup tasks such as closing files, or database connections. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RandomAccessObjectStoreReader(BufferedRandomAccessFileInputStream randomFile, ObjectReader objectReader)
randomFile
- A read-only random access file opened on the store file.objectReader
- The reader containing the objects to be deserialized.Method Detail |
---|
public T get(long offset)
offset
- The file offset to read an object from.
public long length()
public long position()
public java.util.Iterator<T> iterate(long offset)
offset
- The location in the storage file to begin reading.
public java.util.Iterator<T> iterate()
public void release()
release
in interface Releasable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |