public static class OutputLogger.OutputPrintStream
extends java.io.PrintStream
Constructor and Description |
---|
OutputPrintStream(OutputLogger owner,
java.io.PrintStream stream)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
java.io.PrintStream |
append(char c)
Appends the specified character to this output stream.
|
java.io.PrintStream |
append(java.lang.CharSequence csq)
Appends the specified character sequence to this output stream.
|
java.io.PrintStream |
append(java.lang.CharSequence csq,
int start,
int end)
Appends a subsequence of the specified character sequence to this output
stream.
|
void |
flush()
ignored.
|
void |
print(boolean x)
prints the given boolean to the streams.
|
void |
print(int x)
prints the given int to the streams.
|
void |
print(java.lang.Object x)
prints the given object to the streams.
|
void |
print(java.lang.String x)
prints the given string to the streams.
|
void |
println()
prints a new line to the streams.
|
void |
println(boolean x)
prints the given boolean to the streams.
|
void |
println(int x)
prints the given int to the streams.
|
void |
println(java.lang.Object x)
prints the given object to the streams (for Throwables we print the stack
trace).
|
void |
println(java.lang.String x)
prints the given string to the streams.
|
void |
write(byte[] b)
Writes the bytes to the stream.
|
void |
write(byte[] buf,
int off,
int len)
Writes the bytes to the stream.
|
void |
write(int b)
Writes the byte to the stream.
|
public OutputPrintStream(OutputLogger owner, java.io.PrintStream stream) throws java.lang.Exception
owner
- the owning loggerstream
- the streamjava.lang.Exception
- if something goes wrongpublic void flush()
flush
in interface java.io.Flushable
flush
in class java.io.PrintStream
public void print(int x)
print
in class java.io.PrintStream
x
- the object to printpublic void print(boolean x)
print
in class java.io.PrintStream
x
- the object to printpublic void print(java.lang.String x)
print
in class java.io.PrintStream
x
- the object to printpublic void print(java.lang.Object x)
print
in class java.io.PrintStream
x
- the object to printpublic void println()
println
in class java.io.PrintStream
public void println(int x)
println
in class java.io.PrintStream
x
- the object to printpublic void println(boolean x)
println
in class java.io.PrintStream
x
- the object to printpublic void println(java.lang.String x)
println
in class java.io.PrintStream
x
- the object to printpublic void println(java.lang.Object x)
println
in class java.io.PrintStream
x
- the object to printpublic void write(int b)
write
in class java.io.PrintStream
b
- the byte to writepublic void write(byte[] b) throws java.io.IOException
write
in class java.io.FilterOutputStream
b
- the bytes to writejava.io.IOException
public void write(byte[] buf, int off, int len)
write
in class java.io.PrintStream
buf
- the buffer to useoff
- the offsetlen
- the number of bytes to writepublic java.io.PrintStream append(java.lang.CharSequence csq, int start, int end)
An invocation of this method of the form
out.append(csq, start, end)
when
csq
is not null
, behaves in
exactly the same way as the invocation
out.print(csq.subSequence(start, end).toString())
append
in interface java.lang.Appendable
append
in class java.io.PrintStream
csq
- The character sequence from which a subsequence will be
appended. If csq
is null
, then characters
will be appended as if csq
contained 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
subsequencejava.lang.IndexOutOfBoundsException
- If start
or end
are negative, start
is greater than end
, or end
is greater than
csq.length()
public java.io.PrintStream append(java.lang.CharSequence csq)
An invocation of this method of the form out.append(csq)
behaves in exactly the same way as the invocation
out.print(csq.toString())
Depending on the specification of toString
for the
character sequence csq
, the entire sequence may not be
appended. For instance, invoking then toString
method of a
character buffer will return a subsequence whose content depends upon
the buffer's position and limit.
append
in interface java.lang.Appendable
append
in class java.io.PrintStream
csq
- The character sequence to append. If csq
is
null
, then the four characters "null"
are
appended to this output stream.public java.io.PrintStream append(char c)
An invocation of this method of the form out.append(c)
behaves in exactly the same way as the invocation
out.print(c)
append
in interface java.lang.Appendable
append
in class java.io.PrintStream
c
- The 16-bit character to append