Main Page | Class Hierarchy | Data Structures | Directories | File List | Data Fields | Related Pages

com::sleepycat::bind::serial::SerialBase Class Reference

Inheritance diagram for com::sleepycat::bind::serial::SerialBase:

com::sleepycat::bind::serial::SerialBinding

Public Member Functions

 SerialBase ()
void setSerialBufferSize (int byteSize)
int getSerialBufferSize ()

Protected Member Functions

FastOutputStream getSerialOutput (Object object)

Detailed Description

A base class for serial bindings creators that provides control over the allocation of the output buffer.

Serial bindings append data to a FastOutputStream instance. This object has a byte array buffer that is resized when it is full. The reallocation of this buffer can be a performance factor for some applications using large objects. To manage this issue, the setSerialBufferSize method may be used to control the initial size of the buffer, and the getSerialOutput method may be overridden by subclasses to take over creation of the FastOutputStream object.

Definition at line 26 of file SerialBase.java.


Constructor & Destructor Documentation

com::sleepycat::bind::serial::SerialBase::SerialBase  )  [inline]
 

Initializes the initial output buffer size to zero.

Unless setSerialBufferSize is called, the default FastOutputStream#DEFAULT_INIT_SIZE size will be used.

Definition at line 36 of file SerialBase.java.


Member Function Documentation

int com::sleepycat::bind::serial::SerialBase::getSerialBufferSize  )  [inline]
 

Returns the initial byte size of the output buffer.

Returns:
the initial byte size of the output buffer.
See also:
setSerialBufferSize

Definition at line 61 of file SerialBase.java.

Referenced by getSerialOutput().

FastOutputStream com::sleepycat::bind::serial::SerialBase::getSerialOutput Object  object  )  [inline, protected]
 

Returns an empty SerialOutput instance that will be used by the serial binding or key creator.

The default implementation of this method creates a new SerialOutput with an initial buffer size that can be changed using the setSerialBufferSize method.

This method may be overridden to return a FastOutputStream instance. For example, an instance per thread could be created and returned by this method. If a FastOutputStream instance is reused, be sure to call its FastOutputStream#reset method before each use.

Parameters:
object is the object to be written to the serial output, and may be used by subclasses to determine the size of the output buffer.
Returns:
an empty FastOutputStream instance.
See also:
setSerialBufferSize

Definition at line 85 of file SerialBase.java.

References getSerialBufferSize().

Referenced by com::sleepycat::bind::serial::SerialBinding::objectToEntry().

void com::sleepycat::bind::serial::SerialBase::setSerialBufferSize int  byteSize  )  [inline]
 

Sets the initial byte size of the output buffer that is allocated by the default implementation of getSerialOutput.

If this property is zero (the default), the default FastOutputStream#DEFAULT_INIT_SIZE size is used.

Parameters:
byteSize the initial byte size of the output buffer, or zero to use the default size.

Definition at line 50 of file SerialBase.java.


The documentation for this class was generated from the following file:
Generated on Sun Dec 25 12:14:58 2005 for Berkeley DB 4.4.16 by  doxygen 1.4.2