Package com.icegreen.greenmail.util
Class LoggingOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.FilterOutputStream
-
- com.icegreen.greenmail.util.LoggingOutputStream
-
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
public class LoggingOutputStream extends FilterOutputStream
Logs stream for debugging purpose on DEBUG level.
-
-
Field Summary
Fields Modifier and Type Field Description protected LineLoggingBufferloggingBuffer-
Fields inherited from class java.io.FilterOutputStream
out
-
-
Constructor Summary
Constructors Constructor Description LoggingOutputStream(OutputStream out, String prefix)Creates an output stream filter built on top of the specified underlying output stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidflush()voidwrite(int b)-
Methods inherited from class java.io.FilterOutputStream
write, write
-
Methods inherited from class java.io.OutputStream
nullOutputStream
-
-
-
-
Field Detail
-
loggingBuffer
protected final LineLoggingBuffer loggingBuffer
-
-
Constructor Detail
-
LoggingOutputStream
public LoggingOutputStream(OutputStream out, String prefix)
Creates an output stream filter built on top of the specified underlying output stream.- Parameters:
out- the underlying output stream to be assigned to the field this.out for later use, ornullif this instance is to be created without an underlying stream.prefix- a log message prefix, eg 's: ' for server side protocol trace output.
-
-
Method Detail
-
write
public void write(int b) throws IOException- Overrides:
writein classFilterOutputStream- Throws:
IOException
-
flush
public void flush() throws IOException- Specified by:
flushin interfaceFlushable- Overrides:
flushin classFilterOutputStream- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classFilterOutputStream- Throws:
IOException
-
-