com.caucho.jsp
Class BodyResponseStream

java.lang.Object
  extended by java.io.OutputStream
      extended by com.caucho.vfs.OutputStreamWithBuffer
          extended by com.caucho.server.http.AbstractResponseStream
              extended by com.caucho.jsp.BodyResponseStream
All Implemented Interfaces:
ByteAppendable, java.io.Closeable, java.io.Flushable

public class BodyResponseStream
extends AbstractResponseStream


Constructor Summary
BodyResponseStream()
           
 
Method Summary
 void clearBuffer()
          Clears the buffer.
 void flushBuffer()
          Flushes the buffer.
 byte[] getBuffer()
          Gets the byte buffer
 int getBufferOffset()
          Returns the buffer offset.
 int getBufferSize()
          Gets the buffer size.
 char[] getCharBuffer()
          Returns the char buffer.
 int getCharOffset()
          Returns the char buffer offset.
 java.lang.String getEncoding()
           
 int getRemaining()
          Returns the remaining buffer entries.
 boolean isCauchoResponseStream()
          Returns true for a caucho response stream.
 byte[] nextBuffer(int offset)
          Returns the next buffer.
 char[] nextCharBuffer(int offset)
          Returns the next char buffer.
 void print(char[] buf, int offset, int length)
          Writes the next chunk of data to the response stream.
 void print(int ch)
          Writes the next chunk of data to the response stream.
 void setBufferOffset(int offset)
          Sets the byte buffer offset.
 void setBufferSize(int size)
          Sets the buffer size.
 void setCharOffset(int offset)
          Sets the char buffer offset.
 void setEncoding(java.lang.String encoding)
          Sets the encoding.
 void setWriter(java.io.Writer out)
           
 void write(byte[] buf, int offset, int length)
          Writes the next chunk of data to the response stream.
 void write(int ch)
          Writes the next chunk of data to the response stream.
 
Methods inherited from class com.caucho.server.http.AbstractResponseStream
clear, close, closeImpl, completeCache, flush, flushByte, flushChar, flushNext, getByteCacheStream, getCharCacheStream, getContentLength, isAutoFlush, isCloseComplete, isClosed, isClosing, isCommitted, isHead, killCaching, sendFile, setAutoFlush, setByteCacheStream, setCauchoResponse, setCharCacheStream, setCommitted, setHead, setLocale, setOutputStreamOnly, start, toClosing, toString
 
Methods inherited from class java.io.OutputStream
write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BodyResponseStream

public BodyResponseStream()
Method Detail

isCauchoResponseStream

public boolean isCauchoResponseStream()
Returns true for a caucho response stream.

Specified by:
isCauchoResponseStream in class AbstractResponseStream

setWriter

public void setWriter(java.io.Writer out)

getEncoding

public java.lang.String getEncoding()
Overrides:
getEncoding in class AbstractResponseStream

setEncoding

public void setEncoding(java.lang.String encoding)
Description copied from class: AbstractResponseStream
Sets the encoding.

Overrides:
setEncoding in class AbstractResponseStream

setBufferSize

public void setBufferSize(int size)
Sets the buffer size.

Specified by:
setBufferSize in class AbstractResponseStream

getBufferSize

public int getBufferSize()
Gets the buffer size.

Specified by:
getBufferSize in class AbstractResponseStream

getRemaining

public int getRemaining()
Returns the remaining buffer entries.

Specified by:
getRemaining in class AbstractResponseStream

getCharBuffer

public char[] getCharBuffer()
Returns the char buffer.

Specified by:
getCharBuffer in class AbstractResponseStream

getCharOffset

public int getCharOffset()
Returns the char buffer offset.

Specified by:
getCharOffset in class AbstractResponseStream

setCharOffset

public void setCharOffset(int offset)
Sets the char buffer offset.

Specified by:
setCharOffset in class AbstractResponseStream

nextCharBuffer

public char[] nextCharBuffer(int offset)
                      throws java.io.IOException
Returns the next char buffer.

Specified by:
nextCharBuffer in class AbstractResponseStream
Throws:
java.io.IOException

print

public void print(char[] buf,
                  int offset,
                  int length)
           throws java.io.IOException
Writes the next chunk of data to the response stream.

Specified by:
print in class AbstractResponseStream
Parameters:
buf - the buffer containing the data
offset - start offset into the buffer
length - length of the data in the buffer
Throws:
java.io.IOException

print

public void print(int ch)
           throws java.io.IOException
Writes the next chunk of data to the response stream.

Specified by:
print in class AbstractResponseStream
Parameters:
buf - the buffer containing the data
offset - start offset into the buffer
length - length of the data in the buffer
Throws:
java.io.IOException

getBufferOffset

public int getBufferOffset()
Returns the buffer offset.

Specified by:
getBufferOffset in class OutputStreamWithBuffer

setBufferOffset

public void setBufferOffset(int offset)
Sets the byte buffer offset.

Specified by:
setBufferOffset in class OutputStreamWithBuffer

getBuffer

public byte[] getBuffer()
Gets the byte buffer

Specified by:
getBuffer in class OutputStreamWithBuffer

nextBuffer

public byte[] nextBuffer(int offset)
                  throws java.io.IOException
Returns the next buffer.

Specified by:
nextBuffer in class OutputStreamWithBuffer
Returns:
the next buffer
Throws:
java.io.IOException

write

public void write(byte[] buf,
                  int offset,
                  int length)
           throws java.io.IOException
Writes the next chunk of data to the response stream.

Specified by:
write in interface ByteAppendable
Specified by:
write in class AbstractResponseStream
Parameters:
buf - the buffer containing the data
offset - start offset into the buffer
length - length of the data in the buffer
Throws:
java.io.IOException

write

public void write(int ch)
           throws java.io.IOException
Writes the next chunk of data to the response stream.

Specified by:
write in interface ByteAppendable
Specified by:
write in class AbstractResponseStream
Parameters:
ch - - character to write
Throws:
java.io.IOException

flushBuffer

public void flushBuffer()
                 throws java.io.IOException
Flushes the buffer.

Specified by:
flushBuffer in class AbstractResponseStream
Throws:
java.io.IOException

clearBuffer

public void clearBuffer()
Clears the buffer.

Specified by:
clearBuffer in class AbstractResponseStream