Berkeley DB XML
version 2.5.16

com.sleepycat.bind.serial
Class SerialBase

java.lang.Object
  extended by com.sleepycat.bind.serial.SerialBase
Direct Known Subclasses:
SerialBinding

public class SerialBase
extends Object

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(int) method may be used to control the initial size of the buffer, and the getSerialOutput(java.lang.Object) method may be overridden by subclasses to take over creation of the FastOutputStream object.

See Also:
Class Evolution

Constructor Summary
SerialBase()
          Initializes the initial output buffer size to zero.
 
Method Summary
 int getSerialBufferSize()
          Returns the initial byte size of the output buffer.
 void setSerialBufferSize(int byteSize)
          Sets the initial byte size of the output buffer that is allocated by the default implementation of getSerialOutput(java.lang.Object).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SerialBase

public SerialBase()
Initializes the initial output buffer size to zero.

Unless setSerialBufferSize(int) is called, the default FastOutputStream.DEFAULT_INIT_SIZE size will be used.

Method Detail

setSerialBufferSize

public void setSerialBufferSize(int byteSize)
Sets the initial byte size of the output buffer that is allocated by the default implementation of getSerialOutput(java.lang.Object).

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.

getSerialBufferSize

public int getSerialBufferSize()
Returns the initial byte size of the output buffer.

Returns:
the initial byte size of the output buffer.
See Also:
setSerialBufferSize(int)

Berkeley DB XML
version 2.5.16

Copyright (c) 1996,2009 Oracle. All rights reserved.