FileDocCategorySizeDatePackage
CallbackDigest.javaAPI DocExample731Sat Sep 09 19:52:30 BST 2000None

CallbackDigest

public class CallbackDigest extends Object implements Runnable

Fields Summary
private File
input
Constructors Summary
public CallbackDigest(File input)

   this.input = input;
  
Methods Summary
public voidrun()

    try {
      FileInputStream in = new FileInputStream(input);
      MessageDigest sha = MessageDigest.getInstance("SHA");
      DigestInputStream din = new DigestInputStream(in, sha);
      int b;
      while ((b = din.read()) != -1) ;
      din.close();
      byte[] digest = sha.digest();
      CallbackDigestUserInterface.receiveDigest(digest, input.getName());
    }
    catch (IOException e) {
      System.err.println(e);
    }
    catch (NoSuchAlgorithmException e) {
      System.err.println(e);
    }