org.openjena.atlas.lib
Class MD5

java.lang.Object
  extended by org.openjena.atlas.lib.MD5

public class MD5
extends java.lang.Object


Constructor Summary
MD5(java.io.InputStream in)
          Construct a digestifier for the given input stream.
MD5(java.lang.String input)
          Construct a digestifier for the given string.
MD5(java.lang.String input, java.lang.String encoding)
          Construct a digestifier for the given string.
 
Method Summary
 byte[] getDigest()
          Get the digest for our input stream.
 java.lang.String getStringDigest()
          Get the digest, as a proper string.
static void main(java.lang.String[] args)
           
 byte[] processString()
          Get the digest, for this string digestifier.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MD5

public MD5(java.lang.String input,
           java.lang.String encoding)
Construct a digestifier for the given string.

Parameters:
input - The string to be digestified.
encoding - the encoding name used (such as UTF8)

MD5

public MD5(java.lang.String input)
Construct a digestifier for the given string.

Parameters:
input - The string to be digestified.

MD5

public MD5(java.io.InputStream in)
Construct a digestifier for the given input stream.

Parameters:
in - The input stream to be digestified.
Method Detail

getDigest

public byte[] getDigest()
                 throws java.io.IOException
Get the digest for our input stream. This method constructs the input stream digest, and return it, as a a String, following the MD5 (rfc1321) algorithm,

Returns:
An instance of String, giving the message digest.
Throws:
java.io.IOException - Thrown if the digestifier was unable to read the input stream.

processString

public byte[] processString()
Get the digest, for this string digestifier. This method doesn't throw any IOException, since it knows that the underlying stream ws built from a String.


getStringDigest

public java.lang.String getStringDigest()
Get the digest, as a proper string.


main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP