package b7; import java.io.IOException; import java.io.InputStream; import java.util.Queue; /* loaded from: classes2.dex */ public final class d extends InputStream { /* renamed from: c, reason: collision with root package name */ private static final Queue f3313c = k.h(0); /* renamed from: a, reason: collision with root package name */ private InputStream f3314a; /* renamed from: b, reason: collision with root package name */ private IOException f3315b; d() { } public static d G(InputStream inputStream) { d dVar; Queue queue = f3313c; synchronized (queue) { dVar = (d) queue.poll(); } if (dVar == null) { dVar = new d(); } dVar.c(inputStream); return dVar; } @Override // java.io.InputStream public int available() { return this.f3314a.available(); } void c(InputStream inputStream) { this.f3314a = inputStream; } @Override // java.io.InputStream, java.io.Closeable, java.lang.AutoCloseable public void close() { this.f3314a.close(); } @Override // java.io.InputStream public void mark(int i10) { this.f3314a.mark(i10); } @Override // java.io.InputStream public boolean markSupported() { return this.f3314a.markSupported(); } @Override // java.io.InputStream public int read() { try { return this.f3314a.read(); } catch (IOException e10) { this.f3315b = e10; throw e10; } } public void release() { this.f3315b = null; this.f3314a = null; Queue queue = f3313c; synchronized (queue) { queue.offer(this); } } @Override // java.io.InputStream public synchronized void reset() { this.f3314a.reset(); } @Override // java.io.InputStream public long skip(long j10) { try { return this.f3314a.skip(j10); } catch (IOException e10) { this.f3315b = e10; throw e10; } } public IOException z() { return this.f3315b; } @Override // java.io.InputStream public int read(byte[] bArr) { try { return this.f3314a.read(bArr); } catch (IOException e10) { this.f3315b = e10; throw e10; } } @Override // java.io.InputStream public int read(byte[] bArr, int i10, int i11) { try { return this.f3314a.read(bArr, i10, i11); } catch (IOException e10) { this.f3315b = e10; throw e10; } } }