Package org.emrick.project.dev
Class AppLog.TeeStream
java.lang.Object
java.io.OutputStream
org.emrick.project.dev.AppLog.TeeStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
- Enclosing class:
- AppLog
Passes bytes through to the original stream and collects them into lines for the log.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanprivate final ByteArrayOutputStreamprivate final PrintStream -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.io.OutputStream
close, nullOutputStream, write
-
Field Details
-
original
-
error
private final boolean error -
line
-
-
Constructor Details
-
TeeStream
TeeStream(PrintStream original, boolean error)
-
-
Method Details
-
write
public void write(int b) - Specified by:
writein classOutputStream
-
write
public void write(byte[] buf, int off, int len) - Overrides:
writein classOutputStream
-
collect
private void collect(int b) -
flush
public void flush()- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream
-
flushLine
private void flushLine()
-