Class cryptix.security.MessageDigestOutputStream
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class cryptix.security.MessageDigestOutputStream

java.lang.Object
   |
   +----java.io.OutputStream
           |
           +----cryptix.security.MessageDigestOutputStream

public class MessageDigestOutputStream
extends OutputStream
This class is an output stream that hashes the data sent to it using the message digest that it has been constructed with.

References

Copyright © 1995, 1996, 1997 Systemics Ltd on behalf of the Cryptix Development Team. All rights reserved.

Author:
Systemics Ltd
See Also:
MessageDigest, SHAOutputStream, MD5OutputStream

Constructor Index

 o MessageDigestOutputStream(MessageDigest)

Method Index

 o digest()
Completes the digest and resets.
 o digestAsHash()
Completes the digest and resets.
 o write(byte[])
Writes an array of bytes to the message digestor
 o write(byte[], int, int)
Writes a sub array of bytes to the message digestor.
 o write(int)
Writes a byte to the message digestor.

Constructors

 o MessageDigestOutputStream
  public MessageDigestOutputStream(MessageDigest md0)
Parameters:
md0 - the message digestor that is uses to hash the data.

Methods

 o write
  public final synchronized void write(int b)
Writes a byte to the message digestor.
Parameters:
b - the byte
Overrides:
write in class OutputStream
 o write
  public final void write(byte b[])
Writes an array of bytes to the message digestor
Parameters:
b - the data to be added to the hash
Overrides:
write in class OutputStream
 o write
  public final void write(byte b[],
                          int off,
                          int len)
Writes a sub array of bytes to the message digestor.
Parameters:
b - the data to be added to the hash
off - the start offset in the data
len - the number of bytes that are written
Overrides:
write in class OutputStream
 o digest
  public final byte[] digest()
Completes the digest and resets.
Returns:
the final digest (as a byte array) of the data added
 o digestAsHash
  public final MessageHash digestAsHash()
Completes the digest and resets.
Returns:
the final digest (as a Hash object) of the data added

All Packages  Class Hierarchy  This Package  Previous  Next  Index