|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.OutputStream
com.caucho.vfs.OutputStreamWithBuffer
com.caucho.server.http.AbstractResponseStream
com.caucho.server.http.ToByteResponseStream
com.caucho.server.http.ResponseStream
public abstract class ResponseStream
| Field Summary |
|---|
| Fields inherited from class com.caucho.server.http.ToByteResponseStream |
|---|
SIZE |
| Constructor Summary | |
|---|---|
|
ResponseStream()
|
protected |
ResponseStream(AbstractHttpResponse response)
|
| Method Summary | |
|---|---|
boolean |
canWrite()
Response stream is a writable stream. |
void |
clear()
Clears the output buffer, including headers if possible. |
void |
clearBuffer()
Clears the response buffer. |
void |
clearClosed()
Clear the closed state, because of the NOT_MODIFIED |
protected void |
clearNext()
|
protected void |
closeImpl()
Complete the request. |
protected void |
closeNext()
|
protected abstract void |
closeNextImpl()
|
void |
completeCache()
|
protected java.lang.String |
dbgId()
|
void |
flush()
Flushes the buffered response to the output stream. |
void |
flushByte()
Flushes the buffered response to the output stream. |
void |
flushChar()
Flushes the buffered response to the writer. |
void |
flushNext()
Flushes the next buffer, leaving the current buffer alone |
protected abstract void |
flushNextImpl()
|
byte[] |
getBuffer()
Returns the byte buffer. |
int |
getBufferOffset()
Returns the byte offset. |
protected java.io.OutputStream |
getByteCacheStream()
Sets a byte cache stream. |
CauchoResponse |
getCauchoResponse()
|
int |
getContentLength()
Returns the written content length |
protected abstract byte[] |
getNextBuffer()
|
protected abstract int |
getNextBufferOffset()
|
protected int |
getNextStartOffset()
|
protected AbstractHttpResponse |
getResponse()
|
boolean |
hasData()
|
boolean |
isCauchoResponseStream()
Returns true for a Caucho response stream. |
boolean |
isCloseComplete()
Test if the request is closing. |
boolean |
isCommitted()
Test if data has been flushed to the client. |
protected boolean |
isDisableAutoFlush()
|
protected boolean |
isNextValid()
|
void |
killCaching()
|
byte[] |
nextBuffer(int offset)
Sets the next buffer |
void |
setAutoFlush(boolean isAutoFlush)
Sets the auto-flush |
void |
setBufferOffset(int offset)
Sets the byte offset. |
void |
setBufferSize(int size)
Sets the buffer capacity. |
void |
setByteCacheStream(java.io.OutputStream cacheStream)
Sets the underlying cache stream for a cached request. |
protected boolean |
setFlush(boolean flush)
|
protected void |
setNextBufferOffset(int offset)
|
protected abstract void |
setNextBufferOffsetImpl(int offset)
|
void |
setProxyCacheResponse(CauchoResponse response)
|
void |
setResponse(AbstractHttpResponse response)
|
void |
start()
initializes the Response stream at the beginning of a request. |
protected void |
startCaching(boolean isByte)
Called to start caching. |
java.lang.String |
toString()
|
void |
write(int ch)
Writes a byte to the output. |
protected void |
writeHeaders(int length)
Writes any http headers. |
protected void |
writeNext(byte[] buf,
int offset,
int length,
boolean isFinished)
Writes the next chunk of data to the response stream. |
protected byte[] |
writeNextBuffer(int offset)
|
protected abstract byte[] |
writeNextBufferImpl(int offset)
|
protected void |
writeTail(boolean isClose)
|
protected void |
writeTailImpl(boolean isClosed)
|
| 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, isClosed, 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 |
| Constructor Detail |
|---|
public ResponseStream()
protected ResponseStream(AbstractHttpResponse response)
| Method Detail |
|---|
public void setResponse(AbstractHttpResponse response)
protected AbstractHttpResponse getResponse()
public void setProxyCacheResponse(CauchoResponse response)
public CauchoResponse getCauchoResponse()
public void start()
start in class ToByteResponseStreampublic boolean isCauchoResponseStream()
isCauchoResponseStream in class ToByteResponseStreampublic void setByteCacheStream(java.io.OutputStream cacheStream)
setByteCacheStream in class AbstractResponseStreamcacheStream - the cache stream.protected java.io.OutputStream getByteCacheStream()
AbstractResponseStream
getByteCacheStream in class AbstractResponseStreampublic boolean canWrite()
protected boolean setFlush(boolean flush)
setFlush in class ToByteResponseStreampublic void setAutoFlush(boolean isAutoFlush)
AbstractResponseStream
setAutoFlush in class AbstractResponseStreamprotected boolean isDisableAutoFlush()
isDisableAutoFlush in class ToByteResponseStreampublic final int getContentLength()
AbstractResponseStream
getContentLength in class ToByteResponseStreampublic void setBufferSize(int size)
ToByteResponseStream
setBufferSize in class ToByteResponseStreampublic boolean hasData()
public boolean isCommitted()
AbstractResponseStream
isCommitted in class AbstractResponseStream
public void clear()
throws java.io.IOException
AbstractResponseStream
clear in class AbstractResponseStreamjava.io.IOExceptionpublic void clearBuffer()
ToByteResponseStream
clearBuffer in class ToByteResponseStreampublic boolean isCloseComplete()
AbstractResponseStream
isCloseComplete in class AbstractResponseStreampublic void clearClosed()
protected void writeHeaders(int length)
throws java.io.IOException
ToByteResponseStream
writeHeaders in class ToByteResponseStreamlength - the current buffer length
java.io.IOException
public final void write(int ch)
throws java.io.IOException
ToByteResponseStream
write in interface ByteAppendablewrite in class ToByteResponseStreamjava.io.IOException
public final byte[] getBuffer()
throws java.io.IOException
getBuffer in class ToByteResponseStreamjava.io.IOException
public final int getBufferOffset()
throws java.io.IOException
getBufferOffset in class ToByteResponseStreamjava.io.IOException
public final void setBufferOffset(int offset)
throws java.io.IOException
setBufferOffset in class ToByteResponseStreamjava.io.IOException
public final byte[] nextBuffer(int offset)
throws java.io.IOException
nextBuffer in class ToByteResponseStreamjava.io.IOException
protected final void writeNext(byte[] buf,
int offset,
int length,
boolean isFinished)
throws java.io.IOException
writeNext in class ToByteResponseStreambuf - the buffer containing the dataoffset - start offset into the bufferlength - length of the data in the buffer
java.io.IOException
public final void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class ToByteResponseStreamjava.io.IOException
public void flushByte()
throws java.io.IOException
flushByte in class AbstractResponseStreamjava.io.IOException
public void flushChar()
throws java.io.IOException
flushChar in class AbstractResponseStreamjava.io.IOException
protected void closeImpl()
throws java.io.IOException
closeImpl in class ToByteResponseStreamjava.io.IOExceptionprotected void startCaching(boolean isByte)
public void killCaching()
killCaching in class AbstractResponseStreampublic void completeCache()
completeCache in class AbstractResponseStreamprotected final boolean isNextValid()
protected void clearNext()
protected abstract byte[] getNextBuffer()
protected int getNextStartOffset()
protected abstract int getNextBufferOffset()
throws java.io.IOException
java.io.IOException
protected final void setNextBufferOffset(int offset)
throws java.io.IOException
java.io.IOException
protected abstract void setNextBufferOffsetImpl(int offset)
throws java.io.IOException
java.io.IOException
protected final byte[] writeNextBuffer(int offset)
throws java.io.IOException
java.io.IOException
protected abstract byte[] writeNextBufferImpl(int offset)
throws java.io.IOException
java.io.IOException
public final void flushNext()
throws java.io.IOException
AbstractResponseStream
flushNext in class AbstractResponseStreamjava.io.IOException
protected abstract void flushNextImpl()
throws java.io.IOException
java.io.IOException
protected final void closeNext()
throws java.io.IOException
java.io.IOException
protected abstract void closeNextImpl()
throws java.io.IOException
java.io.IOException
protected final void writeTail(boolean isClose)
throws java.io.IOException
java.io.IOException
protected void writeTailImpl(boolean isClosed)
throws java.io.IOException
java.io.IOExceptionprotected java.lang.String dbgId()
public java.lang.String toString()
toString in class AbstractResponseStream
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||