public class ByteBufferList extends Object
Contains a list of byte buffers of the same size. The list has an initial and maximum size.
Constructor and Description |
---|
ByteBufferList(int bufSize,
int initAlloc,
int maxAlloc)
Class constructor
|
Modifier and Type | Method and Description |
---|---|
byte[] |
allocateBuffer(long waitTime)
Allocate a buffer
|
int |
getAllocatedCount()
Return the count of buffers currently allocated out
|
int |
getAvailableCount()
Return the count of available buffers
|
int |
getBufferSize()
Return the buffer size
|
int |
getInitialAllocation()
Return the initial allocation size
|
int |
getMaximumAllocation()
Return the maximum allocation size
|
long |
getStatAllocationCounter()
Return the allocations statistic
|
long |
getStatAllocationWaits()
Return the allocation wait statistic
|
long |
getStatAllocationWaitsExpired()
Return the allocation wait expired statistic
|
void |
releaseBuffer(byte[] buf)
Release a buffer back to the pool
|
int |
shrinkList()
Shrink the buffer list back to the initial allocation size
|
String |
toString()
Return the buffer list as a string
|
public ByteBufferList(int bufSize, int initAlloc, int maxAlloc)
bufSize
- intinitAlloc
- intmaxAlloc
- intpublic final int getBufferSize()
public final int getInitialAllocation()
public final int getMaximumAllocation()
public final int getAvailableCount()
public final int getAllocatedCount()
public final long getStatAllocationCounter()
public final long getStatAllocationWaits()
public final long getStatAllocationWaitsExpired()
public final byte[] allocateBuffer(long waitTime)
waitTime
- longpublic final void releaseBuffer(byte[] buf)
buf
- byte[]public final int shrinkList()
Copyright © 2005–2018 Alfresco Software. All rights reserved.