package e0;

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

/* JADX INFO: loaded from: classes.dex */
public final class g extends C0555b {
    public g(byte[] bArr) {
        super(bArr);
        this.f6170k.mark(Integer.MAX_VALUE);
    }

    public final void e(long j5) throws IOException {
        int i = this.f6171l;
        if (i > j5) {
            this.f6171l = 0;
            this.f6170k.reset();
        } else {
            j5 -= (long) i;
        }
        a((int) j5);
    }

    public g(InputStream inputStream) {
        super(inputStream);
        if (inputStream.markSupported()) {
            this.f6170k.mark(Integer.MAX_VALUE);
            return;
        }
        throw new IllegalArgumentException("Cannot create SeekableByteOrderedDataInputStream with stream that does not support mark/reset");
    }
}
