From 1c3c5653527a8cd994c5e9c5125b3fe5e847e3ac Mon Sep 17 00:00:00 2001 From: "Taro L. Saito" Date: Tue, 13 Aug 2013 15:47:05 +0900 Subject: [PATCH] Removed md5sum code, which will no longer be used --- .../java/org/xerial/snappy/SnappyLoader.java | 33 ------------------- 1 file changed, 33 deletions(-) diff --git a/src/main/java/org/xerial/snappy/SnappyLoader.java b/src/main/java/org/xerial/snappy/SnappyLoader.java index 5f8f7f4..83bb252 100755 --- a/src/main/java/org/xerial/snappy/SnappyLoader.java +++ b/src/main/java/org/xerial/snappy/SnappyLoader.java @@ -26,9 +26,6 @@ package org.xerial.snappy; import java.io.*; import java.net.URL; -import java.security.DigestInputStream; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; import java.util.Enumeration; import java.util.Properties; import java.util.UUID; @@ -170,36 +167,6 @@ public class SnappyLoader } - - /** - * Computes the MD5 value of the input stream - * - * @param input - * @return - * @throws IOException - * @throws NoSuchAlgorithmException - */ - static String md5sum(InputStream input) throws IOException { - BufferedInputStream in = new BufferedInputStream(input); - try { - MessageDigest digest = java.security.MessageDigest.getInstance("MD5"); - DigestInputStream digestInputStream = new DigestInputStream(in, digest); - for (; digestInputStream.read() >= 0;) { - - } - ByteArrayOutputStream md5out = new ByteArrayOutputStream(); - md5out.write(digest.digest()); - return md5out.toString(); - } - catch (NoSuchAlgorithmException e) { - throw new IllegalStateException("MD5 algorithm is not available: " + e); - } - finally { - in.close(); - } - } - - private static boolean contentsEquals(InputStream in1, InputStream in2) throws IOException { if(!(in1 instanceof BufferedInputStream)) { in1 = new BufferedInputStream(in1);