Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.opensymphony.oscache.web.filter
Class SplitServletOutputStream

    java.lang.Object
      java.io.OutputStream
          javax.servlet.ServletOutputStream
              com.opensymphony.oscache.web.filter.SplitServletOutputStream

public class SplitServletOutputStream
extends javax.servlet.ServletOutputStream

Extends the base `ServletOutputStream` class so that the stream can be captured as it gets written. This is achieved by overriding the `write()` methods and outputting the data to two streams - the original stream and a secondary stream that is designed to capture the written data.

Version:
  $Revision: 1.1 $
Author:
  Serge Knystautas

Constructor Summary
`SplitServletOutputStream(java.io.OutputStream captureStream, java.io.OutputStream passThroughStream)` Constructs a split output stream that both captures and passes through the servlet response.

Method Summary
`void` | `write(byte[] value)` Writes the incoming data to both the output streams.
`void` | `write(byte[] b, int off, int len)` Writes the incoming data to both the output streams.
`void` | `write(int value)` Writes the incoming data to both the output streams.

Methods inherited from class javax.servlet.ServletOutputStream
`print, print, print, print, print, print, print, println, println, println, println, println, println, println, println`

Methods inherited from class java.io.OutputStream
`close, flush`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SplitServletOutputStream

    public SplitServletOutputStream(java.io.OutputStream captureStream,
                                    java.io.OutputStream passThroughStream)

  Constructs a split output stream that both captures and passes through the servlet response.

Parameters:
  `captureStream` - The stream that will be used to capture the data.
  `passThroughStream` - The pass-through `ServletOutputStream` that will write the response to the client as originally intended.

Method Detail

### write

    public void write(int value)
               throws java.io.IOException

  Writes the incoming data to both the output streams.

  Parameters:
    `value` - The int data to write.
  Throws:
    `java.io.IOException`

### write

    public void write(byte[] value)
               throws java.io.IOException

  Writes the incoming data to both the output streams.

  Parameters:
    `value` - The bytes to write to the streams.
  Throws:
    `java.io.IOException`

### write

    public void write(byte[] b,
                      int off,
                      int len)
               throws java.io.IOException

  Writes the incoming data to both the output streams.

  Parameters:
    `b` - The bytes to write out to the streams.
    `off` - The offset into the byte data where writing should begin.
    `len` - The number of bytes to write.
  Throws:
    `java.io.IOException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| See www.opensymphony.com for more information.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD