Code example for HashFunction

Methods: newHasher

0
public class HashOutputStream extends OutputStream {
 
    private Hasher hasher;
 
    public HashOutputStream(HashFunction hf) {
        hasher = hf.newHasher();
    } 
 
    @Override 
    public void write(int b) throws IOException {
        hasher.putInt(b);
    } 
 
    public HashCode getHashCode() {
        return hasher.hash();
    } 
 
} 
Experience pair programming with AI  Get Codota for Java