Package software.amazon.awssdk.utils
Class Md5Utils
java.lang.Object
software.amazon.awssdk.utils.Md5Utils
Utility methods for computing MD5 sums.
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
computeMD5Hash
(byte[] input) Computes the MD5 hash of the given data and returns it as an array of bytes.static byte[]
computeMD5Hash
(File file) Computes the MD5 of the given file.static byte[]
Computes the MD5 hash of the data in the given input stream and returns it as an array of bytes.static String
md5AsBase64
(byte[] input) Returns the MD5 in base64 for the given byte array.static String
md5AsBase64
(File file) Returns the MD5 in base64 for the given file.static String
Returns the MD5 in base64 for the data from the given input stream.
-
Method Details
-
computeMD5Hash
Computes the MD5 hash of the data in the given input stream and returns it as an array of bytes. Note this method closes the given input stream upon completion.- Throws:
IOException
-
md5AsBase64
Returns the MD5 in base64 for the data from the given input stream. Note this method closes the given input stream upon completion.- Throws:
IOException
-
computeMD5Hash
public static byte[] computeMD5Hash(byte[] input) Computes the MD5 hash of the given data and returns it as an array of bytes. -
md5AsBase64
Returns the MD5 in base64 for the given byte array. -
computeMD5Hash
Computes the MD5 of the given file.- Throws:
FileNotFoundException
IOException
-
md5AsBase64
Returns the MD5 in base64 for the given file.- Throws:
FileNotFoundException
IOException
-