com.caucho.server.connection
Class IncludeResponseStream

java.lang.Object
  extended by java.io.OutputStream
      extended by com.caucho.vfs.OutputStreamWithBuffer
          extended by com.caucho.server.connection.AbstractResponseStream
              extended by com.caucho.server.connection.ToByteResponseStream
                  extended by com.caucho.server.connection.IncludeResponseStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

public class IncludeResponseStream
extends ToByteResponseStream


Field Summary
 
Fields inherited from class com.caucho.server.connection.ToByteResponseStream
_isFinished, SIZE
 
Constructor Summary
IncludeResponseStream(AbstractHttpResponse response)
           
 
Method Summary
 void close()
          Close.
 void finish()
          Finish.
 void flushByte()
          flushing
 void flushChar()
          flushing
protected  void flushCharBuffer()
          Converts the char buffer.
 void init(ServletResponse next)
           
 boolean isCauchoResponseStream()
          Returns true for a caucho response stream.
 void setBufferOffset(int offset)
          Sets the byte buffer offset.
 void setByteCacheStream(java.io.OutputStream cacheStream)
          Sets any cache stream.
 void setCauchoResponseStream(boolean isCaucho)
          Set true for a caucho response stream.
 void setCharCacheStream(java.io.Writer cacheWriter)
          Sets any cache stream.
 void start()
          Initializes the Buffered Response stream at the beginning of a request.
 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.
protected  void writeNext(byte[] buf, int offset, int length, boolean isEnd)
          Writes the next chunk of data to the response stream.
 
Methods inherited from class com.caucho.server.connection.ToByteResponseStream
clearBuffer, clearClose, flush, flushBuffer, flushByteBuffer, getBuffer, getBufferLength, getBufferOffset, getBufferSize, getCharBuffer, getCharOffset, getRemaining, nextBuffer, nextCharBuffer, print, print, setBufferSize, setCharOffset, setEncoding, setHead, setLocale, setOutputStreamOnly
 
Methods inherited from class com.caucho.server.connection.AbstractResponseStream
clear, clearClosed, getContentLength, isAutoFlush, isCommitted, isHead, sendFile, setAutoFlush
 
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
 

Constructor Detail

IncludeResponseStream

public IncludeResponseStream(AbstractHttpResponse response)
Method Detail

init

public void init(ServletResponse next)

start

public void start()
Description copied from class: ToByteResponseStream
Initializes the Buffered Response stream at the beginning of a request.

Overrides:
start in class ToByteResponseStream

isCauchoResponseStream

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

Overrides:
isCauchoResponseStream in class ToByteResponseStream

setCauchoResponseStream

public void setCauchoResponseStream(boolean isCaucho)
Set true for a caucho response stream.


setByteCacheStream

public void setByteCacheStream(java.io.OutputStream cacheStream)
Sets any cache stream.

Overrides:
setByteCacheStream in class AbstractResponseStream

setCharCacheStream

public void setCharCacheStream(java.io.Writer cacheWriter)
Sets any cache stream.

Overrides:
setCharCacheStream in class AbstractResponseStream

flushCharBuffer

protected void flushCharBuffer()
                        throws java.io.IOException
Converts the char buffer.

Overrides:
flushCharBuffer in class ToByteResponseStream
Throws:
java.io.IOException

setBufferOffset

public void setBufferOffset(int offset)
                     throws java.io.IOException
Sets the byte buffer offset.

Overrides:
setBufferOffset in class ToByteResponseStream
Throws:
java.io.IOException

write

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

Overrides:
write in class ToByteResponseStream
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(byte[] buf,
                  int offset,
                  int length)
           throws java.io.IOException
Writes the next chunk of data to the response stream.

Overrides:
write in class ToByteResponseStream
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

writeNext

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

Specified by:
writeNext in class ToByteResponseStream
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

flushByte

public void flushByte()
               throws java.io.IOException
flushing

Overrides:
flushByte in class AbstractResponseStream
Throws:
java.io.IOException

flushChar

public void flushChar()
               throws java.io.IOException
flushing

Overrides:
flushChar in class AbstractResponseStream
Throws:
java.io.IOException

finish

public void finish()
            throws java.io.IOException
Finish.

Overrides:
finish in class AbstractResponseStream
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Close.

Specified by:
close in interface java.io.Closeable
Overrides:
close in class ToByteResponseStream
Throws:
java.io.IOException