Package org.apache.mina.util.byteaccess
Class ByteArrayPool
- java.lang.Object
-
- org.apache.mina.util.byteaccess.ByteArrayPool
-
- All Implemented Interfaces:
ByteArrayFactory
public class ByteArrayPool extends Object implements ByteArrayFactory
CreatesByteArray
s, using a pool to reduce allocation where possible. WARNING: This code has never been run!- Author:
- Apache MINA Project
-
-
Constructor Summary
Constructors Constructor Description ByteArrayPool(boolean direct, int maxFreeBuffers, int maxFreeMemory)
Creates a new instance of ByteArrayPool.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteArray
create(int size)
Creates a new instance of aByteArray
void
free()
Frees the buffers
-
-
-
Constructor Detail
-
ByteArrayPool
public ByteArrayPool(boolean direct, int maxFreeBuffers, int maxFreeMemory)
Creates a new instance of ByteArrayPool.- Parameters:
direct
- If we should use direct buffersmaxFreeBuffers
- The maximum number of free buffersmaxFreeMemory
- The maximum amount of free memory allowed
-
-
Method Detail
-
create
public ByteArray create(int size)
Creates a new instance of aByteArray
- Specified by:
create
in interfaceByteArrayFactory
- Parameters:
size
- The size of the array to build- Returns:
- The ByteArray
-
free
public void free()
Frees the buffers
-
-