public class DefaultDataBufferFactory extends ObjectSE implements DataBufferFactory
DataBufferFactory
インターフェースのデフォルトの実装。構築時のデフォルトの初期容量の指定、およびヒープベースのバッファーと直接バッファーのどちらを優先するかを指定できます。修飾子と型 | フィールドと説明 |
---|---|
static int | DEFAULT_INITIAL_CAPACITY 何も指定されていない場合のデフォルトの容量。 |
static DefaultDataBufferFactory | sharedInstance デフォルトのコンストラクターに基づく共有インスタンス。 |
コンストラクターと説明 |
---|
DefaultDataBufferFactory() デフォルト設定で新しい DefaultDataBufferFactory を作成します。 |
DefaultDataBufferFactory(boolean preferDirect) 新しい DefaultDataBufferFactory を作成し、allocateBuffer() および allocateBuffer(int) によってダイレクトバッファーを作成する必要があるかどうかを示します。 |
DefaultDataBufferFactory(boolean preferDirect, int defaultInitialCapacity) 新しい DefaultDataBufferFactory を作成し、ダイレクトバッファーを allocateBuffer() および allocateBuffer(int) で作成する必要があるかどうか、および allocateBuffer() に使用する容量を示します。 |
修飾子と型 | メソッドと説明 |
---|---|
DefaultDataBuffer | allocateBuffer() デフォルトの初期容量のデータバッファを割り当てます。 |
DefaultDataBuffer | allocateBuffer(int initialCapacity) 指定された初期容量のデータバッファーを割り当てます。 |
DefaultDataBuffer | join(ListSE<? extends DataBuffer> dataBuffers) 一緒に結合された dataBuffers 要素で構成される新しい DataBuffer を返します。 |
StringSE | toString() |
DefaultDataBuffer | wrap(byte[] bytes) 指定された byte 配列を DataBuffer でラップします。 |
DefaultDataBuffer | wrap(ByteBufferSE byteBuffer) 指定された ByteBuffer SE を DataBuffer でラップします。 |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, waitSE, waitSE, waitSE
public static final int DEFAULT_INITIAL_CAPACITY
public static final DefaultDataBufferFactory sharedInstance
public DefaultDataBufferFactory()
DefaultDataBufferFactory
を作成します。sharedInstance
public DefaultDataBufferFactory(boolean preferDirect)
DefaultDataBufferFactory
を作成し、allocateBuffer()
および allocateBuffer(int)
によってダイレクトバッファーを作成する必要があるかどうかを示します。preferDirect
- 直接バッファを優先する場合は true
。それ以外の場合は false
public DefaultDataBufferFactory(boolean preferDirect, int defaultInitialCapacity)
DefaultDataBufferFactory
を作成し、ダイレクトバッファーを allocateBuffer()
および allocateBuffer(int)
で作成する必要があるかどうか、および allocateBuffer()
に使用する容量を示します。preferDirect
- 直接バッファを優先する場合は true
。それ以外の場合は false
public DefaultDataBuffer allocateBuffer()
DataBufferFactory
DataBufferFactory
の allocateBuffer
public DefaultDataBuffer allocateBuffer(int initialCapacity)
DataBufferFactory
DataBufferFactory
の allocateBuffer
initialCapacity
- 割り当てるバッファの初期容量 public DefaultDataBuffer wrap(ByteBufferSE byteBuffer)
DataBufferFactory
DataBufferFactory
の wrap
byteBuffer
- ラップする NIO バイトバッファ public DefaultDataBuffer wrap(byte[] bytes)
DataBufferFactory
DataBufferFactory
の wrap
bytes
- ラップするバイト配列 public DefaultDataBuffer join(ListSE<? extends DataBuffer> dataBuffers)
dataBuffers
要素で構成される新しい DataBuffer
を返します。実装に応じて、返されるバッファーは、提供されたバッファーのすべてのデータを含む単一のバッファーの場合と、バッファーへの参照を含む真のコンポジットの場合があります。与えられたデータバッファは返されたコンポジットの一部として解放されるため、解放する必要がないことに注意してください。
この実装は、dataBuffers
のデータを含む単一の DefaultDataBuffer
を作成します。
DataBufferFactory
の join
dataBuffers
- 構成するデータバッファ dataBuffers
引数から構成されるバッファー public StringSE toString()
ObjectSE
の toStringSE