what-the-bank/sources/org/bouncycastle/crypto/io/DigestOutputStream.java

31 lines
785 B
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package org.bouncycastle.crypto.io;
import java.io.IOException;
import java.io.OutputStream;
import org.bouncycastle.crypto.Digest;
/* loaded from: classes6.dex */
public class DigestOutputStream extends OutputStream {
protected Digest digest;
@Override // java.io.OutputStream
public void write(byte[] bArr, int i, int i2) throws IOException {
this.digest.update(bArr, i, i2);
}
@Override // java.io.OutputStream
public void write(int i) throws IOException {
this.digest.update((byte) i);
}
public byte[] getDigest() {
byte[] bArr = new byte[this.digest.getDigestSize()];
this.digest.doFinal(bArr, 0);
return bArr;
}
public DigestOutputStream(Digest digest) {
this.digest = digest;
}
}