com.caucho.server.http
Class HttpResponseStream

java.lang.Object
  extended by java.io.OutputStream
      extended by com.caucho.vfs.OutputStreamWithBuffer
          extended by com.caucho.server.http.AbstractResponseStream
              extended by com.caucho.server.http.ToByteResponseStream
                  extended by com.caucho.server.http.ResponseStream
                      extended by com.caucho.server.http.HttpResponseStream
All Implemented Interfaces:
ByteAppendable, java.io.Closeable, java.io.Flushable

public class HttpResponseStream
extends ResponseStream


Field Summary
 
Fields inherited from class com.caucho.server.http.ToByteResponseStream
SIZE
 
Method Summary
protected  void closeNextImpl()
           
 void flushNextImpl()
           
protected  byte[] getNextBuffer()
           
protected  int getNextBufferOffset()
           
protected  int getNextStartOffset()
           
 boolean isClosed()
           
protected  void setNextBufferOffsetImpl(int offset)
           
 void start()
          initializes the Response stream at the beginning of a request.
protected  void writeHeaders(int length)
          Writes any http headers.
protected  byte[] writeNextBufferImpl(int offset)
           
protected  void writeTailImpl(boolean isClose)
           
 
Methods inherited from class com.caucho.server.http.ResponseStream
canWrite, clear, clearBuffer, clearClosed, clearNext, closeImpl, closeNext, completeCache, dbgId, flush, flushByte, flushChar, flushNext, getBuffer, getBufferOffset, getByteCacheStream, getCauchoResponse, getContentLength, getResponse, hasData, isCauchoResponseStream, isCloseComplete, isCommitted, isDisableAutoFlush, isNextValid, killCaching, nextBuffer, setAutoFlush, setBufferOffset, setBufferSize, setByteCacheStream, setFlush, setNextBufferOffset, setProxyCacheResponse, setResponse, startCaching, toString, write, writeNext, writeNextBuffer, writeTail
 
Methods inherited from class com.caucho.server.http.ToByteResponseStream
flushBuffer, flushByteBuffer, flushCharBuffer, getBufferLength, getBufferSize, getByteBufferOffset, getCharBuffer, getCharOffset, getRemaining, isCharFlushing, nextCharBuffer, print, print, setCharOffset, setEncoding, setLocale, setOutputStreamOnly, write
 
Methods inherited from class com.caucho.server.http.AbstractResponseStream
close, getCharCacheStream, getEncoding, isAutoFlush, isClosing, isHead, sendFile, setCauchoResponse, setCharCacheStream, setCommitted, setHead, toClosing
 
Methods inherited from class java.io.OutputStream
write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

isClosed

public boolean isClosed()
Overrides:
isClosed in class AbstractResponseStream

start

public void start()
initializes the Response stream at the beginning of a request.

Overrides:
start in class ResponseStream

writeHeaders

protected void writeHeaders(int length)
                     throws java.io.IOException
Description copied from class: ToByteResponseStream
Writes any http headers. Because this may be called multiple times, the implementation needs to ensure the header is written once

Overrides:
writeHeaders in class ResponseStream
Parameters:
length - the current buffer length
Throws:
java.io.IOException

getNextBuffer

protected byte[] getNextBuffer()
Specified by:
getNextBuffer in class ResponseStream

getNextStartOffset

protected int getNextStartOffset()
Overrides:
getNextStartOffset in class ResponseStream

getNextBufferOffset

protected int getNextBufferOffset()
                           throws java.io.IOException
Specified by:
getNextBufferOffset in class ResponseStream
Throws:
java.io.IOException

setNextBufferOffsetImpl

protected void setNextBufferOffsetImpl(int offset)
Specified by:
setNextBufferOffsetImpl in class ResponseStream

writeNextBufferImpl

protected byte[] writeNextBufferImpl(int offset)
                              throws java.io.IOException
Specified by:
writeNextBufferImpl in class ResponseStream
Throws:
java.io.IOException

flushNextImpl

public void flushNextImpl()
                   throws java.io.IOException
Specified by:
flushNextImpl in class ResponseStream
Throws:
java.io.IOException

closeNextImpl

protected void closeNextImpl()
                      throws java.io.IOException
Specified by:
closeNextImpl in class ResponseStream
Throws:
java.io.IOException

writeTailImpl

protected void writeTailImpl(boolean isClose)
                      throws java.io.IOException
Overrides:
writeTailImpl in class ResponseStream
Throws:
java.io.IOException