1 16 17 package org.apache.axis.utils; 18 19 import java.io.OutputStream ; 20 import java.io.IOException ; 21 22 public class TeeOutputStream extends OutputStream { 23 private OutputStream left; 24 private OutputStream right; 25 26 public TeeOutputStream(OutputStream left, OutputStream right) { 27 this.left = left; 28 this.right = right; 29 } 30 31 public void close() throws IOException { 32 left.close(); 33 right.close(); 34 } 35 36 public void flush() throws IOException { 37 left.flush(); 38 right.flush(); 39 } 40 41 public void write(byte[] b) throws IOException { 42 left.write(b); 43 right.write(b); 44 } 45 46 public void write(byte[] b, int off, int len) throws IOException { 47 left.write(b, off, len); 48 right.write(b, off, len); 49 } 50 51 public void write(int b) throws IOException { 52 left.write(b); 53 right.write(b); 54 } 55 } | Popular Tags |