org.openrdf.http.object.filters
Class MD5ValidatingStream

java.lang.Object
  extended by java.io.InputStream
      extended by org.openrdf.http.object.filters.MD5ValidatingStream
All Implemented Interfaces:
Closeable

public class MD5ValidatingStream
extends InputStream

Computes the MD5 sum of this stream and throws an exception if it is wrong.


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

Constructor Detail

MD5ValidatingStream

public MD5ValidatingStream(InputStream delegate,
                           String md5)
                    throws NoSuchAlgorithmException
Throws:
NoSuchAlgorithmException
Method Detail

available

public int available()
              throws IOException
Overrides:
available in class InputStream
Throws:
IOException

close

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

read

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

read

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

read

public int read(byte[] b)
         throws IOException
Overrides:
read in class InputStream
Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2004-2010 James Leigh Services Inc.. All Rights Reserved.