1 24 package org.riotfamily.cachius.support; 25 26 import java.io.PrintWriter ; 27 import java.io.Writer ; 28 29 34 public class MultiplexPrintWriter extends PrintWriter { 35 36 private PrintWriter printWriter = null; 37 38 44 public MultiplexPrintWriter(Writer writer, PrintWriter printWriter) { 45 super(writer); 46 this.printWriter = printWriter; 47 } 48 49 52 public void write(int ch) { 53 super.write(ch); 54 printWriter.write(ch); 55 } 56 57 60 public void write(char[] charArray, int offset, int count) { 61 super.write(charArray, offset, count); 62 printWriter.write(charArray, offset, count); 63 } 64 65 68 public void write(String str, int offset, int count) { 69 super.write(str, offset, count); 70 printWriter.write(str, offset, count); 71 } 72 73 76 public void flush() { 77 super.flush(); 78 printWriter.flush(); 79 } 80 81 84 public void close() { 85 super.close(); 86 printWriter.close(); 87 } 88 89 } 90 | Popular Tags |