|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.caucho.vfs.TempBuffer
public class TempBuffer
Pooled temporary byte buffer.
Field Summary | |
---|---|
static int |
LARGE_SIZE
|
static int |
SIZE
|
static int |
SMALL_SIZE
|
Constructor Summary | |
---|---|
TempBuffer(int size)
Create a new TempBuffer. |
Method Summary | |
---|---|
static TempBuffer |
allocate()
Allocate a TempBuffer, reusing one if available. |
static TempBuffer |
allocateLarge()
Allocate a TempBuffer, reusing one if available. |
static TempBuffer |
allocateSmall()
Allocate a TempBuffer, reusing one if available. |
void |
clear()
Clears the buffer. |
static void |
clearFreeLists()
Called on OOM to free buffers. |
static void |
free(TempBuffer buf)
Frees a single buffer. |
static void |
freeAll(TempBuffer buf)
|
static void |
freeAllLarge(TempBuffer buf)
|
static void |
freeAllSmall(TempBuffer buf)
|
static void |
freeLarge(TempBuffer buf)
Frees a single buffer. |
void |
freeSelf()
|
static void |
freeSmall(TempBuffer buf)
Frees a single buffer. |
int |
getAvailable()
|
byte[] |
getBuffer()
Returns the buffer's underlying byte array. |
int |
getCapacity()
|
int |
getLength()
Returns the number of bytes in the buffer. |
TempBuffer |
getNext()
|
static boolean |
isSmallmem()
Returns true for a smallmem configuration |
void |
setLength(int length)
Sets the number of bytes used in the buffer. |
void |
setNext(TempBuffer next)
|
int |
write(byte[] buf,
int offset,
int length)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int SMALL_SIZE
public static final int LARGE_SIZE
public static final int SIZE
Constructor Detail |
---|
public TempBuffer(int size)
Method Detail |
---|
public static boolean isSmallmem()
public static TempBuffer allocate()
public static TempBuffer allocateSmall()
public static TempBuffer allocateLarge()
public void clear()
public final byte[] getBuffer()
public final int getLength()
public final void setLength(int length)
public final int getCapacity()
public int getAvailable()
public final TempBuffer getNext()
public final void setNext(TempBuffer next)
public int write(byte[] buf, int offset, int length)
public void freeSelf()
public static void free(TempBuffer buf)
public static void freeAll(TempBuffer buf)
public static void freeSmall(TempBuffer buf)
public static void freeAllSmall(TempBuffer buf)
public static void freeLarge(TempBuffer buf)
public static void freeAllLarge(TempBuffer buf)
public static void clearFreeLists()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |