J
Jeff
I would like to build an index for objects that I write to a file. I can
already write objects, then read them by starting at the beginning of the
file. Now I would like to do add the file position of an object to an
index, then read based on that index.
My problem is that I can't figure out the classes to use.
new ObjectOutputStream( RandomAccessFile ) is not a valid constructor
for ObjectOutputStream
FileOutputStream fs = FileOutputStream( filename);
os = new ObjectOutputStream ( fs );
the above works, but I can't find a way to get the current file position
before calling writeObject.
I'd appreciate any suggestions.
Thanks
Jeff
already write objects, then read them by starting at the beginning of the
file. Now I would like to do add the file position of an object to an
index, then read based on that index.
My problem is that I can't figure out the classes to use.
new ObjectOutputStream( RandomAccessFile ) is not a valid constructor
for ObjectOutputStream
FileOutputStream fs = FileOutputStream( filename);
os = new ObjectOutputStream ( fs );
the above works, but I can't find a way to get the current file position
before calling writeObject.
I'd appreciate any suggestions.
Thanks
Jeff