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

65 lines
1.6 KiB
Java
Raw Normal View History

2021-06-27 20:44:35 +00:00
package g0;
import c.d.b.a.a;
import d0.z.d.m;
import java.io.OutputStream;
/* compiled from: JvmOkio.kt */
public final class p implements v {
public final OutputStream i;
public final y j;
public p(OutputStream outputStream, y yVar) {
m.checkParameterIsNotNull(outputStream, "out");
m.checkParameterIsNotNull(yVar, "timeout");
this.i = outputStream;
this.j = yVar;
}
@Override // g0.v, java.io.Closeable, java.lang.AutoCloseable
public void close() {
this.i.close();
}
@Override // g0.v, java.io.Flushable
public void flush() {
this.i.flush();
}
@Override // g0.v
public y timeout() {
return this.j;
}
@Override // java.lang.Object
public String toString() {
StringBuilder L = a.L("sink(");
L.append(this.i);
L.append(')');
return L.toString();
}
@Override // g0.v
public void write(e eVar, long j) {
m.checkParameterIsNotNull(eVar, "source");
2021-06-27 20:53:42 +00:00
c.q.a.k.a.l(eVar.j, 0, j);
2021-06-27 20:44:35 +00:00
while (j > 0) {
this.j.f();
s sVar = eVar.i;
if (sVar == null) {
m.throwNpe();
}
2021-07-03 23:36:06 +00:00
int min = (int) Math.min(j, (long) (sVar.f2774c - sVar.b));
2021-06-27 20:44:35 +00:00
this.i.write(sVar.a, sVar.b, min);
int i = sVar.b + min;
sVar.b = i;
long j2 = (long) min;
j -= j2;
eVar.j -= j2;
2021-07-03 23:36:06 +00:00
if (i == sVar.f2774c) {
2021-06-27 20:44:35 +00:00
eVar.i = sVar.a();
t.a(sVar);
}
}
}
}