@Test public void testWrite() throws Exception { OutputStream os = new FilterPrintStream(System.out); os.write('A'); os.write('B'); os.write("€".getBytes() ); os.flush(); }
@Override public void write(int data) { if (filter(data)) { ps.write(data); } }
FilterPrintStream extends PrintStream { @Override public void write(int data) { if (filter(data)) { ps.write(data); } } }
FilterPrintStream extends PrintStream { @Override public void write(int data) { if (filter(data)) { ps.write(data); } } FilterPrintStream(PrintStream ps); }
FilterPrintStream extends PrintStream { @Override public void write(int data) { if (filter(data)) { ps.write(data); } } FilterPrintStream(PrintStream ps); @Override void write(int data); @Override void write(byte[] buf, int off, int len); @Override boolean checkError(); @Override void close(); @Override void flush(); @Override void print(boolean b); @Override void print(char c); @Override void print(int i); @Override void print(long l); @Override void print(float f); @Override void print(double d); @Override void print(char s[]); @Override void print(String s); @Override void print(Object obj); @Override void println(); @Override void println(boolean x); @Override void println(char x); @Override void println(int x); @Override void println(long x); @Override void println(float x); @Override void println(double x); @Override void println(char x[]); @Override void println(String x); @Override void println(Object x); }
FilterPrintStream extends PrintStream { @Override public void write(int data) { if (filter(data)) { ps.write(data); } } FilterPrintStream(PrintStream ps); @Override void write(int data); @Override void write(byte[] buf, int off, int len); @Override boolean checkError(); @Override void close(); @Override void flush(); @Override void print(boolean b); @Override void print(char c); @Override void print(int i); @Override void print(long l); @Override void print(float f); @Override void print(double d); @Override void print(char s[]); @Override void print(String s); @Override void print(Object obj); @Override void println(); @Override void println(boolean x); @Override void println(char x); @Override void println(int x); @Override void println(long x); @Override void println(float x); @Override void println(double x); @Override void println(char x[]); @Override void println(String x); @Override void println(Object x);  }