| Modifier and Type | Field and Description |
|---|---|
| private final ArrayCache | |
| private final List | |
| private final List |
| Access | Constructor and Description |
|---|---|
| public | ResettableArrayCache(ArrayCache arrayCache)
Creates a new ResettableArrayCache based on the given ArrayCache. |
| Modifier and Type | Method and Description |
|---|---|
| public byte[] | getByteArray(int
the minimum size of the array to allocate;
an implementation may return an array that
is larger than the given size, boolean sizeif true, the caller expects that the first
fillWithZeros)size elements in the array are zero;
if false, the array contents can be anything,
which speeds things up when reusing a cached
arrayOverrides org. |
| public int[] | getIntArray(int
the minimum size of the array to allocate;
an implementation may return an array that
is larger than the given size, boolean sizeif true, the caller expects that the first
fillWithZeros)size elements in the array are zero;
if false, the array contents can be anything,
which speeds things up when reusing a cached
arrayOverrides org. |
| public void | putArray(byte[] array)
Overrides org. |
| public void | putArray(int[] array)
Overrides org. |
| public void | reset()
Puts all allocated arrays back to the underlying ArrayCache
that haven't already been put there with a call to
|
| arrayCache | back to summary |
|---|---|
| private final ArrayCache arrayCache | |
| byteArrays | back to summary |
|---|---|
| private final List<byte[]> byteArrays | |
| intArrays | back to summary |
|---|---|
| private final List<int[]> intArrays | |
| ResettableArrayCache | back to summary |
|---|---|
| public ResettableArrayCache(ArrayCache arrayCache) Creates a new ResettableArrayCache based on the given ArrayCache. | |
| getByteArray | back to summary |
|---|---|
| public byte[] getByteArray(int size, boolean fillWithZeros) Overrides org. Doc from org. Allocates a new byte array.
This implementation simply returns
| |
| getIntArray | back to summary |
|---|---|
| public int[] getIntArray(int size, boolean fillWithZeros) Overrides org. Doc from org. Allocates a new int array.
This implementation simply returns
| |
| putArray | back to summary |
|---|---|
| public void putArray(byte[] array) Overrides org. Doc from org. Puts the given byte array to the cache. The caller must no longer use the array. This implementation does nothing. | |
| putArray | back to summary |
|---|---|
| public void putArray(int[] array) Overrides org. Doc from org. Puts the given int array to the cache. The caller must no longer use the array. This implementation does nothing. | |
| reset | back to summary |
|---|---|
| public void reset() Puts all allocated arrays back to the underlying ArrayCache
that haven't already been put there with a call to
| |