com.mucommander.io
Class ChecksumOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by java.security.DigestOutputStream
              extended by com.mucommander.io.ChecksumOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

public class ChecksumOutputStream
extends java.security.DigestOutputStream

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

Author:
Maxence Bernard
See Also:
ChecksumInputStream

Field Summary
 
Fields inherited from class java.security.DigestOutputStream
digest
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
ChecksumOutputStream(java.io.OutputStream 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.DigestOutputStream
getMessageDigest, on, setMessageDigest, toString, write, write
 
Methods inherited from class java.io.FilterOutputStream
close, flush, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ChecksumOutputStream

public ChecksumOutputStream(java.io.OutputStream 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