com.partnersoft.v3x.io.formats
Class ObjectDump
java.lang.Object
com.partnersoft.v3x.io.formats.ObjectDump
public class ObjectDump
- extends java.lang.Object
This is a very simple variable-width, binary storage format for objects.
Essentially, it is WORM - you can dump an object to it, in which case the
object is appended, in serialized form, to the data file, and an entry added
to the offset file. You can then ask for that object by index number. Not
threadsafe. Write a wrapper if you need thread safety.
Compressed by default; optional constructor for uncompressed mode.
|
Constructor Summary |
ObjectDump(java.lang.String filenameBase)
Creates a compressed ObjectDump file for the given filename base
(everything but the extensions). |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ObjectDump
public ObjectDump(java.lang.String filenameBase)
- Creates a compressed ObjectDump file for the given filename base
(everything but the extensions).
getSize
public int getSize()
appendObject
public void appendObject(java.lang.Object victim)
throws java.io.IOException
- Throws:
java.io.IOException
readObject
public java.lang.Object readObject(int index)
throws java.io.IOException
- Throws:
java.io.IOException
clear
public void clear()
throws java.io.IOException
- Throws:
java.io.IOException
swap
public void swap(int a,
int b)
throws java.io.IOException
- Throws:
java.io.IOException