com.ibm.commons.util.io
Class TraceInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by com.ibm.commons.util.io.TraceInputStream
All Implemented Interfaces:
java.io.Closeable

public class TraceInputStream
extends java.io.InputStream

This class is simply a wrapper to an original stream that traces the bytes read.

It is useful to display each byte that is read from an InputStream without consuming them.


Constructor Summary
TraceInputStream(java.io.InputStream inputStream, java.io.OutputStream trace, boolean close)
           
 
Method Summary
 void close()
           
 int read()
           
 int read(byte[] b, int off, int len)
           
 
Methods inherited from class java.io.InputStream
available, mark, markSupported, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TraceInputStream

public TraceInputStream(java.io.InputStream inputStream,
                        java.io.OutputStream trace,
                        boolean close)
Method Detail

close

public void close()
           throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.InputStream
Throws:
java.io.IOException

read

public int read()
         throws java.io.IOException
Specified by:
read in class java.io.InputStream
Throws:
java.io.IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws java.io.IOException
Overrides:
read in class java.io.InputStream
Throws:
java.io.IOException