Class ZDigest


  • public class ZDigest
    extends java.lang.Object
    The ZDigest class generates a hash from chunks of data. The current algorithm is SHA-1, chosen for speed.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private byte[] buffer  
      private java.security.MessageDigest sha1  
    • Constructor Summary

      Constructors 
      Constructor Description
      ZDigest()
      Creates a new digester.
      ZDigest​(byte[] buffer)
      Creates a new digester.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte[] data()  
      int size()  
      java.lang.String string()  
      ZDigest update​(byte[] input)  
      ZDigest update​(byte[] input, int offset, int length)  
      ZDigest update​(java.io.InputStream input)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • buffer

        private final byte[] buffer
      • sha1

        private final java.security.MessageDigest sha1
    • Constructor Detail

      • ZDigest

        public ZDigest()
        Creates a new digester.
      • ZDigest

        public ZDigest​(byte[] buffer)
        Creates a new digester.
        Parameters:
        buffer - the temp buffer used for computation of streams.
    • Method Detail

      • update

        public ZDigest update​(java.io.InputStream input)
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • update

        public ZDigest update​(byte[] input)
      • update

        public ZDigest update​(byte[] input,
                              int offset,
                              int length)
      • data

        public byte[] data()
      • size

        public int size()
      • string

        public java.lang.String string()