com.caucho.server.webapp
Class IncludeResponseStream2

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.server.http.ToByteResponseStream
                  extended by com.caucho.server.webapp.IncludeResponseStream2
All Implemented Interfaces:
ByteAppendable, java.io.Closeable, java.io.Flushable

public class IncludeResponseStream2
extends ToByteResponseStream


Field Summary
 
Fields inherited from class com.caucho.server.http.ToByteResponseStream
SIZE
 
Method Summary
protected  void closeImpl()
          Finish.
 void completeCache()
           
 void flushByte()
          flushing
 void flushChar()
          flushing
protected  void flushCharBuffer()
          Converts the char buffer.
 java.io.Writer getCharCacheStream()
          Sets a char cache stream.
 boolean isCauchoResponseStream()
          Returns true for a caucho response stream.
 byte[] nextBuffer(int offset)
          Sets the byte buffer offset.
 void setBufferOffset(int offset)
          Sets the byte buffer offset.
 void setByteCacheStream(java.io.OutputStream cacheStream)
          Sets any cache stream.
 void setCharCacheStream(java.io.Writer cacheWriter)
          Sets any cache stream.
 void start()
          Initializes the Buffered Response stream at the beginning of a request.
protected  void startCaching(boolean isByte)
           
 void write(byte[] buf, int offset, int length)
          Writes the next chunk of data to the response stream.
 void write(int ch)
          Writes a byte
protected  void writeHeaders(int length)
          Writes any http headers.
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.http.ToByteResponseStream
clearBuffer, flush, flushBuffer, flushByteBuffer, getBuffer, getBufferLength, getBufferOffset, getBufferSize, getByteBufferOffset, getCharBuffer, getCharOffset, getContentLength, getRemaining, isCharFlushing, isDisableAutoFlush, nextCharBuffer, print, print, setBufferSize, setCharOffset, setEncoding, setFlush, setLocale, setOutputStreamOnly
 
Methods inherited from class com.caucho.server.http.AbstractResponseStream
clear, close, flushNext, getByteCacheStream, getEncoding, isAutoFlush, isCloseComplete, isClosed, isClosing, isCommitted, isHead, killCaching, sendFile, setAutoFlush, setCauchoResponse, setCommitted, setHead, 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
 

Method Detail

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

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

getCharCacheStream

public java.io.Writer getCharCacheStream()
Description copied from class: AbstractResponseStream
Sets a char cache stream.

Overrides:
getCharCacheStream 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

nextBuffer

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

Overrides:
nextBuffer in class ToByteResponseStream
Returns:
the next buffer
Throws:
java.io.IOException

write

public void write(int ch)
           throws java.io.IOException
Writes a byte

Specified by:
write in interface ByteAppendable
Overrides:
write in class ToByteResponseStream
Parameters:
ch - byte to write
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
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

writeHeaders

protected void writeHeaders(int length)
Description copied from class: ToByteResponseStream
Writes any http headers. Because this may be called multiple times, the implementation needs to ensure the header is written once

Overrides:
writeHeaders in class ToByteResponseStream
Parameters:
length - the current buffer length

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

startCaching

protected void startCaching(boolean isByte)

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

closeImpl

protected void closeImpl()
                  throws java.io.IOException
Finish.

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

completeCache

public void completeCache()
Overrides:
completeCache in class AbstractResponseStream