public class LoggingInputStream extends FilterInputStream
Thread-safe input stream wrapper that forwards all reads to a given input stream, while logging all reads to a LoggingByteArrayOutputStream.
Constructors
LoggingInputStream(InputStream inputStream, Logger logger, Level loggingLevel, int contentLoggingLimit)
public LoggingInputStream(InputStream inputStream, Logger logger, Level loggingLevel, int contentLoggingLimit)
Name | Description |
inputStream | InputStream input stream to forward all reads to |
logger | Logger logger |
loggingLevel | Level logging level |
contentLoggingLimit | int maximum number of bytes to log (may be |
Methods
close()
public void close()
Type | Description |
IOException |
getLogStream()
public final LoggingByteArrayOutputStream getLogStream()
Returns the log stream.
Type | Description |
LoggingByteArrayOutputStream |
read()
public int read()
Type | Description |
int |
Type | Description |
IOException |
read(byte[] b, int off, int len)
public int read(byte[] b, int off, int len)
Name | Description |
b | byte[] |
off | int |
len | int |
Type | Description |
int |
Type | Description |
IOException |