Java Utililty Methods Digest File

List of utility methods to do Digest File

Description

The list of methods to do Digest File are organized into topic(s).

Method

byte[]digestFile(File file)
digest File
byte[] buffer = new byte[10 * 1024];
MessageDigest md;
try {
    md = MessageDigest.getInstance("MD5");
    InputStream is = null;
    DigestInputStream dis = null;
    try {
        is = new FileInputStream(file);
...
byte[]digestFile(File file, String algorithm)
digest File
if (file == null)
    return null;
FileInputStream fis = null;
DigestInputStream digestInputStream;
try {
    fis = new FileInputStream(file);
    MessageDigest md = MessageDigest.getInstance(algorithm);
    digestInputStream = new DigestInputStream(fis, md);
...
voiddigestFile(String filename, String algorithm)
Calculate digest of given file with given algorithm.
byte[] b = new byte[65536];
int count = 0;
int read = 0;
FileInputStream fis = null;
FileOutputStream fos = null;
try {
    MessageDigest md = MessageDigest.getInstance(algorithm);
    fis = new FileInputStream(filename);
...