discord-jadx/app/src/main/java/g0/n.java

72 lines
1.9 KiB
Java
Raw Normal View History

2021-08-03 07:33:18 +00:00
package g0;
import c.q.a.k.a;
import d0.z.d.m;
import java.io.IOException;
import java.io.InputStream;
/* compiled from: JvmOkio.kt */
public final class n implements x {
public final InputStream i;
public final y j;
public n(InputStream inputStream, y yVar) {
m.checkParameterIsNotNull(inputStream, "input");
m.checkParameterIsNotNull(yVar, "timeout");
this.i = inputStream;
this.j = yVar;
}
@Override // g0.x, java.io.Closeable, java.lang.AutoCloseable
public void close() {
this.i.close();
}
@Override // g0.x
public long h0(e eVar, long j) {
m.checkParameterIsNotNull(eVar, "sink");
int i = (j > 0 ? 1 : (j == 0 ? 0 : -1));
if (i == 0) {
return 0;
}
if (i >= 0) {
try {
this.j.f();
s N = eVar.N(1);
2021-08-27 06:37:59 +00:00
int read = this.i.read(N.a, N.f2853c, (int) Math.min(j, (long) (8192 - N.f2853c)));
2021-08-03 07:33:18 +00:00
if (read != -1) {
2021-08-27 06:37:59 +00:00
N.f2853c += read;
2021-08-03 07:33:18 +00:00
long j2 = (long) read;
eVar.j += j2;
return j2;
2021-08-27 06:37:59 +00:00
} else if (N.b != N.f2853c) {
2021-08-03 07:33:18 +00:00
return -1;
} else {
eVar.i = N.a();
t.a(N);
return -1;
}
} catch (AssertionError e) {
if (a.B(e)) {
throw new IOException(e);
}
throw e;
}
} else {
2021-08-25 07:02:36 +00:00
throw new IllegalArgumentException(c.d.b.a.a.p("byteCount < 0: ", j).toString());
2021-08-03 07:33:18 +00:00
}
}
@Override // g0.x
public y timeout() {
return this.j;
}
@Override // java.lang.Object
public String toString() {
2021-08-25 07:02:36 +00:00
StringBuilder N = c.d.b.a.a.N("source(");
N.append(this.i);
N.append(')');
return N.toString();
2021-08-03 07:33:18 +00:00
}
}