|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.mmm.util.pool.base.AbstractPool<byte[]>
net.sf.mmm.util.pool.impl.ByteArrayPoolImpl
public class ByteArrayPoolImpl
This is the default implementation of the
Pool interface for byte-arrays.
| Field Summary | |
|---|---|
private int |
arrayLength
The actual length of the byte-arrays. |
static int |
DEFAULT_ARRAY_LENGTH
The default array length. |
| Fields inherited from class net.sf.mmm.util.pool.base.AbstractPool |
|---|
DEFAULT_CAPACITY |
| Constructor Summary | |
|---|---|
ByteArrayPoolImpl()
The constructor. |
|
ByteArrayPoolImpl(int capacity,
int arrayLength)
The constructor. |
|
| Method Summary | |
|---|---|
protected byte[] |
create()
This method creates a new element. |
protected boolean |
reset(byte[] element)
This method resets the given element so it can be reused. |
| Methods inherited from class net.sf.mmm.util.pool.base.AbstractPool |
|---|
borrow, clear, getCapacity, getSize, isEmpty, release |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface net.sf.mmm.util.pool.api.Pool |
|---|
borrow, isEmpty, release |
| Field Detail |
|---|
public static final int DEFAULT_ARRAY_LENGTH
private final int arrayLength
| Constructor Detail |
|---|
public ByteArrayPoolImpl()
public ByteArrayPoolImpl(int capacity,
int arrayLength)
capacity - is the capacity of the pool.arrayLength - is the length of each pooled byte-array.| Method Detail |
|---|
protected byte[] create()
create in class AbstractPool<byte[]>protected boolean reset(byte[] element)
element so it can be reused. It
is called if an element is released and will be
stored in the pool. The implementation depends on the type of element. Some
types may become inconsistent if they are directly reused. Further this
method may clear data from the element for security reasons, because the
same instance may be given to some other component that is NOT trusted
enough (because it may be vulnerably).
reset in class AbstractPool<byte[]>element - the element to reset.
true if the given element can be reused
and should be added to the pool, false otherwise.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||