Package com.icegreen.greenmail.util
Class LoggingInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- com.icegreen.greenmail.util.LoggingInputStream
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class LoggingInputStream extends FilterInputStream
Logs stream for debugging purpose on DEBUG level.
-
-
Field Summary
Fields Modifier and Type Field Description protected LineLoggingBufferloggingBuffer-
Fields inherited from class java.io.FilterInputStream
in
-
-
Constructor Summary
Constructors Constructor Description LoggingInputStream(InputStream is, String prefix)Creates an input stream filter built on top of the specified underlying input stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()intread()intread(byte[] b, int off, int len)-
Methods inherited from class java.io.FilterInputStream
available, mark, markSupported, read, reset, skip
-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Field Detail
-
loggingBuffer
protected final LineLoggingBuffer loggingBuffer
-
-
Constructor Detail
-
LoggingInputStream
public LoggingInputStream(InputStream is, String prefix)
Creates an input stream filter built on top of the specified underlying input stream.- Parameters:
is- the underlying input stream to be assigned to the field this.is for later use, ornullif this instance is to be created without an underlying stream.prefix- a log message prefix, eg 'c: ' for server side protocol trace input.
-
-
Method Detail
-
read
public int read() throws IOException- Overrides:
readin classFilterInputStream- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException- Overrides:
readin classFilterInputStream- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classFilterInputStream- Throws:
IOException
-
-