public class PrintStreamBuffer
extends java.lang.Object
System.out
System.err
and System.in
with Appendable respectively CharSequence for in. It is especially for test.
PrintStreamBuffer.InStream
and PrintStreamBuffer.OutStream
are the links between InputStream and CharSequence
respectively PrintStream and Appendable, which are not contained in the Java core capabilities.Modifier and Type | Class and Description |
---|---|
static class |
PrintStreamBuffer.InStream |
static class |
PrintStreamBuffer.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 |
---|---|
static java.lang.String |
version
Version, history and license.
|
Constructor and Description |
---|
PrintStreamBuffer() |
Modifier and Type | Method and Description |
---|---|
static java.io.PrintStream |
replaceSystemErr(java.lang.Appendable buffer)
Replaces the System.err for the whole JVM
|
static java.io.PrintStream |
replaceSystemErr(java.lang.Appendable buffer,
java.lang.Appendable buffer2)
Replaces the System.err for the whole JVM
|
static java.io.InputStream |
replaceSystemIn(java.lang.CharSequence buffer)
Replaces the System.in for the whole JVM
|
static java.io.PrintStream |
replaceSystemOut(java.lang.Appendable buffer)
Replaces the System.out for the whole JVM
|
public static final java.lang.String version
public static java.io.PrintStream replaceSystemOut(java.lang.Appendable buffer)
buffer
- with this Appendable, usual a StringBuilderpublic static java.io.PrintStream replaceSystemErr(java.lang.Appendable buffer)
buffer
- with this Appendable, usual a StringBuilderpublic static java.io.PrintStream replaceSystemErr(java.lang.Appendable buffer, java.lang.Appendable buffer2)
buffer
- with this Appendable, usual a StringBuilderpublic static java.io.InputStream replaceSystemIn(java.lang.CharSequence buffer)
buffer
- with this CharSequence, usual a String or a StringBuilder