de.unkrig.commons.io
Class ByteFilterInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by de.unkrig.commons.io.ByteFilterInputStream
All Implemented Interfaces:
java.io.Closeable

public class ByteFilterInputStream
extends java.io.FilterInputStream

A FilterInputStream that transforms the byte stream through a ByteFilter. Any IOException and RuntimeException that ByteFilter.run(java.io.InputStream, java.io.OutputStream) throws is caught and rethrown by the read() methods of this object.


Field Summary
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
ByteFilterInputStream(java.io.InputStream in, ByteFilter<?> byteFilter)
           
 
Method Summary
 void close()
           
 int read()
           
 int read(byte[] b, int off, int len)
           
 
Methods inherited from class java.io.FilterInputStream
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

ByteFilterInputStream

public ByteFilterInputStream(java.io.InputStream in,
                             ByteFilter<?> byteFilter)
See Also:
ByteFilterInputStream
Method Detail

read

public int read()
         throws java.io.IOException
Overrides:
read in class java.io.FilterInputStream
Throws:
java.io.IOException

read

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

close

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