package n;

import java.nio.ByteBuffer;

/* JADX INFO: renamed from: n.A, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public class C0633A {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final C0639e f5408a = new C0639e();

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public ByteBuffer f5409b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public int f5410c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public int f5411d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public long f5412e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public long f5413f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    private final int f5414g;

    public C0633A(int i2) {
        this.f5414g = i2;
    }

    private ByteBuffer b(int i2) {
        int i3 = this.f5414g;
        if (i3 == 1) {
            return ByteBuffer.allocate(i2);
        }
        if (i3 == 2) {
            return ByteBuffer.allocateDirect(i2);
        }
        ByteBuffer byteBuffer = this.f5409b;
        throw new IllegalStateException("Buffer too small (" + (byteBuffer == null ? 0 : byteBuffer.capacity()) + " < " + i2 + ")");
    }

    public void a() {
        ByteBuffer byteBuffer = this.f5409b;
        if (byteBuffer != null) {
            byteBuffer.clear();
        }
    }

    public void c(int i2) {
        ByteBuffer byteBuffer = this.f5409b;
        if (byteBuffer == null) {
            this.f5409b = b(i2);
            return;
        }
        int iCapacity = byteBuffer.capacity();
        int iPosition = this.f5409b.position();
        int i3 = i2 + iPosition;
        if (iCapacity >= i3) {
            return;
        }
        ByteBuffer byteBufferB = b(i3);
        if (iPosition > 0) {
            this.f5409b.position(0);
            this.f5409b.limit(iPosition);
            byteBufferB.put(this.f5409b);
        }
        this.f5409b = byteBufferB;
    }

    public final void d() {
        ByteBuffer byteBuffer = this.f5409b;
        if (byteBuffer != null) {
            byteBuffer.flip();
        }
    }

    public boolean e() {
        return (this.f5411d & 134217728) != 0;
    }

    public boolean f() {
        return (this.f5411d & 2) != 0;
    }

    public boolean g() {
        return (this.f5411d & 33554432) != 0;
    }

    public boolean h() {
        return (this.f5411d & 1) != 0;
    }
}
