public class PrintStreamAdapter
extends java.io.PrintStream
System.setOut(new PrintStreamAdapter("text at line begin", myAppendable));
Modifier and Type | Class and Description |
---|---|
(package private) static class |
PrintStreamAdapter.OutStream
This class is used for all outputs to the
PrintStreamAdapter which are not
gathered by the overridden methods of PrintStream. |
Modifier and Type | Field and Description |
---|---|
(package private) java.lang.Appendable |
outAppend |
(package private) java.lang.String |
pre |
Constructor and Description |
---|
PrintStreamAdapter(java.lang.String pre,
java.lang.Appendable outAppend) |
Modifier and Type | Method and Description |
---|---|
java.io.PrintStream |
append(java.lang.CharSequence s)
This method is called if
java.io.OutputStream#append was invoked |
java.io.PrintStream |
append(java.lang.CharSequence csq,
int start,
int end) |
void |
close() |
void |
print(java.lang.String str) |
java.io.PrintStream |
printf(java.lang.String s,
java.lang.Object... args) |
void |
println(java.lang.Object o)
The println method is used usually.
|
void |
println(java.lang.String s)
The println method is used usually.
|
public PrintStreamAdapter(java.lang.String pre, java.lang.Appendable outAppend)
public void print(java.lang.String str)
print
in class java.io.PrintStream
public java.io.PrintStream append(java.lang.CharSequence csq, int start, int end)
append
in interface java.lang.Appendable
append
in class java.io.PrintStream
public java.io.PrintStream append(java.lang.CharSequence s)
java.io.OutputStream#append
was invokedappend
in interface java.lang.Appendable
append
in class java.io.PrintStream
PrintStream.print(java.lang.String)
public void println(java.lang.Object o)
println
in class java.io.PrintStream
PrintStream.println(java.lang.String)
public void println(java.lang.String s)
println
in class java.io.PrintStream
PrintStream.println(java.lang.String)
public java.io.PrintStream printf(java.lang.String s, java.lang.Object... args)
printf
in class java.io.PrintStream
public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.PrintStream