org.jacorb.orb
Class BufferManager
java.lang.Object
org.jacorb.orb.BufferManager
public final class BufferManager
extends java.lang.Object
A BufferManager is used to share a pool of buffers and to implement
a buffer allocation policy. This reduces the number of memory
allocations and deallocations and the overall memory footprint.
Buffers are generally created on demand.
The BufferManager uses a singleton pattern, so will only be a single
shared BuffferManager across all ORBs in a process.
Version:
- Gerald Brose, FU Berlin
configure
public static void configure(Configuration configuration)
throws ConfigurationException
configures the BufferManager, in turn configures the singleton.
Must be called before getInstance() !
getBuffer
public byte[] getBuffer(int initial)
getBuffer
public byte[] getBuffer(int initial,
boolean cdrStr)
getBuffer
returns a new buffer.
initial
- an int
valuecdrStr
- a boolean
value to denote if CDROuputStream is caller
(may use cache in this situation)
- a
byte[]
value
getPreferredMemoryBuffer
public byte[] getPreferredMemoryBuffer()
release
public void release()
returnBuffer
public void returnBuffer(byte[] current)