|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.globus.wsrf.utils.io.IndexedObjectFileReader
Reads Java objects from an indexed file. The indexing allows for random
access to any object in the file.
Note: This class is not thread-safe.
ObjectInputStream| Field Summary | |
private byte[] |
buffer
|
private java.util.List |
index
|
private long |
indexPointer
|
private java.io.RandomAccessFile |
raf
|
| Constructor Summary | |
IndexedObjectFileReader(java.lang.String file)
|
|
| Method Summary | |
void |
close()
Closes the file. |
int |
getIndexSize()
Gets the size of the index (the number of objects in the file). |
private void |
init()
|
void |
jumpTo(int index)
Jumps to the object at the specified position in the file. |
java.lang.Object |
readObject()
Reads a Java object from the file. |
private java.lang.Object |
readObjectSub()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private java.io.RandomAccessFile raf
private byte[] buffer
private long indexPointer
private java.util.List index
| Constructor Detail |
public IndexedObjectFileReader(java.lang.String file)
throws java.io.IOException,
java.io.FileNotFoundException
| Method Detail |
private void init()
throws java.io.IOException,
java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
private java.lang.Object readObjectSub()
throws java.io.IOException,
java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
public java.lang.Object readObject()
throws java.io.IOException,
java.lang.ClassNotFoundException
java.io.IOException - if any error occurs.
java.lang.ClassNotFoundException - if cannot find the class for the object
in the file.
java.io.EOFException - if end of the file is reached.ObjectInputStream.readObject()public int getIndexSize()
public void jumpTo(int index)
throws java.io.IOException
index - the position to jump to.
java.io.IOException - if the position specified is invalid or any other
error occurs.
public void close()
throws java.io.IOException
java.io.IOException - if any error occurs.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||