1 5 package com.opensymphony.oscache.web.filter; 6 7 import java.io.IOException ; 8 import java.io.OutputStream ; 9 10 import javax.servlet.ServletOutputStream ; 11 12 22 public class SplitServletOutputStream extends ServletOutputStream { 23 OutputStream captureStream = null; 24 OutputStream passThroughStream = null; 25 26 34 public SplitServletOutputStream(OutputStream captureStream, OutputStream passThroughStream) { 35 this.captureStream = captureStream; 36 this.passThroughStream = passThroughStream; 37 } 38 39 45 public void write(int value) throws IOException { 46 captureStream.write(value); 47 passThroughStream.write(value); 48 } 49 50 56 public void write(byte[] value) throws IOException { 57 captureStream.write(value); 58 passThroughStream.write(value); 59 } 60 61 69 public void write(byte[] b, int off, int len) throws IOException { 70 captureStream.write(b, off, len); 71 passThroughStream.write(b, off, len); 72 } 73 } 74 | Popular Tags |