FileDocCategorySizeDatePackage
Shorts.javaAPI DocExample1148Tue Feb 24 09:57:38 GMT 1998None

Shorts

public class Shorts extends Object

Fields Summary
Constructors Summary
Methods Summary
public voidfromMasher(java.lang.String[] args)

    // Obtain a message digest object.
    MessageDigest md = MessageDigest.getInstance("MD5");

    // Calculate the digest for the given file.
    FileInputStream in = new FileInputStream(args[0]);
    byte[] buffer = new byte[8192];
    int length;
    while ((length = in.read(buffer)) != -1)
        md.update(buffer, 0, length);
    byte[] raw = md.digest();
  
public voidmd(byte[] inputData)

		// Define byte[] inputData first.
		MessageDigest md = MessageDigest.getInstance("SHA");
		md.update(inputData);
		byte[] digest = md.digest();
  
public voidwithStream(java.lang.String[] args)

    // Obtain a message digest object.
    MessageDigest md = MessageDigest.getInstance("MD5");

    // Calculate the digest for the given file.
    DigestInputStream in = new DigestInputStream(
        new FileInputStream(args[0]), md);
    byte[] buffer = new byte[8192];
    while (in.read(buffer) != -1)
      ;
    byte[] raw = md.digest();