public class HttpResponseStream extends ResponseStream implements SendfileOutputStream
SIZE
Modifier and Type | Method and Description |
---|---|
protected void |
closeNextImpl() |
void |
flushNextImpl() |
protected byte[] |
getNextBuffer() |
protected int |
getNextBufferOffset() |
protected int |
getNextStartOffset() |
boolean |
isClosed() |
boolean |
isMmapEnabled() |
boolean |
isSendfileEnabled() |
void |
sendFile(Path path,
long offset,
long length)
Sends a file.
|
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.
|
void |
writeMmap(long mmapAddress,
long[] mmapBlocks,
long mmapOffset,
long mmapLength) |
protected byte[] |
writeNextBufferImpl(int offset) |
void |
writeSendfile(byte[] fileName,
int nameLength,
long fileLength) |
protected void |
writeTailImpl(boolean isComplete) |
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
flushBuffer, flushByteBuffer, flushCharBuffer, getBufferLength, getBufferSize, getByteBufferOffset, getCharBuffer, getCharOffset, getRemaining, isCharFlushing, nextCharBuffer, print, print, setCharOffset, setEncoding, setLocale, setOutputStreamOnly, write
close, getCharCacheStream, getEncoding, isAutoFlush, isClosing, isHead, setCauchoResponse, setCharCacheStream, setCommitted, setHead, toClosing
public boolean isClosed()
isClosed
in class AbstractResponseStream
public void start()
start
in class ResponseStream
protected void writeHeaders(int length) throws java.io.IOException
ToByteResponseStream
writeHeaders
in class ResponseStream
length
- the current buffer lengthjava.io.IOException
protected byte[] getNextBuffer()
getNextBuffer
in class ResponseStream
protected int getNextStartOffset()
getNextStartOffset
in class ResponseStream
protected int getNextBufferOffset() throws java.io.IOException
getNextBufferOffset
in class ResponseStream
java.io.IOException
protected void setNextBufferOffsetImpl(int offset)
setNextBufferOffsetImpl
in class ResponseStream
protected byte[] writeNextBufferImpl(int offset) throws java.io.IOException
writeNextBufferImpl
in class ResponseStream
java.io.IOException
public void flushNextImpl() throws java.io.IOException
flushNextImpl
in class ResponseStream
java.io.IOException
protected void closeNextImpl() throws java.io.IOException
closeNextImpl
in class ResponseStream
java.io.IOException
protected void writeTailImpl(boolean isComplete) throws java.io.IOException
writeTailImpl
in class ResponseStream
java.io.IOException
public boolean isMmapEnabled()
isMmapEnabled
in interface SendfileOutputStream
public boolean isSendfileEnabled()
isSendfileEnabled
in interface SendfileOutputStream
public void sendFile(Path path, long offset, long length) throws java.io.IOException
sendFile
in class AbstractResponseStream
path
- the path to the filelength
- the length of the file (-1 if unknown)java.io.IOException
public void writeMmap(long mmapAddress, long[] mmapBlocks, long mmapOffset, long mmapLength) throws java.io.IOException
writeMmap
in interface SendfileOutputStream
java.io.IOException
public void writeSendfile(byte[] fileName, int nameLength, long fileLength) throws java.io.IOException
writeSendfile
in interface SendfileOutputStream
java.io.IOException