1 16 package org.apache.commons.io.output; 17 18 import java.io.IOException ; 19 import java.io.OutputStream ; 20 21 29 public class TeeOutputStream extends ProxyOutputStream { 30 31 32 protected OutputStream branch; 33 34 39 public TeeOutputStream( OutputStream out, OutputStream branch ) { 40 super(out); 41 this.branch = branch; 42 } 43 44 45 public synchronized void write(byte[] b) throws IOException { 46 super.write(b); 47 this.branch.write(b); 48 } 49 50 51 public synchronized void write(byte[] b, int off, int len) throws IOException { 52 super.write(b, off, len); 53 this.branch.write(b, off, len); 54 } 55 56 57 public synchronized void write(int b) throws IOException { 58 super.write(b); 59 this.branch.write(b); 60 } 61 62 67 public void flush() throws IOException { 68 super.flush(); 69 this.branch.flush(); 70 } 71 72 77 public void close() throws IOException { 78 super.close(); 79 this.branch.close(); 80 } 81 82 } 83 | Popular Tags |