com.partnersoft.v3x.io.formats
Class ObjectDumpBuilder

java.lang.Object
  extended by com.partnersoft.v3x.io.formats.ObjectDumpBuilder

public class ObjectDumpBuilder
extends java.lang.Object

This class builds ObjectDumps using buffered streams. More efficient than the ObjectDump append methods. Building can be stopped and restarted; this allows having a cache of builders, stopping ones that are stale but restarting them later when needed.


Constructor Summary
ObjectDumpBuilder(java.io.File dataFile, java.io.File offsetFile)
           
ObjectDumpBuilder(java.lang.String filenameBase)
          Creates an ObjectDumpBuilder for the given filename base (everything but the extensions).
 
Method Summary
 void appendBytes(byte[] victimBytes)
           
 void appendObject(java.lang.Object victim)
           
 void clear()
           
 void close()
          Closes the dump.
 int getCurrentSize()
           
 void reset()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectDumpBuilder

public ObjectDumpBuilder(java.lang.String filenameBase)
                  throws java.io.IOException
Creates an ObjectDumpBuilder for the given filename base (everything but the extensions). If the .dump and .offset files already exist, you may continue adding data.

Throws:
java.io.IOException

ObjectDumpBuilder

public ObjectDumpBuilder(java.io.File dataFile,
                         java.io.File offsetFile)
                  throws java.io.IOException
Throws:
java.io.IOException
Method Detail

appendObject

public void appendObject(java.lang.Object victim)
                  throws java.io.IOException
Throws:
java.io.IOException

appendBytes

public void appendBytes(byte[] victimBytes)
                 throws java.io.IOException
Throws:
java.io.IOException

getCurrentSize

public int getCurrentSize()

clear

public void clear()
           throws java.io.IOException
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Closes the dump. You can reopen it by creating a new object or by calling reset();

Throws:
java.io.IOException

reset

public void reset()
           throws java.io.IOException
Throws:
java.io.IOException