public class TraceInputStream
extends java.io.FilterInputStream
Modifier and Type | Field and Description |
---|---|
private boolean |
quote |
private boolean |
trace |
private java.io.OutputStream |
traceOut |
Constructor and Description |
---|
TraceInputStream(java.io.InputStream in,
MailLogger logger)
Creates an input stream filter built on top of the specified
input stream.
|
TraceInputStream(java.io.InputStream in,
java.io.OutputStream traceOut)
Creates an input stream filter built on top of the specified
input stream.
|
Modifier and Type | Method and 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.
|
private void |
writeByte(int b)
Write a byte in a way that every byte value is printable ASCII.
|
private boolean trace
private boolean quote
private java.io.OutputStream traceOut
public TraceInputStream(java.io.InputStream in, MailLogger logger)
in
- the underlying input stream.logger
- log trace herepublic TraceInputStream(java.io.InputStream in, java.io.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 java.io.IOException
-1
if no data is available. Writes out the read
byte into the trace stream, if trace mode is true
read
in class java.io.FilterInputStream
java.io.IOException
public int read(byte[] b, int off, int len) throws java.io.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 java.io.FilterInputStream
java.io.IOException
private final void writeByte(int b) throws java.io.IOException
java.io.IOException