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

39 lines
1.0 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package org.bouncycastle.crypto.io;
import java.io.FilterInputStream;
import java.io.IOException;
import java.io.InputStream;
import org.bouncycastle.crypto.Signer;
/* loaded from: classes6.dex */
public class SignerInputStream extends FilterInputStream {
protected Signer signer;
@Override // java.io.FilterInputStream, java.io.InputStream
public int read(byte[] bArr, int i, int i2) throws IOException {
int read = ((FilterInputStream) this).in.read(bArr, i, i2);
if (read > 0) {
this.signer.update(bArr, i, read);
}
return read;
}
@Override // java.io.FilterInputStream, java.io.InputStream
public int read() throws IOException {
int read = ((FilterInputStream) this).in.read();
if (read >= 0) {
this.signer.update((byte) read);
}
return read;
}
public Signer getSigner() {
return this.signer;
}
public SignerInputStream(InputStream inputStream, Signer signer) {
super(inputStream);
this.signer = signer;
}
}