package org.bouncycastle.jcajce.io; import java.io.IOException; import java.io.OutputStream; import javax.crypto.Mac; /* loaded from: classes6.dex */ public final class MacOutputStream extends OutputStream { private Mac mac; @Override // java.io.OutputStream public final void write(byte[] bArr, int i, int i2) throws IOException { this.mac.update(bArr, i, i2); } @Override // java.io.OutputStream public final void write(int i) throws IOException { this.mac.update((byte) i); } public final byte[] getMac() { return this.mac.doFinal(); } public MacOutputStream(Mac mac) { this.mac = mac; } }