public class ByteBufferList
extends java.lang.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
|
java.lang.String |
toString()
Return the buffer list as a string
|
public ByteBufferList(int bufSize, int initAlloc, int maxAlloc)
bufSize
- intinitAlloc
- intmaxAlloc
- public 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)
long
- waitTimepublic final void releaseBuffer(byte[] buf)
buf
- byte[]public final int shrinkList()
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.