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; } }