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

65 lines
1.6 KiB
Java
Raw Normal View History

2021-08-03 07:33:18 +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 K = a.K("sink(");
K.append(this.i);
K.append(')');
return K.toString();
}
@Override // g0.v
public void write(e eVar, long j) {
m.checkParameterIsNotNull(eVar, "source");
c.q.a.k.a.l(eVar.j, 0, j);
while (j > 0) {
this.j.f();
s sVar = eVar.i;
if (sVar == null) {
m.throwNpe();
}
2021-08-04 23:47:20 +00:00
int min = (int) Math.min(j, (long) (sVar.f2813c - sVar.b));
2021-08-03 07:33:18 +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-08-04 23:47:20 +00:00
if (i == sVar.f2813c) {
2021-08-03 07:33:18 +00:00
eVar.i = sVar.a();
t.a(sVar);
}
}
}
}