Package com.tangosol.io
Class ByteArrayWriteBuffer.Allocator
- java.lang.Object
-
- com.tangosol.io.ByteArrayWriteBuffer.Allocator
-
- All Implemented Interfaces:
MultiBufferWriteBuffer.WriteBufferPool
- Enclosing class:
- ByteArrayWriteBuffer
public static class ByteArrayWriteBuffer.Allocator extends Object implements MultiBufferWriteBuffer.WriteBufferPool
Allocator is a WriteBufferPool implementation which allocates a new ByteArrayWriteBuffer on each request to the pool, and does not retain the returned buffer. Essentially it is dummy pool which acts as an allocator.
-
-
Field Summary
Fields Modifier and Type Field Description protected int
m_cb
The capacity of the ByteArrayWriteBuffer instances to allocate.
-
Constructor Summary
Constructors Constructor Description Allocator(int cb)
Construct an Allocator for ByteArrayWriteBuffers of a given size.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WriteBuffer
allocate(int cbPreviousTotal)
Allocate a new ByteArrayWriteBuffer.int
getMaximumCapacity()
Determine the largest amount of aggregate WriteBuffer capacity that this factory can provide.void
release(WriteBuffer buffer)
Release the supplied buffer into the pool.
-
-
-
Method Detail
-
getMaximumCapacity
public int getMaximumCapacity()
Determine the largest amount of aggregate WriteBuffer capacity that this factory can provide.- Specified by:
getMaximumCapacity
in interfaceMultiBufferWriteBuffer.WriteBufferPool
- Returns:
- the number of bytes that can be stored in the WriteBuffer objects that may be returned from this factory
-
allocate
public WriteBuffer allocate(int cbPreviousTotal)
Allocate a new ByteArrayWriteBuffer.- Specified by:
allocate
in interfaceMultiBufferWriteBuffer.WriteBufferPool
- Parameters:
cbPreviousTotal
- unused- Returns:
- a new ByteArrayWriteBuffer with this Allocator's
capacity
-
release
public void release(WriteBuffer buffer)
Release the supplied buffer into the pool.This method is a no op.
- Specified by:
release
in interfaceMultiBufferWriteBuffer.WriteBufferPool
- Parameters:
buffer
- unused
-
-