65 lines
1.6 KiB
Java
65 lines
1.6 KiB
Java
package g0;
|
|
|
|
import c.d.b.a.a;
|
|
import c.i.a.f.e.o.f;
|
|
import d0.z.d.m;
|
|
import java.io.OutputStream;
|
|
/* compiled from: JvmOkio.kt */
|
|
public final class p implements v {
|
|
public final OutputStream j;
|
|
public final y k;
|
|
|
|
public p(OutputStream outputStream, y yVar) {
|
|
m.checkParameterIsNotNull(outputStream, "out");
|
|
m.checkParameterIsNotNull(yVar, "timeout");
|
|
this.j = outputStream;
|
|
this.k = yVar;
|
|
}
|
|
|
|
@Override // g0.v, java.io.Closeable, java.lang.AutoCloseable
|
|
public void close() {
|
|
this.j.close();
|
|
}
|
|
|
|
@Override // g0.v, java.io.Flushable
|
|
public void flush() {
|
|
this.j.flush();
|
|
}
|
|
|
|
@Override // g0.v
|
|
public y timeout() {
|
|
return this.k;
|
|
}
|
|
|
|
@Override // java.lang.Object
|
|
public String toString() {
|
|
StringBuilder R = a.R("sink(");
|
|
R.append(this.j);
|
|
R.append(')');
|
|
return R.toString();
|
|
}
|
|
|
|
@Override // g0.v
|
|
public void write(e eVar, long j) {
|
|
m.checkParameterIsNotNull(eVar, "source");
|
|
f.A(eVar.k, 0, j);
|
|
while (j > 0) {
|
|
this.k.f();
|
|
s sVar = eVar.j;
|
|
if (sVar == null) {
|
|
m.throwNpe();
|
|
}
|
|
int min = (int) Math.min(j, (long) (sVar.f2947c - sVar.b));
|
|
this.j.write(sVar.a, sVar.b, min);
|
|
int i = sVar.b + min;
|
|
sVar.b = i;
|
|
long j2 = (long) min;
|
|
j -= j2;
|
|
eVar.k -= j2;
|
|
if (i == sVar.f2947c) {
|
|
eVar.j = sVar.a();
|
|
t.a(sVar);
|
|
}
|
|
}
|
|
}
|
|
}
|