86 lines
2.0 KiB
Java
86 lines
2.0 KiB
Java
package c.i.a.c.h2;
|
|
|
|
import android.net.Uri;
|
|
import androidx.annotation.Nullable;
|
|
import java.io.IOException;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Objects;
|
|
/* compiled from: TeeDataSource */
|
|
public final class w implements j {
|
|
public final j a;
|
|
public final h b;
|
|
|
|
/* renamed from: c reason: collision with root package name */
|
|
public boolean f892c;
|
|
public long d;
|
|
|
|
public w(j jVar, h hVar) {
|
|
this.a = jVar;
|
|
this.b = hVar;
|
|
}
|
|
|
|
@Override // c.i.a.c.h2.j
|
|
public long a(l lVar) throws IOException {
|
|
l lVar2 = lVar;
|
|
long a = this.a.a(lVar2);
|
|
this.d = a;
|
|
if (a == 0) {
|
|
return 0;
|
|
}
|
|
long j = lVar2.g;
|
|
if (j == -1 && a != -1) {
|
|
lVar2 = j == a ? lVar2 : new l(lVar2.a, lVar2.b, lVar2.f882c, lVar2.d, lVar2.e, lVar2.f + 0, a, lVar2.h, lVar2.i, lVar2.j);
|
|
}
|
|
this.f892c = true;
|
|
this.b.a(lVar2);
|
|
return this.d;
|
|
}
|
|
|
|
@Override // c.i.a.c.h2.j
|
|
public void close() throws IOException {
|
|
boolean z2 = false;
|
|
try {
|
|
this.a.close();
|
|
} finally {
|
|
if (this.f892c) {
|
|
this.f892c = z2;
|
|
this.b.close();
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // c.i.a.c.h2.j
|
|
public void d(x xVar) {
|
|
Objects.requireNonNull(xVar);
|
|
this.a.d(xVar);
|
|
}
|
|
|
|
@Override // c.i.a.c.h2.j
|
|
public Map<String, List<String>> j() {
|
|
return this.a.j();
|
|
}
|
|
|
|
@Override // c.i.a.c.h2.j
|
|
@Nullable
|
|
public Uri m() {
|
|
return this.a.m();
|
|
}
|
|
|
|
@Override // c.i.a.c.h2.f
|
|
public int read(byte[] bArr, int i, int i2) throws IOException {
|
|
if (this.d == 0) {
|
|
return -1;
|
|
}
|
|
int read = this.a.read(bArr, i, i2);
|
|
if (read > 0) {
|
|
this.b.write(bArr, i, read);
|
|
long j = this.d;
|
|
if (j != -1) {
|
|
this.d = j - ((long) read);
|
|
}
|
|
}
|
|
return read;
|
|
}
|
|
}
|