public class

TraceInputStream

extends FilterInputStream
java.lang.Object
   ↳ java.io.InputStream
     ↳ java.io.FilterInputStream
       ↳ com.google.code.com.sun.mail.util.TraceInputStream

Class Overview

This class is a FilterInputStream that writes the bytes being read from the given input stream into the given output stream. This class is typically used to provide a trace of the data that is being retrieved from an input stream.

Summary

[Expand]
Inherited Constants
From class java.io.InputStream
Fields
private boolean quote
private boolean trace
private OutputStream traceOut
[Expand]
Inherited Fields
From class java.io.FilterInputStream
Public Constructors
TraceInputStream(InputStream in, OutputStream traceOut)
Creates an input stream filter built on top of the specified input stream.
Public Methods
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.
[Expand]
Inherited Methods
From class java.io.FilterInputStream
From class java.io.InputStream
From class java.lang.Object
From interface java.io.Closeable

Fields

private boolean quote

private boolean trace

private OutputStream traceOut

Public Constructors

public TraceInputStream (InputStream in, OutputStream traceOut)

Creates an input stream filter built on top of the specified input stream.

Parameters
in The underlying input stream.
traceOut The trace stream

Public Methods

public int read ()

Reads the next byte of data from this input stream. Returns -1 if no data is available. Writes out the read byte into the trace stream, if trace mode is true

Throws
IOException

public int read (byte[] b, int off, int len)

Reads up to 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

Parameters
b
off
len
Throws
IOException

public void setQuote (boolean quote)

Set quote mode.

Parameters
quote The quote mode

public void setTrace (boolean trace)

Set trace mode.

Parameters
trace The trace mode