com.caucho.server.http
Class HttpResponseStream
java.lang.Object
java.io.OutputStream
com.caucho.vfs.OutputStreamWithBuffer
com.caucho.server.http.AbstractResponseStream
com.caucho.server.http.ToByteResponseStream
com.caucho.server.http.ResponseStream
com.caucho.server.http.HttpResponseStream
- All Implemented Interfaces:
- ByteAppendable, SendfileOutputStream, java.io.Closeable, java.io.Flushable
public class HttpResponseStream
- extends ResponseStream
- implements SendfileOutputStream
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, 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 |
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 isComplete)
throws java.io.IOException
- Overrides:
writeTailImpl
in class ResponseStream
- Throws:
java.io.IOException
isMmapEnabled
public boolean isMmapEnabled()
- Specified by:
isMmapEnabled
in interface SendfileOutputStream
isSendfileEnabled
public boolean isSendfileEnabled()
- Specified by:
isSendfileEnabled
in interface SendfileOutputStream
sendFile
public void sendFile(Path path,
long offset,
long length)
throws java.io.IOException
- Sends a file.
- Overrides:
sendFile
in class AbstractResponseStream
- Parameters:
path
- the path to the filelength
- the length of the file (-1 if unknown)
- Throws:
java.io.IOException
writeMmap
public void writeMmap(long mmapAddress,
long[] mmapBlocks,
long mmapOffset,
long mmapLength)
throws java.io.IOException
- Specified by:
writeMmap
in interface SendfileOutputStream
- Throws:
java.io.IOException
writeSendfile
public void writeSendfile(byte[] fileName,
int nameLength,
long fileLength)
throws java.io.IOException
- Specified by:
writeSendfile
in interface SendfileOutputStream
- Throws:
java.io.IOException