|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.mmm.util.io.base.AbstractByteArray
net.sf.mmm.util.io.base.ByteArrayImpl
net.sf.mmm.util.io.impl.PooledByteArray
public class PooledByteArray
This is an implementation of ByteArray
that holds a pooled
byte-array
.
ByteArrayPool
Field Summary | |
---|---|
private int |
childCount
The number of children created. |
private PooledByteArray |
parent
The parent that created this array. |
private boolean |
released
|
Constructor Summary | |
---|---|
|
PooledByteArray(byte[] buffer)
The constructor. |
|
PooledByteArray(byte[] buffer,
int startIndex,
int maximumIndex)
The constructor. |
protected |
PooledByteArray(byte[] buffer,
int startIndex,
int maximumIndex,
PooledByteArray parent)
The constructor. |
Method Summary | |
---|---|
ByteArrayImpl |
createSubArray(int minimum,
int maximum)
This method creates a new ByteArray with the same bytes but the given
indices.ATTENTION: If the implementation is immutable and the given minimum and maximum index are
both equal to the current indices of this ByteArray this method may return the instance itself (
this ) rather than creating a new one. |
boolean |
release()
This method marks this array to be released. |
Methods inherited from class net.sf.mmm.util.io.base.ByteArrayImpl |
---|
getBytes, getCurrentIndex, getMaximumIndex, getMinimumIndex, setMaximumIndex, toString |
Methods inherited from class net.sf.mmm.util.io.base.AbstractByteArray |
---|
checkSubArray, getBytesAvailable |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private final PooledByteArray parent
created
this array.
private int childCount
children
created.
private boolean released
release()
Constructor Detail |
---|
public PooledByteArray(byte[] buffer)
buffer
- is the internal buffer
.public PooledByteArray(byte[] buffer, int startIndex, int maximumIndex)
buffer
- is the internal buffer
.startIndex
- is the current index
as well as the
minimum index
.maximumIndex
- is the maximum index
.protected PooledByteArray(byte[] buffer, int startIndex, int maximumIndex, PooledByteArray parent)
buffer
- is the internal buffer
.startIndex
- is the current index
as well as the
minimum index
.maximumIndex
- is the maximum index
.parent
- is the parent that created
this array.Method Detail |
---|
public ByteArrayImpl createSubArray(int minimum, int maximum)
ByteArray
with the same bytes
but the given
indices.minimum
and maximum
index are
both equal to the current indices of this ByteArray
this method may return the instance itself (
this
) rather than creating a new one.
createSubArray
in interface ByteArray
createSubArray
in class ByteArrayImpl
minimum
- is the minimumIndex
and the currentIndex
for the new ByteArray
. It has to be greater or equal to the
minimumIndex
of this
ByteArray
.maximum
- is the maximumIndex
for the new ByteArray
.
ByteArray
with the given indices.public boolean release()
true
if this array can be released, false
if there are references left
that have to be released before.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |