com.mucommander.io
Class ChecksumInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by java.security.DigestInputStream
              extended by com.mucommander.io.ChecksumInputStream
All Implemented Interfaces:
java.io.Closeable

public class ChecksumInputStream
extends java.security.DigestInputStream

This class extends java.security.DigestInputStream and adds convenience methods that return the digest/checksum expressed in various forms.

Author:
Maxence Bernard
See Also:
ChecksumOutputStream

Field Summary
 
Fields inherited from class java.security.DigestInputStream
digest
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
ChecksumInputStream(java.io.InputStream stream, java.security.MessageDigest digest)
           
 
Method Summary
 byte[] getChecksumBytes()
          Returns this stream's digest, expressed as a byte array.
 java.lang.String getChecksumString()
          Returns this stream's digest, expressed as an hexadecimal string.
 
Methods inherited from class java.security.DigestInputStream
getMessageDigest, on, read, read, setMessageDigest, toString
 
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ChecksumInputStream

public ChecksumInputStream(java.io.InputStream stream,
                           java.security.MessageDigest digest)
Method Detail

getChecksumBytes

public byte[] getChecksumBytes()
Returns this stream's digest, expressed as a byte array.

Returns:
this stream's digest, expressed as a byte array

getChecksumString

public java.lang.String getChecksumString()
Returns this stream's digest, expressed as an hexadecimal string.

Returns:
this stream's digest, expressed as an hexadecimal string


This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard