我的ProgressInputStream有问题。框架弹出但没有什么可看的。 谢谢,抱歉我的英文不好
public byte[] createMD5Checksum(String filename) throws Exception {
MessageDigest complete = null;
try {
InputStream in = new BufferedInputStream(new ProgressMonitorInputStream(MainFrame.this, "Reading: " +filename, new FileInputStream(filename)));
byte[] buffer = new byte[1024];
int numRead;
complete = MessageDigest.getInstance("MD5");
do {
numRead = in.read(buffer);
if (numRead > 0) {
complete.update(buffer, 0, numRead);
}
} while (numRead != -1);
in.close();
} catch (Exception e) {
e.printStackTrace();
}
return complete.digest();
}