com.caucho.vfs
Class OutputStreamWithBuffer

java.lang.Object
  extended by java.io.OutputStream
      extended by com.caucho.vfs.OutputStreamWithBuffer
All Implemented Interfaces:
ByteAppendable, java.io.Closeable, java.io.Flushable
Direct Known Subclasses:
AbstractResponseStream, WriteStream

public abstract class OutputStreamWithBuffer
extends java.io.OutputStream
implements ByteAppendable

An OutputStream with an accessible buffer.


Constructor Summary
OutputStreamWithBuffer()
           
 
Method Summary
abstract  byte[] getBuffer()
          Returns the stream's buffer.
abstract  int getBufferOffset()
          Returns the stream's buffer offset.
abstract  boolean isClosed()
           
abstract  byte[] nextBuffer(int offset)
          Returns the next buffer.
abstract  void setBufferOffset(int offset)
          Sets the stream's buffer length.
 
Methods inherited from class java.io.OutputStream
close, flush, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.caucho.util.ByteAppendable
write, write
 

Constructor Detail

OutputStreamWithBuffer

public OutputStreamWithBuffer()
Method Detail

getBuffer

public abstract byte[] getBuffer()
                          throws java.io.IOException
Returns the stream's buffer.

Throws:
java.io.IOException

getBufferOffset

public abstract int getBufferOffset()
                             throws java.io.IOException
Returns the stream's buffer offset.

Throws:
java.io.IOException

setBufferOffset

public abstract void setBufferOffset(int offset)
                              throws java.io.IOException
Sets the stream's buffer length.

Throws:
java.io.IOException

nextBuffer

public abstract byte[] nextBuffer(int offset)
                           throws java.io.IOException
Returns the next buffer.

Parameters:
length - the length of the completed buffer
Returns:
the next buffer
Throws:
java.io.IOException

isClosed

public abstract boolean isClosed()