Package weka.core.logging
Class OutputLogger.OutputPrintStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.FilterOutputStream
-
- java.io.PrintStream
-
- weka.core.logging.OutputLogger.OutputPrintStream
-
- All Implemented Interfaces:
Closeable,Flushable,Appendable,AutoCloseable
- Enclosing class:
- OutputLogger
public static class OutputLogger.OutputPrintStream extends PrintStream
A print stream class to capture all data from stdout and stderr.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
-
-
Constructor Summary
Constructors Constructor Description OutputPrintStream(OutputLogger owner, PrintStream stream)Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PrintStreamappend(char c)Appends the specified character to this output stream.PrintStreamappend(CharSequence csq)Appends the specified character sequence to this output stream.PrintStreamappend(CharSequence csq, int start, int end)Appends a subsequence of the specified character sequence to this output stream.voidflush()ignored.voidprint(boolean x)prints the given boolean to the streams.voidprint(int x)prints the given int to the streams.voidprint(Object x)prints the given object to the streams.voidprint(String x)prints the given string to the streams.voidprintln()prints a new line to the streams.voidprintln(boolean x)prints the given boolean to the streams.voidprintln(int x)prints the given int to the streams.voidprintln(Object x)prints the given object to the streams (for Throwables we print the stack trace).voidprintln(String x)prints the given string to the streams.voidwrite(byte[] b)Writes the bytes to the stream.voidwrite(byte[] buf, int off, int len)Writes the bytes to the stream.voidwrite(int b)Writes the byte to the stream.-
Methods inherited from class java.io.PrintStream
checkError, close, format, format, print, print, print, print, print, printf, printf, println, println, println, println, println
-
Methods inherited from class java.io.OutputStream
nullOutputStream
-
-
-
-
Constructor Detail
-
OutputPrintStream
public OutputPrintStream(OutputLogger owner, PrintStream stream) throws Exception
Default constructor.- Parameters:
owner- the owning loggerstream- the stream- Throws:
Exception- if something goes wrong
-
-
Method Detail
-
flush
public void flush()
ignored.- Specified by:
flushin interfaceFlushable- Overrides:
flushin classPrintStream
-
print
public void print(int x)
prints the given int to the streams.- Overrides:
printin classPrintStream- Parameters:
x- the object to print
-
print
public void print(boolean x)
prints the given boolean to the streams.- Overrides:
printin classPrintStream- Parameters:
x- the object to print
-
print
public void print(String x)
prints the given string to the streams.- Overrides:
printin classPrintStream- Parameters:
x- the object to print
-
print
public void print(Object x)
prints the given object to the streams.- Overrides:
printin classPrintStream- Parameters:
x- the object to print
-
println
public void println()
prints a new line to the streams.- Overrides:
printlnin classPrintStream
-
println
public void println(int x)
prints the given int to the streams.- Overrides:
printlnin classPrintStream- Parameters:
x- the object to print
-
println
public void println(boolean x)
prints the given boolean to the streams.- Overrides:
printlnin classPrintStream- Parameters:
x- the object to print
-
println
public void println(String x)
prints the given string to the streams.- Overrides:
printlnin classPrintStream- Parameters:
x- the object to print
-
println
public void println(Object x)
prints the given object to the streams (for Throwables we print the stack trace).- Overrides:
printlnin classPrintStream- Parameters:
x- the object to print
-
write
public void write(int b)
Writes the byte to the stream.- Overrides:
writein classPrintStream- Parameters:
b- the byte to write
-
write
public void write(byte[] b) throws IOExceptionWrites the bytes to the stream.- Overrides:
writein classFilterOutputStream- Parameters:
b- the bytes to write- Throws:
IOException
-
write
public void write(byte[] buf, int off, int len)Writes the bytes to the stream.- Overrides:
writein classPrintStream- Parameters:
buf- the buffer to useoff- the offsetlen- the number of bytes to write
-
append
public PrintStream append(CharSequence csq, int start, int end)
Appends a subsequence of the specified character sequence to this output stream.An invocation of this method of the form
out.append(csq, start, end)whencsqis notnull, behaves in exactly the same way as the invocationout.print(csq.subSequence(start, end).toString())- Specified by:
appendin interfaceAppendable- Overrides:
appendin classPrintStream- Parameters:
csq- The character sequence from which a subsequence will be appended. Ifcsqisnull, then characters will be appended as ifcsqcontained the four characters"null".start- The index of the first character in the subsequenceend- The index of the character following the last character in the subsequence- Returns:
- This output stream
- Throws:
IndexOutOfBoundsException- Ifstartorendare negative,startis greater thanend, orendis greater thancsq.length()- Since:
- 1.5
-
append
public PrintStream append(CharSequence csq)
Appends the specified character sequence to this output stream.An invocation of this method of the form
out.append(csq)behaves in exactly the same way as the invocationout.print(csq.toString())Depending on the specification of
toStringfor the character sequencecsq, the entire sequence may not be appended. For instance, invoking thentoStringmethod of a character buffer will return a subsequence whose content depends upon the buffer's position and limit.- Specified by:
appendin interfaceAppendable- Overrides:
appendin classPrintStream- Parameters:
csq- The character sequence to append. Ifcsqisnull, then the four characters"null"are appended to this output stream.- Returns:
- This output stream
- Since:
- 1.5
-
append
public PrintStream append(char c)
Appends the specified character to this output stream.An invocation of this method of the form
out.append(c)behaves in exactly the same way as the invocationout.print(c)- Specified by:
appendin interfaceAppendable- Overrides:
appendin classPrintStream- Parameters:
c- The 16-bit character to append- Returns:
- This output stream
- Since:
- 1.5
-
-