package o; import java.io.EOFException; import java.io.IOException; import java.io.InputStream; /* renamed from: o.goT, reason: case insensitive filesystem */ /* loaded from: classes6.dex */ final class C15359goT extends goU { private static final byte[] e = new byte[0]; int b; private final int d; /* JADX INFO: Access modifiers changed from: package-private */ public C15359goT(InputStream inputStream, int i) { super(inputStream, i); if (i < 0) { throw new IllegalArgumentException("negative lengths not allowed"); } this.d = i; this.b = i; if (i == 0) { c(); } } @Override // java.io.InputStream public final int read() throws IOException { if (this.b == 0) { return -1; } int read = this.a.read(); if (read >= 0) { int i = this.b - 1; this.b = i; if (i == 0) { c(); } return read; } StringBuilder sb = new StringBuilder("DEF length "); sb.append(this.d); sb.append(" object truncated by "); sb.append(this.b); throw new EOFException(sb.toString()); } @Override // java.io.InputStream public final int read(byte[] bArr, int i, int i2) throws IOException { int i3 = this.b; if (i3 == 0) { return -1; } int read = this.a.read(bArr, i, Math.min(i2, i3)); if (read >= 0) { int i4 = this.b - read; this.b = i4; if (i4 == 0) { c(); } return read; } StringBuilder sb = new StringBuilder("DEF length "); sb.append(this.d); sb.append(" object truncated by "); sb.append(this.b); throw new EOFException(sb.toString()); } /* JADX INFO: Access modifiers changed from: package-private */ public final byte[] a() throws IOException { int i = this.b; if (i == 0) { return e; } byte[] bArr = new byte[i]; InputStream inputStream = this.a; int i2 = 0; while (i2 < i) { int read = inputStream.read(bArr, i2, i - i2); if (read < 0) { break; } i2 += read; } int i3 = i - i2; this.b = i3; if (i3 != 0) { StringBuilder sb = new StringBuilder("DEF length "); sb.append(this.d); sb.append(" object truncated by "); sb.append(this.b); throw new EOFException(sb.toString()); } c(); return bArr; } /* JADX INFO: Access modifiers changed from: package-private */ @Override // o.goU public final int d() { return this.b; } }