Modify testSHA1() to use InputStream instead of File

This commit is contained in:
misaochan 2016-12-09 17:00:14 +13:00
parent d8719d4fcb
commit 03f207db16

View file

@ -45,7 +45,7 @@ public class Utils {
private static final String TAG = Utils.class.getName();
public static boolean testSHA1(String sha1, File file) {
public static boolean testSHA1(String sha1, InputStream is) {
MessageDigest digest;
try {
digest = MessageDigest.getInstance("SHA1");
@ -54,14 +54,6 @@ public class Utils {
return false;
}
InputStream is;
try {
is = new FileInputStream(file);
} catch (FileNotFoundException e) {
Log.e(TAG, "Exception while getting FileInputStream", e);
return false;
}
byte[] buffer = new byte[8192];
int read;
try {