List of utility methods to do Digest File
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); ... |
void | digestFile(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); ... |