1 package info.magnolia.cms.cache; 2 3 import java.io.IOException ; 4 import java.io.OutputStream ; 5 6 import javax.servlet.ServletOutputStream ; 7 8 9 14 public class MultiplexServletOutputStream extends ServletOutputStream { 15 16 OutputStream stream1; 17 18 OutputStream stream2; 19 20 public MultiplexServletOutputStream(OutputStream stream1, OutputStream stream2) { 21 this.stream1 = stream1; 22 this.stream2 = stream2; 23 } 24 25 public void write(int value) throws IOException { 26 stream1.write(value); 27 stream2.write(value); 28 } 29 30 public void write(byte[] value) throws IOException { 31 stream1.write(value); 32 stream2.write(value); 33 } 34 35 public void write(byte[] b, int off, int len) throws IOException { 36 stream1.write(b, off, len); 37 stream2.write(b, off, len); 38 } 39 } 40 | Popular Tags |