public abstract class ToByteResponseStream extends AbstractResponseStream
| Modifier and Type | Field and Description |
|---|---|
protected static int |
SIZE |
| Modifier | Constructor and Description |
|---|---|
protected |
ToByteResponseStream() |
| Modifier and Type | Method and Description |
|---|---|
void |
clearBuffer()
Clears the response buffer.
|
protected void |
closeImpl()
Closes the response stream.
|
void |
flush()
Flushes the buffered response to the output stream.
|
void |
flushBuffer()
Flushes the buffer.
|
protected void |
flushByteBuffer()
Flushes the buffered response to the output stream.
|
protected void |
flushCharBuffer()
Converts the char buffer.
|
byte[] |
getBuffer()
Returns the byte buffer.
|
protected int |
getBufferLength()
Returns the data in the buffer
|
int |
getBufferOffset()
Returns the byte offset.
|
int |
getBufferSize()
Returns the buffer capacity.
|
int |
getByteBufferOffset()
Returns the byte offset.
|
char[] |
getCharBuffer()
Returns the char buffer.
|
int |
getCharOffset()
Returns the char offset.
|
int |
getContentLength()
Returns the written content length
|
int |
getRemaining()
Returns the remaining value left.
|
boolean |
isCauchoResponseStream()
Returns true for a caucho response stream.
|
protected boolean |
isCharFlushing()
True while the char buffer is being flushed, needed
for content-length vs chunked headers.
|
protected boolean |
isDisableAutoFlush() |
byte[] |
nextBuffer(int offset)
Returns the next byte buffer.
|
char[] |
nextCharBuffer(int offset)
Converts the char buffer.
|
void |
print(char[] buffer,
int offset,
int length)
Writes a char array to the output.
|
void |
print(int ch)
Writes a character to the output.
|
void |
setBufferOffset(int offset)
Sets the byte offset.
|
void |
setBufferSize(int size)
Sets the buffer capacity.
|
void |
setCharOffset(int offset)
Sets the char offset.
|
void |
setEncoding(java.lang.String encoding)
Sets the encoding.
|
protected boolean |
setFlush(boolean isAllowFlush) |
void |
setLocale(java.util.Locale locale)
Sets the locale.
|
void |
setOutputStreamOnly(boolean isOutputStreamOnly)
Set true for output stream only request.
|
void |
start()
Initializes the Buffered Response stream at the beginning of a request.
|
void |
write(byte[] buffer,
int offset,
int length)
Writes a chunk of bytes to the stream.
|
void |
write(int ch)
Writes a byte to the output.
|
protected void |
writeHeaders(int length)
Writes any http headers.
|
protected abstract void |
writeNext(byte[] buffer,
int offset,
int length,
boolean isEnd)
Writes the chunk to the downward stream.
|
clear, close, completeCache, flushByte, flushChar, flushNext, getByteCacheStream, getCharCacheStream, getEncoding, isAutoFlush, isCloseComplete, isClosed, isClosing, isCommitted, isHead, killCaching, sendFile, setAutoFlush, setByteCacheStream, setCauchoResponse, setCharCacheStream, setCommitted, setHead, toClosing, toStringpublic void start()
start in class AbstractResponseStreampublic boolean isCauchoResponseStream()
isCauchoResponseStream in class AbstractResponseStreampublic void setOutputStreamOnly(boolean isOutputStreamOnly)
AbstractResponseStreamsetOutputStreamOnly in class AbstractResponseStreamprotected boolean setFlush(boolean isAllowFlush)
public void setEncoding(java.lang.String encoding)
throws java.io.UnsupportedEncodingException
setEncoding in class AbstractResponseStreamjava.io.UnsupportedEncodingExceptionpublic void setLocale(java.util.Locale locale)
throws java.io.UnsupportedEncodingException
setLocale in class AbstractResponseStreamjava.io.UnsupportedEncodingExceptionpublic final char[] getCharBuffer()
getCharBuffer in class AbstractResponseStreampublic int getCharOffset()
throws java.io.IOException
getCharOffset in class AbstractResponseStreamjava.io.IOExceptionpublic void setCharOffset(int offset)
throws java.io.IOException
setCharOffset in class AbstractResponseStreamjava.io.IOExceptionpublic byte[] getBuffer()
throws java.io.IOException
getBuffer in class OutputStreamWithBufferjava.io.IOExceptionpublic int getBufferOffset()
throws java.io.IOException
getBufferOffset in class OutputStreamWithBufferjava.io.IOExceptionpublic int getByteBufferOffset()
throws java.io.IOException
java.io.IOExceptionpublic void setBufferOffset(int offset)
throws java.io.IOException
setBufferOffset in class OutputStreamWithBufferjava.io.IOExceptionpublic int getBufferSize()
getBufferSize in class AbstractResponseStreampublic void setBufferSize(int size)
setBufferSize in class AbstractResponseStreampublic int getRemaining()
getRemaining in class AbstractResponseStreamprotected int getBufferLength()
protected boolean isDisableAutoFlush()
public void clearBuffer()
clearBuffer in class AbstractResponseStreampublic void write(int ch)
throws java.io.IOException
write in interface ByteAppendablewrite in class AbstractResponseStreamjava.io.IOExceptionpublic void write(byte[] buffer,
int offset,
int length)
throws java.io.IOException
write in interface ByteAppendablewrite in class AbstractResponseStreamjava.io.IOExceptionpublic void print(int ch)
throws java.io.IOException
print in class AbstractResponseStreamjava.io.IOExceptionpublic void print(char[] buffer,
int offset,
int length)
throws java.io.IOException
print in class AbstractResponseStreamjava.io.IOExceptionpublic char[] nextCharBuffer(int offset)
throws java.io.IOException
nextCharBuffer in class AbstractResponseStreamjava.io.IOExceptionprotected boolean isCharFlushing()
protected void flushCharBuffer()
throws java.io.IOException
java.io.IOExceptionpublic int getContentLength()
AbstractResponseStreamgetContentLength in class AbstractResponseStreampublic byte[] nextBuffer(int offset)
throws java.io.IOException
nextBuffer in class OutputStreamWithBufferjava.io.IOExceptionprotected void flushByteBuffer()
throws java.io.IOException
java.io.IOExceptionprotected void writeHeaders(int length)
throws java.io.IOException
length - the current buffer lengthjava.io.IOExceptionprotected abstract void writeNext(byte[] buffer,
int offset,
int length,
boolean isEnd)
throws java.io.IOException
java.io.IOExceptionpublic void flushBuffer()
throws java.io.IOException
flushBuffer in class AbstractResponseStreamjava.io.IOExceptionpublic void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class AbstractResponseStreamjava.io.IOExceptionprotected void closeImpl()
throws java.io.IOException
closeImpl in class AbstractResponseStreamjava.io.IOException