public abstract class AbstractResponseStream extends OutputStreamWithBuffer
Constructor and Description |
---|
AbstractResponseStream() |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the output buffer, including headers if possible.
|
abstract void |
clearBuffer()
Clears the output buffer.
|
void |
close()
Closes the response stream
|
protected void |
closeImpl() |
void |
completeCache() |
void |
flush()
Flushes the output.
|
abstract void |
flushBuffer()
Flushes the output buffer.
|
void |
flushByte()
Flushes the output.
|
void |
flushChar()
Flushes the output.
|
void |
flushNext()
Flushes the next buffer, leaving the current buffer alone
|
abstract int |
getBufferSize()
Gets the buffer size.
|
protected java.io.OutputStream |
getByteCacheStream()
Sets a byte cache stream.
|
abstract char[] |
getCharBuffer()
Returns the char buffer.
|
protected java.io.Writer |
getCharCacheStream()
Sets a char cache stream.
|
abstract int |
getCharOffset()
Returns the char buffer offset.
|
int |
getContentLength()
Returns the written content length
|
java.lang.String |
getEncoding() |
abstract int |
getRemaining()
Returns the remaining buffer entries.
|
boolean |
isAutoFlush()
Return the auto-flush.
|
abstract boolean |
isCauchoResponseStream()
Returns true for a Caucho response stream.
|
boolean |
isCloseComplete()
Test if the request is closing.
|
boolean |
isClosed() |
boolean |
isClosing()
Test if the request is closing.
|
boolean |
isCommitted()
Test if data has been flushed to the client.
|
boolean |
isHead()
Set true for HEAD requests.
|
protected void |
killCaching() |
abstract char[] |
nextCharBuffer(int offset)
Returns the next char buffer.
|
abstract void |
print(char[] buffer,
int offset,
int length)
Writes a char array to the output.
|
abstract void |
print(int ch)
Writes a character to the output.
|
void |
sendFile(Path path,
long offset,
long length)
Sends a file.
|
void |
setAutoFlush(boolean isAutoFlush)
Sets the auto-flush
|
abstract void |
setBufferSize(int size)
Sets the buffer size.
|
void |
setByteCacheStream(java.io.OutputStream cacheStream)
Sets a byte cache stream.
|
void |
setCauchoResponse(CauchoResponse res) |
void |
setCharCacheStream(java.io.Writer cacheStream)
Sets a char cache stream.
|
abstract void |
setCharOffset(int offset)
Sets the char buffer offset.
|
void |
setCommitted()
Sets the committed state
|
void |
setEncoding(java.lang.String encoding)
Sets the encoding.
|
void |
setHead()
Set true for HEAD requests.
|
void |
setLocale(java.util.Locale locale)
Sets the locale.
|
void |
setOutputStreamOnly(boolean isOutputStreamOnly)
Set true for output stream only request.
|
void |
start()
Starts the response stream.
|
protected boolean |
toClosing() |
java.lang.String |
toString() |
abstract void |
write(byte[] buffer,
int offset,
int length)
Writes a byte array to the output.
|
abstract void |
write(int v)
Writes a byte to the output.
|
getBuffer, getBufferOffset, nextBuffer, setBufferOffset
public void setCauchoResponse(CauchoResponse res)
public void start()
public void setHead()
public final boolean isHead()
public boolean isCommitted()
public void setCommitted()
public boolean isClosing()
public boolean isCloseComplete()
public abstract boolean isCauchoResponseStream()
public java.lang.String getEncoding()
public void setEncoding(java.lang.String encoding) throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
public void setOutputStreamOnly(boolean isOutputStreamOnly)
public void setLocale(java.util.Locale locale) throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
public abstract void setBufferSize(int size)
public abstract int getBufferSize()
public void setAutoFlush(boolean isAutoFlush)
public boolean isAutoFlush()
public abstract int getRemaining()
public abstract char[] getCharBuffer() throws java.io.IOException
java.io.IOException
public abstract int getCharOffset() throws java.io.IOException
java.io.IOException
public abstract void setCharOffset(int offset) throws java.io.IOException
java.io.IOException
public abstract char[] nextCharBuffer(int offset) throws java.io.IOException
java.io.IOException
public void setByteCacheStream(java.io.OutputStream cacheStream)
protected java.io.OutputStream getByteCacheStream()
public void setCharCacheStream(java.io.Writer cacheStream)
protected java.io.Writer getCharCacheStream()
public int getContentLength()
public abstract void write(int v) throws java.io.IOException
write
in interface ByteAppendable
write
in class java.io.OutputStream
java.io.IOException
public abstract void write(byte[] buffer, int offset, int length) throws java.io.IOException
write
in interface ByteAppendable
write
in class java.io.OutputStream
java.io.IOException
public abstract void print(int ch) throws java.io.IOException
java.io.IOException
public abstract void print(char[] buffer, int offset, int length) throws java.io.IOException
java.io.IOException
public void clear() throws java.io.IOException
java.io.IOException
public abstract void clearBuffer()
public abstract void flushBuffer() throws java.io.IOException
java.io.IOException
public void flushNext() throws java.io.IOException
java.io.IOException
public void flushByte() throws java.io.IOException
java.io.IOException
public void flushChar() throws java.io.IOException
java.io.IOException
public void sendFile(Path path, long offset, long length) throws java.io.IOException
path
- the path to the filelength
- the length of the file (-1 if unknown)java.io.IOException
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
java.io.IOException
protected void killCaching()
public void completeCache()
public boolean isClosed()
isClosed
in class OutputStreamWithBuffer
public final void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.OutputStream
java.io.IOException
protected boolean toClosing()
protected void closeImpl() throws java.io.IOException
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object