Class GridTestPrintStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.FilterOutputStream
-
- java.io.PrintStream
-
- org.apache.ignite.internal.util.test.GridTestPrintStream
-
- All Implemented Interfaces:
Closeable,Flushable,Appendable,AutoCloseable
public class GridTestPrintStream extends PrintStream
Print stream that prints each thread group into a separate buffer. Use any of thepurge(...)methods to print the contents of the buffer to the parent base stream or to a stream of your choice.
-
-
Field Summary
-
Fields inherited from class java.io.FilterOutputStream
out
-
-
Constructor Summary
Constructors Constructor Description GridTestPrintStream(PrintStream out)Creates test print stream around the base stream passed in.GridTestPrintStream(PrintStream out, ThreadGroup baseGrp)Creates test print stream around the base stream passed in also specifying root thread group.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PrintStreamappend(char c)PrintStreamappend(CharSequence csq)PrintStreamappend(CharSequence csq, int start, int end)voidclose()voidflush()PrintStreamformat(String format, Object... args)PrintStreamformat(Locale l, String format, Object... args)voidprint(boolean b)voidprint(char c)voidprint(char[] s)voidprint(double d)voidprint(float f)voidprint(int i)voidprint(long l)voidprint(Object obj)voidprint(String s)PrintStreamprintf(String format, Object... args)PrintStreamprintf(Locale l, String format, Object... args)voidprintln()voidprintln(boolean x)voidprintln(char x)voidprintln(char[] x)voidprintln(double x)voidprintln(float x)voidprintln(int x)voidprintln(long x)voidprintln(Object x)voidprintln(String x)voidpurge()Purges print stream for this thread group to parent print stream.voidpurge(OutputStream out)Purges print stream for this thread group to the stream passed in.voidwrite(byte[] b)voidwrite(byte[] buf, int off, int len)voidwrite(int b)-
Methods inherited from class java.io.PrintStream
checkError, clearError, setError
-
Methods inherited from class java.io.OutputStream
nullOutputStream
-
-
-
-
Constructor Detail
-
GridTestPrintStream
public GridTestPrintStream(PrintStream out)
Creates test print stream around the base stream passed in. Root thread group is the parent of current thread group.- Parameters:
out- Base print stream.
-
GridTestPrintStream
public GridTestPrintStream(PrintStream out, ThreadGroup baseGrp)
Creates test print stream around the base stream passed in also specifying root thread group.- Parameters:
out- Base print stream.baseGrp- Thread group.
-
-
Method Detail
-
purge
public void purge() throws IOExceptionPurges print stream for this thread group to parent print stream.- Throws:
IOException- If any error happened.
-
purge
public void purge(OutputStream out) throws IOException
Purges print stream for this thread group to the stream passed in.- Parameters:
out- Stream to purge to.- Throws:
IOException- If any error happened.
-
println
public void println()
- Overrides:
printlnin classPrintStream
-
print
public void print(char c)
- Overrides:
printin classPrintStream
-
println
public void println(char x)
- Overrides:
printlnin classPrintStream
-
print
public void print(double d)
- Overrides:
printin classPrintStream
-
println
public void println(double x)
- Overrides:
printlnin classPrintStream
-
print
public void print(float f)
- Overrides:
printin classPrintStream
-
println
public void println(float x)
- Overrides:
printlnin classPrintStream
-
print
public void print(int i)
- Overrides:
printin classPrintStream
-
println
public void println(int x)
- Overrides:
printlnin classPrintStream
-
print
public void print(long l)
- Overrides:
printin classPrintStream
-
println
public void println(long x)
- Overrides:
printlnin classPrintStream
-
print
public void print(boolean b)
- Overrides:
printin classPrintStream
-
println
public void println(boolean x)
- Overrides:
printlnin classPrintStream
-
print
public void print(char[] s)
- Overrides:
printin classPrintStream
-
println
public void println(char[] x)
- Overrides:
printlnin classPrintStream
-
print
public void print(Object obj)
- Overrides:
printin classPrintStream
-
println
public void println(Object x)
- Overrides:
printlnin classPrintStream
-
print
public void print(String s)
- Overrides:
printin classPrintStream
-
println
public void println(String x)
- Overrides:
printlnin classPrintStream
-
write
public void write(byte[] buf, int off, int len)- Overrides:
writein classPrintStream
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classPrintStream
-
flush
public void flush()
- Specified by:
flushin interfaceFlushable- Overrides:
flushin classPrintStream
-
write
public void write(int b)
- Overrides:
writein classPrintStream
-
write
public void write(byte[] b) throws IOException- Overrides:
writein classFilterOutputStream- Throws:
IOException
-
append
public PrintStream append(CharSequence csq)
- Specified by:
appendin interfaceAppendable- Overrides:
appendin classPrintStream
-
append
public PrintStream append(CharSequence csq, int start, int end)
- Specified by:
appendin interfaceAppendable- Overrides:
appendin classPrintStream
-
append
public PrintStream append(char c)
- Specified by:
appendin interfaceAppendable- Overrides:
appendin classPrintStream
-
printf
public PrintStream printf(String format, Object... args)
- Overrides:
printfin classPrintStream
-
printf
public PrintStream printf(Locale l, String format, Object... args)
- Overrides:
printfin classPrintStream
-
format
public PrintStream format(String format, Object... args)
- Overrides:
formatin classPrintStream
-
format
public PrintStream format(Locale l, String format, Object... args)
- Overrides:
formatin classPrintStream
-
-