com.opensymphony.oscache.web.filter
public class: SplitServletOutputStream [javadoc |
source]
java.lang.Object
java.io.OutputStream
javax.servlet.ServletOutputStream
com.opensymphony.oscache.web.filter.SplitServletOutputStream
All Implemented Interfaces:
Closeable, Flushable
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: 393 $
- author:
< - a href="mailto:sergek@lokitech.com">Serge Knystautas
| Field Summary |
|---|
| OutputStream | captureStream | |
| OutputStream | passThroughStream | |
| Constructor: |
public SplitServletOutputStream(OutputStream captureStream,
OutputStream passThroughStream) {
this.captureStream = captureStream;
this.passThroughStream = 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.
|
| Methods from javax.servlet.ServletOutputStream: |
|---|
|
print, print, print, print, print, print, print, println, println, println, println, println, println, println, println |
| Method from com.opensymphony.oscache.web.filter.SplitServletOutputStream Detail: |
public void close() throws IOException {
super.close();
captureStream.close();
passThroughStream.close();
}
Closes both the output streams. |
public void flush() throws IOException {
super.flush();
captureStream.flush(); //why not?
passThroughStream.flush();
}
Flushes both the output streams. |
public void write(int value) throws IOException {
captureStream.write(value);
passThroughStream.write(value);
}
Writes the incoming data to both the output streams. |
public void write(byte[] value) throws IOException {
captureStream.write(value);
passThroughStream.write(value);
}
Writes the incoming data to both the output streams. |
public void write(byte[] b,
int off,
int len) throws IOException {
captureStream.write(b, off, len);
passThroughStream.write(b, off, len);
}
Writes the incoming data to both the output streams. |