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, toString
public void start()
start
in class AbstractResponseStream
public boolean isCauchoResponseStream()
isCauchoResponseStream
in class AbstractResponseStream
public void setOutputStreamOnly(boolean isOutputStreamOnly)
AbstractResponseStream
setOutputStreamOnly
in class AbstractResponseStream
protected boolean setFlush(boolean isAllowFlush)
public void setEncoding(java.lang.String encoding) throws java.io.UnsupportedEncodingException
setEncoding
in class AbstractResponseStream
java.io.UnsupportedEncodingException
public void setLocale(java.util.Locale locale) throws java.io.UnsupportedEncodingException
setLocale
in class AbstractResponseStream
java.io.UnsupportedEncodingException
public final char[] getCharBuffer()
getCharBuffer
in class AbstractResponseStream
public int getCharOffset() throws java.io.IOException
getCharOffset
in class AbstractResponseStream
java.io.IOException
public void setCharOffset(int offset) throws java.io.IOException
setCharOffset
in class AbstractResponseStream
java.io.IOException
public byte[] getBuffer() throws java.io.IOException
getBuffer
in class OutputStreamWithBuffer
java.io.IOException
public int getBufferOffset() throws java.io.IOException
getBufferOffset
in class OutputStreamWithBuffer
java.io.IOException
public int getByteBufferOffset() throws java.io.IOException
java.io.IOException
public void setBufferOffset(int offset) throws java.io.IOException
setBufferOffset
in class OutputStreamWithBuffer
java.io.IOException
public int getBufferSize()
getBufferSize
in class AbstractResponseStream
public void setBufferSize(int size)
setBufferSize
in class AbstractResponseStream
public int getRemaining()
getRemaining
in class AbstractResponseStream
protected int getBufferLength()
protected boolean isDisableAutoFlush()
public void clearBuffer()
clearBuffer
in class AbstractResponseStream
public void write(int ch) throws java.io.IOException
write
in interface ByteAppendable
write
in class AbstractResponseStream
java.io.IOException
public void write(byte[] buffer, int offset, int length) throws java.io.IOException
write
in interface ByteAppendable
write
in class AbstractResponseStream
java.io.IOException
public void print(int ch) throws java.io.IOException
print
in class AbstractResponseStream
java.io.IOException
public void print(char[] buffer, int offset, int length) throws java.io.IOException
print
in class AbstractResponseStream
java.io.IOException
public char[] nextCharBuffer(int offset) throws java.io.IOException
nextCharBuffer
in class AbstractResponseStream
java.io.IOException
protected boolean isCharFlushing()
protected void flushCharBuffer() throws java.io.IOException
java.io.IOException
public int getContentLength()
AbstractResponseStream
getContentLength
in class AbstractResponseStream
public byte[] nextBuffer(int offset) throws java.io.IOException
nextBuffer
in class OutputStreamWithBuffer
java.io.IOException
protected void flushByteBuffer() throws java.io.IOException
java.io.IOException
protected void writeHeaders(int length) throws java.io.IOException
length
- the current buffer lengthjava.io.IOException
protected abstract void writeNext(byte[] buffer, int offset, int length, boolean isEnd) throws java.io.IOException
java.io.IOException
public void flushBuffer() throws java.io.IOException
flushBuffer
in class AbstractResponseStream
java.io.IOException
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class AbstractResponseStream
java.io.IOException
protected void closeImpl() throws java.io.IOException
closeImpl
in class AbstractResponseStream
java.io.IOException