package g0; import c.d.b.a.a; import d0.z.d.m; import java.io.IOException; /* compiled from: AsyncTimeout.kt */ public final class d implements x { public final /* synthetic */ b i; public final /* synthetic */ x j; public d(b bVar, x xVar) { this.i = bVar; this.j = xVar; } @Override // g0.x, java.io.Closeable, java.lang.AutoCloseable public void close() { b bVar = this.i; bVar.i(); try { this.j.close(); if (bVar.j()) { throw bVar.k(null); } } catch (IOException e) { if (!bVar.j()) { throw e; } throw bVar.k(e); } finally { bVar.j(); } } @Override // g0.x public long h0(e eVar, long j) { m.checkParameterIsNotNull(eVar, "sink"); b bVar = this.i; bVar.i(); try { long h02 = this.j.h0(eVar, j); if (!bVar.j()) { return h02; } throw bVar.k(null); } catch (IOException e) { if (!bVar.j()) { throw e; } throw bVar.k(e); } finally { bVar.j(); } } @Override // g0.x public y timeout() { return this.i; } @Override // java.lang.Object public String toString() { StringBuilder K = a.K("AsyncTimeout.source("); K.append(this.j); K.append(')'); return K.toString(); } }