package defpackage;

import java.io.IOException;
import java.io.InputStream;
import java.io.RandomAccessFile;

/* JADX INFO: renamed from: ˑᵱᵻʾ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C2134 extends InputStream {

    /* JADX INFO: renamed from: ˌᴵ, reason: contains not printable characters */
    public int f8459;

    /* JADX INFO: renamed from: ᵔᵖᵹᵫ, reason: contains not printable characters */
    public final /* synthetic */ C4155 f8460;

    /* JADX INFO: renamed from: ᵜᵪʾ, reason: contains not printable characters */
    public int f8461;

    public C2134(C4155 c4155, C4240 c4240) {
        this.f8460 = c4155;
        this.f8459 = c4155.m9073(c4240.f16172 + 4);
        this.f8461 = c4240.f16171;
    }

    @Override // java.io.InputStream
    public final int read() throws IOException {
        C4155 c4155 = this.f8460;
        RandomAccessFile randomAccessFile = c4155.f15847;
        if (this.f8461 == 0) {
            return -1;
        }
        randomAccessFile.seek(this.f8459);
        int i = randomAccessFile.read();
        this.f8459 = c4155.m9073(this.f8459 + 1);
        this.f8461--;
        return i;
    }

    @Override // java.io.InputStream
    public final int read(byte[] bArr, int i, int i2) throws IOException {
        if (bArr == null) {
            C4935.m10233("buffer");
            return 0;
        }
        if ((i | i2) < 0 || i2 > bArr.length - i) {
            throw new ArrayIndexOutOfBoundsException();
        }
        int i3 = this.f8461;
        if (i3 <= 0) {
            return -1;
        }
        if (i2 > i3) {
            i2 = i3;
        }
        int i4 = this.f8459;
        C4155 c4155 = this.f8460;
        c4155.m9076(i4, i, i2, bArr);
        this.f8459 = c4155.m9073(this.f8459 + i2);
        this.f8461 -= i2;
        return i2;
    }
}
