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.
 
Method Summary
static TempBuffer allocate()
          Allocate a TempBuffer, reusing one if available.
 void clear()
          Clears the buffer.
static TempBuffer copyFromStream(ReadStream is)
           
static void free(TempBuffer buf)
          Frees a single buffer.
static void freeAll(TempBuffer buf)
           
 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()
           
 void setLength(int length)
           
 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

SIZE

public static int SIZE
Constructor Detail

TempBuffer

public TempBuffer(int size)
Create a new TempBuffer.
Method Detail

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)