org.openrdf.http.object.filters
Class MD5ValidatingChannel

java.lang.Object
  extended by org.openrdf.http.object.filters.MD5ValidatingChannel
All Implemented Interfaces:
Closeable, Channel, ReadableByteChannel

public class MD5ValidatingChannel
extends Object
implements ReadableByteChannel

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


Constructor Summary
MD5ValidatingChannel(ReadableByteChannel delegate, String md5)
           
 
Method Summary
 void close()
           
 String getContentMD5()
           
 boolean isOpen()
           
 int read(ByteBuffer dst)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MD5ValidatingChannel

public MD5ValidatingChannel(ReadableByteChannel delegate,
                            String md5)
                     throws NoSuchAlgorithmException
Throws:
NoSuchAlgorithmException
Method Detail

getContentMD5

public String getContentMD5()

isOpen

public boolean isOpen()
Specified by:
isOpen in interface Channel

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Specified by:
close in interface Channel
Throws:
IOException

read

public int read(ByteBuffer dst)
         throws IOException
Specified by:
read in interface ReadableByteChannel
Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object


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