Class AbstractNonStreamingHashFunction.BufferingHasher

    • Constructor Detail

      • BufferingHasher

        BufferingHasher​(int expectedInputSize)
    • Method Detail

      • putByte

        public Hasher putByte​(byte b)
        Description copied from interface: PrimitiveSink
        Puts a byte into this sink.
        Parameters:
        b - a byte
        Returns:
        this instance
      • putBytes

        public Hasher putBytes​(byte[] bytes)
        Description copied from interface: PrimitiveSink
        Puts an array of bytes into this sink.
        Parameters:
        bytes - a byte array
        Returns:
        this instance
      • putBytes

        public Hasher putBytes​(byte[] bytes,
                               int off,
                               int len)
        Description copied from interface: PrimitiveSink
        Puts a chunk of an array of bytes into this sink. bytes[off] is the first byte written, bytes[off + len - 1] is the last.
        Parameters:
        bytes - a byte array
        off - the start offset in the array
        len - the number of bytes to write
        Returns:
        this instance
      • putShort

        public Hasher putShort​(short s)
        Description copied from interface: PrimitiveSink
        Puts a short into this sink.
      • putInt

        public Hasher putInt​(int i)
        Description copied from interface: PrimitiveSink
        Puts an int into this sink.
      • putLong

        public Hasher putLong​(long l)
        Description copied from interface: PrimitiveSink
        Puts a long into this sink.
      • putChar

        public Hasher putChar​(char c)
        Description copied from interface: PrimitiveSink
        Puts a character into this sink.
      • putObject

        public <T> Hasher putObject​(T instance,
                                    Funnel<? super T> funnel)
        Description copied from interface: Hasher
        A simple convenience for funnel.funnel(object, this).
      • hash

        public HashCode hash()
        Description copied from interface: Hasher
        Computes a hash code based on the data that have been provided to this hasher. The result is unspecified if this method is called more than once on the same instance.