|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.OutputStream
com.caucho.vfs.OutputStreamWithBuffer
com.caucho.server.connection.AbstractResponseStream
com.caucho.server.connection.ToByteResponseStream
public abstract class ToByteResponseStream
Handles the dual char/byte buffering for the response stream.
| Field Summary | |
|---|---|
protected boolean |
_isFinished
|
protected static int |
SIZE
|
| Constructor Summary | |
|---|---|
protected |
ToByteResponseStream()
|
| Method Summary | |
|---|---|
void |
clearBuffer()
Clears the response buffer. |
void |
clearClose()
Clears the close. |
void |
close()
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 remaining value left. |
int |
getBufferOffset()
Returns the byte offset. |
int |
getBufferSize()
Returns the buffer capacity. |
char[] |
getCharBuffer()
Returns the char buffer. |
int |
getCharOffset()
Returns the char offset. |
int |
getRemaining()
Returns the remaining value left. |
boolean |
isCauchoResponseStream()
Returns true for a caucho response stream. |
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. |
void |
setHead()
Sets the head. |
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 character to the output. |
protected abstract void |
writeNext(byte[] buffer,
int offset,
int length,
boolean isEnd)
Writes the chunk to the downward stream. |
| Methods inherited from class com.caucho.server.connection.AbstractResponseStream |
|---|
clear, clearClosed, finish, flushByte, flushChar, getContentLength, isAutoFlush, isCommitted, isHead, sendFile, setAutoFlush, setByteCacheStream, setCharCacheStream |
| Methods inherited from class java.io.OutputStream |
|---|
write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final int SIZE
protected boolean _isFinished
| Constructor Detail |
|---|
protected ToByteResponseStream()
| Method Detail |
|---|
public void start()
start in class AbstractResponseStreampublic boolean isCauchoResponseStream()
isCauchoResponseStream in class AbstractResponseStreampublic void setOutputStreamOnly(boolean isOutputStreamOnly)
AbstractResponseStream
setOutputStreamOnly in class AbstractResponseStreampublic void setHead()
setHead in class AbstractResponseStream
public void setEncoding(java.lang.String encoding)
throws java.io.UnsupportedEncodingException
setEncoding in class AbstractResponseStreamjava.io.UnsupportedEncodingException
public void setLocale(java.util.Locale locale)
throws java.io.UnsupportedEncodingException
setLocale in class AbstractResponseStreamjava.io.UnsupportedEncodingExceptionpublic final char[] getCharBuffer()
getCharBuffer in class AbstractResponseStream
public int getCharOffset()
throws java.io.IOException
getCharOffset in class AbstractResponseStreamjava.io.IOException
public void setCharOffset(int offset)
throws java.io.IOException
setCharOffset in class AbstractResponseStreamjava.io.IOException
public byte[] getBuffer()
throws java.io.IOException
getBuffer in class OutputStreamWithBufferjava.io.IOException
public int getBufferOffset()
throws java.io.IOException
getBufferOffset in class OutputStreamWithBufferjava.io.IOException
public 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()
public void clearBuffer()
clearBuffer in class AbstractResponseStream
public void write(int ch)
throws java.io.IOException
write in class AbstractResponseStreamjava.io.IOException
public void write(byte[] buffer,
int offset,
int length)
throws java.io.IOException
write in class AbstractResponseStreamjava.io.IOException
public void print(int ch)
throws java.io.IOException
print in class AbstractResponseStreamjava.io.IOException
public void print(char[] buffer,
int offset,
int length)
throws java.io.IOException
print in class AbstractResponseStreamjava.io.IOException
public void flushBuffer()
throws java.io.IOException
flushBuffer in class AbstractResponseStreamjava.io.IOException
public void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class AbstractResponseStreamjava.io.IOException
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in class AbstractResponseStreamjava.io.IOException
public char[] nextCharBuffer(int offset)
throws java.io.IOException
nextCharBuffer in class AbstractResponseStreamjava.io.IOException
protected void flushCharBuffer()
throws java.io.IOException
java.io.IOException
public byte[] nextBuffer(int offset)
throws java.io.IOException
nextBuffer in class OutputStreamWithBufferjava.io.IOException
protected void flushByteBuffer()
throws java.io.IOException
java.io.IOException
protected abstract void writeNext(byte[] buffer,
int offset,
int length,
boolean isEnd)
throws java.io.IOException
java.io.IOExceptionpublic void clearClose()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||