org.apache.geronimo.javamail.util
Class TraceInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by org.apache.geronimo.javamail.util.TraceInputStream
All Implemented Interfaces:
Closeable

public class TraceInputStream
extends FilterInputStream

Version:
$Rev: 668614 $ $Date: 2008-06-17 07:04:26 -0400 (Tue, 17 Jun 2008) $

Field Summary
protected  boolean debug
           
protected  OutputStream traceStream
           
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
TraceInputStream(InputStream in, OutputStream traceStream, boolean debug, boolean encode)
          Construct a debug trace stream.
 
Method Summary
 int read()
          Read the next byte of data from the input stream, returning it as an int value.
 int read(byte[] b, int off, int len)
          Reads up to len bytes of data from this input stream, placing them directly into the provided byte array.
 void setDebug(boolean d)
          Set the current setting of the debug trace stream debug flag.
 
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

protected boolean debug

traceStream

protected OutputStream traceStream
Constructor Detail

TraceInputStream

public TraceInputStream(InputStream in,
                        OutputStream traceStream,
                        boolean debug,
                        boolean encode)
Construct a debug trace stream.

Parameters:
in - The source input stream.
traceStream - The side trace stream to which trace data gets written.
encode - Indicates whether we wish the Trace data to be Q-P encoded.
Method Detail

setDebug

public void setDebug(boolean d)
Set the current setting of the debug trace stream debug flag.

Parameters:
d - The new debug flag settings.

read

public int read(byte[] b,
                int off,
                int len)
         throws IOException
Reads up to len bytes of data from this input stream, placing them directly into the provided byte array.

Overrides:
read in class FilterInputStream
Parameters:
b - the provided data buffer.
off - the starting offset within the buffer for placing the data.
len - the maximum number of bytes to read.
Returns:
that number of bytes that have been read and copied into the buffer or -1 if an end of stream occurs.
Throws:
IOException - for any I/O errors.

read

public int read()
         throws IOException
Read the next byte of data from the input stream, returning it as an int value. Returns -1 if the end of stream is detected.

Overrides:
read in class FilterInputStream
Returns:
The next byte of data or -1 to indicate end-of-stream.
Throws:
IOException - for any I/O errors


Copyright © 2003-2009 The Apache Software Foundation. All Rights Reserved.