Closeable
, AutoCloseable
public class TraceInputStream extends FilterInputStream
in
Constructor | Description |
---|---|
TraceInputStream(InputStream in,
MailLogger logger) |
Creates an input stream filter built on top of the specified
input stream.
|
TraceInputStream(InputStream in,
OutputStream traceOut) |
Creates an input stream filter built on top of the specified
input stream.
|
Modifier and Type | Method | Description |
---|---|---|
int |
read() |
Reads the next byte of data from this input stream.
|
int |
read(byte[] b,
int off,
int len) |
Reads up to
len bytes of data from this input stream
into an array of bytes. |
void |
setQuote(boolean quote) |
Set quote mode.
|
void |
setTrace(boolean trace) |
Set trace mode.
|
available, close, mark, markSupported, read, reset, skip
readAllBytes, readNBytes, transferTo
public TraceInputStream(InputStream in, MailLogger logger)
in
- the underlying input stream.logger
- log trace herepublic TraceInputStream(InputStream in, OutputStream traceOut)
in
- the underlying input stream.traceOut
- the trace stream.public void setTrace(boolean trace)
trace
- the trace modepublic void setQuote(boolean quote)
quote
- the quote modepublic int read() throws IOException
-1
if no data is available. Writes out the read
byte into the trace stream, if trace mode is true
read
in class FilterInputStream
IOException
public int read(byte[] b, int off, int len) throws IOException
len
bytes of data from this input stream
into an array of bytes. Returns -1
if no more data
is available. Writes out the read bytes into the trace stream, if
trace mode is true
read
in class FilterInputStream
IOException
Copyright © 2018 Oracle. All rights reserved.