public class ByteArrayPool extends Object implements ByteArrayFactory
ByteArrays, using a pool to reduce allocation where possible.
WARNING: This code has never been run!| Constructor and Description |
|---|
ByteArrayPool(boolean direct,
int maxFreeBuffers,
int maxFreeMemory)
Creates a new instance of ByteArrayPool.
|
| Modifier and Type | Method and Description |
|---|---|
ByteArray |
create(int size)
Creates a new instance of a
ByteArray |
void |
free()
Frees the buffers
|
public ByteArrayPool(boolean direct,
int maxFreeBuffers,
int maxFreeMemory)
direct - If we should use direct buffersmaxFreeBuffers - The maximum number of free buffersmaxFreeMemory - The maximum amount of free memory allowedpublic ByteArray create(int size)
ByteArraycreate in interface ByteArrayFactorysize - The size of the array to buildpublic void free()
Copyright © 2004–2017 Apache MINA Project. All rights reserved.