org.apache.james.util
Class DebugInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by org.apache.james.util.DebugInputStream
All Implemented Interfaces:
java.io.Closeable

public class DebugInputStream
extends java.io.InputStream

Reads data off a stream, printing every byte read to System.err.


Constructor Summary
DebugInputStream(java.io.InputStream in)
          Constructor that takes an InputStream to be wrapped.
 
Method Summary
 void close()
          Close the stream
 int read()
          Read a byte off the stream
 
Methods inherited from class java.io.InputStream
available, mark, markSupported, read, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DebugInputStream

public DebugInputStream(java.io.InputStream in)
Constructor that takes an InputStream to be wrapped.

Parameters:
in - the InputStream to be wrapped
Method Detail

read

public int read()
         throws java.io.IOException
Read a byte off the stream

Specified by:
read in class java.io.InputStream
Returns:
the byte read off the stream
Throws:
java.io.IOException - if an exception is encountered when reading

close

public void close()
           throws java.io.IOException
Close the stream

Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.InputStream
Throws:
java.io.IOException - if an exception is encountered when closing


Copyright © 2002-2007 The Apache Software Foundation. All Rights Reserved.