com.caucho.vfs
Class TempBuffer
java.lang.Object
|
+--com.caucho.vfs.TempBuffer
- public class TempBuffer
- extends java.lang.Object
Field Summary |
static int |
SIZE
|
Constructor Summary |
TempBuffer(int size)
Create a new TempBuffer. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SIZE
public static int SIZE
TempBuffer
public TempBuffer(int size)
- Create a new TempBuffer.
allocate
public static TempBuffer allocate()
- Allocate a TempBuffer, reusing one if available.
clear
public void clear()
- Clears the buffer.
getBuffer
public byte[] getBuffer()
- Returns the buffer's underlying byte array.
getLength
public int getLength()
- Returns the number of bytes in the buffer.
setLength
public void setLength(int length)
getCapacity
public int getCapacity()
write
public int write(byte[] buf,
int offset,
int length)
copyFromStream
public static TempBuffer copyFromStream(ReadStream is)
throws java.io.IOException
getAvailable
public int getAvailable()
getNext
public TempBuffer getNext()
setNext
public void setNext(TempBuffer next)
free
public static void free(TempBuffer buf)
- Frees a single buffer.
freeAll
public static void freeAll(TempBuffer buf)