Class MCRMD5InputStream

All Implemented Interfaces:
Closeable, AutoCloseable

public class MCRMD5InputStream extends DigestInputStream
Builds an MD5 checksum String while content goes through this input stream.
Author:
Frank Lützenkirchen
  • Constructor Details

  • Method Details

    • getMD5

      public byte[] getMD5()
      Returns the MD5 message digest that has been built during reading of the underlying input stream.
      Returns:
      the MD5 message digest checksum of all bytes that have been read
    • getMD5String

      public String getMD5String()
      Returns the MD5 checksum as a String
      Returns:
      the MD5 checksum as a String of hex digits
    • getMD5String

      public static String getMD5String(byte[] digest)
      Given an MD5 message digest, returns the MD5 checksum as a String
      Returns:
      the MD5 checksum as a String of hex digits
    • buildMD5Digest

      public static MessageDigest buildMD5Digest()
      Builds a MessageDigest instance for MD5 checksum computation.
      Throws:
      MCRConfigurationException - if no java classes that support MD5 algorithm could be found