home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &n…he Search for Life DVD 2 / DVD-ROM.iso / install / jre1_3 / lib / rt.jar / java / security / MessageDigestSpi.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  861 b   |  36 lines

  1. package java.security;
  2.  
  3. public abstract class MessageDigestSpi {
  4.    protected int engineGetDigestLength() {
  5.       return 0;
  6.    }
  7.  
  8.    protected abstract void engineUpdate(byte var1);
  9.  
  10.    protected abstract void engineUpdate(byte[] var1, int var2, int var3);
  11.  
  12.    protected abstract byte[] engineDigest();
  13.  
  14.    protected int engineDigest(byte[] var1, int var2, int var3) throws DigestException {
  15.       byte[] var4 = this.engineDigest();
  16.       if (var3 < var4.length) {
  17.          throw new DigestException("partial digests not returned");
  18.       } else if (var1.length - var2 < var4.length) {
  19.          throw new DigestException("insufficient space in the output buffer to store the digest");
  20.       } else {
  21.          System.arraycopy(var4, 0, var1, var2, var4.length);
  22.          return var4.length;
  23.       }
  24.    }
  25.  
  26.    protected abstract void engineReset();
  27.  
  28.    public Object clone() throws CloneNotSupportedException {
  29.       if (this instanceof Cloneable) {
  30.          return super.clone();
  31.       } else {
  32.          throw new CloneNotSupportedException();
  33.       }
  34.    }
  35. }
  36.