package rj;

import java.io.InputStream;

/* loaded from: classes3.dex */
public final class m extends l {

    /* renamed from: p, reason: collision with root package name */
    private final l f34818p;

    /* renamed from: q, reason: collision with root package name */
    private final long f34819q;

    /* renamed from: r, reason: collision with root package name */
    private final long f34820r;

    public m(l lVar, long j10, long j11, boolean z10) {
        this.f34818p = lVar;
        long d10 = d(j10);
        this.f34819q = d10;
        this.f34820r = d(d10 + j11);
    }

    private final long d(long j10) {
        if (j10 < 0) {
            return 0L;
        }
        return j10 > this.f34818p.a() ? this.f34818p.a() : j10;
    }

    @Override // rj.l
    public final long a() {
        return this.f34820r - this.f34819q;
    }

    /* JADX INFO: Access modifiers changed from: protected */
    @Override // rj.l
    public final InputStream b(long j10, long j11) {
        long d10 = d(this.f34819q);
        return this.f34818p.b(d10, d(j11 + d10) - d10);
    }

    @Override // java.io.Closeable, java.lang.AutoCloseable
    public final void close() {
    }
}
