.class final Lokhttp3/internal/connection/Exchange$RequestBodySink; .super Lokio/ForwardingSink; .source "Exchange.kt" # annotations .annotation system Ldalvik/annotation/EnclosingClass; value = Lokhttp3/internal/connection/Exchange; .end annotation .annotation system Ldalvik/annotation/InnerClass; accessFlags = 0x12 name = "RequestBodySink" .end annotation .annotation system Ldalvik/annotation/SourceDebugExtension; value = "SMAP\nExchange.kt\nKotlin\n*S Kotlin\n*F\n+ 1 Exchange.kt\nokhttp3/internal/connection/Exchange$RequestBodySink\n*L\n1#1,328:1\n*E\n" .end annotation .annotation runtime Lkotlin/Metadata; bv = { 0x1, 0x0, 0x3 } d1 = { "\u00008\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\t\n\u0002\u0008\u0003\n\u0002\u0010\u000b\n\u0002\u0008\u0002\n\u0002\u0010\u0002\n\u0002\u0008\u0002\n\u0002\u0018\u0002\n\u0002\u0008\u0005\n\u0002\u0018\u0002\n\u0002\u0008\u0002\u0008\u0082\u0004\u0018\u00002\u00020\u0001B\u0017\u0008\u0000\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0005\u00a2\u0006\u0002\u0010\u0006J\u0008\u0010\u000b\u001a\u00020\u000cH\u0016J!\u0010\r\u001a\u0002H\u000e\"\n\u0008\u0000\u0010\u000e*\u0004\u0018\u00010\u000f2\u0006\u0010\u0010\u001a\u0002H\u000eH\u0002\u00a2\u0006\u0002\u0010\u0011J\u0008\u0010\u0012\u001a\u00020\u000cH\u0016J\u0018\u0010\u0013\u001a\u00020\u000c2\u0006\u0010\u0014\u001a\u00020\u00152\u0006\u0010\u0016\u001a\u00020\u0005H\u0016R\u000e\u0010\u0007\u001a\u00020\u0005X\u0082\u000e\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u0008\u001a\u00020\tX\u0082\u000e\u00a2\u0006\u0002\n\u0000R\u000e\u0010\n\u001a\u00020\tX\u0082\u000e\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u0004\u001a\u00020\u0005X\u0082\u0004\u00a2\u0006\u0002\n\u0000\u00a8\u0006\u0017" } d2 = { "Lokhttp3/internal/connection/Exchange$RequestBodySink;", "Lokio/ForwardingSink;", "delegate", "Lokio/Sink;", "contentLength", "", "(Lokhttp3/internal/connection/Exchange;Lokio/Sink;J)V", "bytesReceived", "closed", "", "completed", "close", "", "complete", "E", "Ljava/io/IOException;", "e", "(Ljava/io/IOException;)Ljava/io/IOException;", "flush", "write", "source", "Lokio/Buffer;", "byteCount", "okhttp" } k = 0x1 mv = { 0x1, 0x1, 0x10 } .end annotation # instance fields .field private bytesReceived:J .field private closed:Z .field private completed:Z .field private final contentLength:J .field final synthetic this$0:Lokhttp3/internal/connection/Exchange; # direct methods .method public constructor (Lokhttp3/internal/connection/Exchange;Lokio/Sink;J)V .registers 6 .annotation system Ldalvik/annotation/Signature; value = { "(", "Lokio/Sink;", "J)V" } .end annotation const-string v0, "delegate" invoke-static {p2, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V .line 201 iput-object p1, p0, Lokhttp3/internal/connection/Exchange$RequestBodySink;->this$0:Lokhttp3/internal/connection/Exchange; .line 205 invoke-direct {p0, p2}, Lokio/ForwardingSink;->(Lokio/Sink;)V iput-wide p3, p0, Lokhttp3/internal/connection/Exchange$RequestBodySink;->contentLength:J return-void .end method .method private final complete(Ljava/io/IOException;)Ljava/io/IOException; .registers 9 .annotation system Ldalvik/annotation/Signature; value = { "(TE;)TE;" } .end annotation .line 250 iget-boolean v0, p0, Lokhttp3/internal/connection/Exchange$RequestBodySink;->completed:Z if-eqz v0, :cond_5 return-object p1 :cond_5 const/4 v0, 0x1 .line 251 iput-boolean v0, p0, Lokhttp3/internal/connection/Exchange$RequestBodySink;->completed:Z .line 252 iget-object v1, p0, Lokhttp3/internal/connection/Exchange$RequestBodySink;->this$0:Lokhttp3/internal/connection/Exchange; iget-wide v2, p0, Lokhttp3/internal/connection/Exchange$RequestBodySink;->bytesReceived:J const/4 v4, 0x0 const/4 v5, 0x1 move-object v6, p1 invoke-virtual/range {v1 .. v6}, Lokhttp3/internal/connection/Exchange;->bodyComplete(JZZLjava/io/IOException;)Ljava/io/IOException; move-result-object p1 return-object p1 .end method # virtual methods .method public close()V .registers 5 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation .line 236 iget-boolean v0, p0, Lokhttp3/internal/connection/Exchange$RequestBodySink;->closed:Z if-eqz v0, :cond_5 return-void :cond_5 const/4 v0, 0x1 .line 237 iput-boolean v0, p0, Lokhttp3/internal/connection/Exchange$RequestBodySink;->closed:Z .line 238 iget-wide v0, p0, Lokhttp3/internal/connection/Exchange$RequestBodySink;->contentLength:J const-wide/16 v2, -0x1 cmp-long v2, v0, v2 if-eqz v2, :cond_21 iget-wide v2, p0, Lokhttp3/internal/connection/Exchange$RequestBodySink;->bytesReceived:J cmp-long v0, v2, v0 if-nez v0, :cond_17 goto :goto_21 .line 239 :cond_17 new-instance v0, Ljava/net/ProtocolException; const-string v1, "unexpected end of stream" invoke-direct {v0, v1}, Ljava/net/ProtocolException;->(Ljava/lang/String;)V check-cast v0, Ljava/lang/Throwable; throw v0 .line 242 :cond_21 :goto_21 :try_start_21 invoke-super {p0}, Lokio/ForwardingSink;->close()V const/4 v0, 0x0 .line 243 invoke-direct {p0, v0}, Lokhttp3/internal/connection/Exchange$RequestBodySink;->complete(Ljava/io/IOException;)Ljava/io/IOException; :try_end_28 .catch Ljava/io/IOException; {:try_start_21 .. :try_end_28} :catch_29 return-void :catch_29 move-exception v0 .line 245 invoke-direct {p0, v0}, Lokhttp3/internal/connection/Exchange$RequestBodySink;->complete(Ljava/io/IOException;)Ljava/io/IOException; move-result-object v0 check-cast v0, Ljava/lang/Throwable; throw v0 .end method .method public flush()V .registers 2 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation .line 228 :try_start_0 invoke-super {p0}, Lokio/ForwardingSink;->flush()V :try_end_3 .catch Ljava/io/IOException; {:try_start_0 .. :try_end_3} :catch_4 return-void :catch_4 move-exception v0 .line 230 invoke-direct {p0, v0}, Lokhttp3/internal/connection/Exchange$RequestBodySink;->complete(Ljava/io/IOException;)Ljava/io/IOException; move-result-object v0 check-cast v0, Ljava/lang/Throwable; throw v0 .end method .method public write(Lokio/Buffer;J)V .registers 8 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation const-string v0, "source" invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V .line 212 iget-boolean v0, p0, Lokhttp3/internal/connection/Exchange$RequestBodySink;->closed:Z if-nez v0, :cond_50 .line 213 iget-wide v0, p0, Lokhttp3/internal/connection/Exchange$RequestBodySink;->contentLength:J const-wide/16 v2, -0x1 cmp-long v2, v0, v2 if-eqz v2, :cond_3f iget-wide v2, p0, Lokhttp3/internal/connection/Exchange$RequestBodySink;->bytesReceived:J add-long/2addr v2, p2 cmp-long v0, v2, v0 if-gtz v0, :cond_19 goto :goto_3f .line 214 :cond_19 new-instance p1, Ljava/net/ProtocolException; .line 215 new-instance v0, Ljava/lang/StringBuilder; const-string v1, "expected " invoke-direct {v0, v1}, Ljava/lang/StringBuilder;->(Ljava/lang/String;)V iget-wide v1, p0, Lokhttp3/internal/connection/Exchange$RequestBodySink;->contentLength:J invoke-virtual {v0, v1, v2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder; move-result-object v0 const-string v1, " bytes but received " invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 iget-wide v1, p0, Lokhttp3/internal/connection/Exchange$RequestBodySink;->bytesReceived:J add-long/2addr v1, p2 invoke-virtual {v0, v1, v2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder; move-result-object p2 invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p2 .line 214 invoke-direct {p1, p2}, Ljava/net/ProtocolException;->(Ljava/lang/String;)V check-cast p1, Ljava/lang/Throwable; throw p1 .line 218 :cond_3f :goto_3f :try_start_3f invoke-super {p0, p1, p2, p3}, Lokio/ForwardingSink;->write(Lokio/Buffer;J)V .line 219 iget-wide v0, p0, Lokhttp3/internal/connection/Exchange$RequestBodySink;->bytesReceived:J add-long/2addr v0, p2 iput-wide v0, p0, Lokhttp3/internal/connection/Exchange$RequestBodySink;->bytesReceived:J :try_end_47 .catch Ljava/io/IOException; {:try_start_3f .. :try_end_47} :catch_48 return-void :catch_48 move-exception p1 .line 221 invoke-direct {p0, p1}, Lokhttp3/internal/connection/Exchange$RequestBodySink;->complete(Ljava/io/IOException;)Ljava/io/IOException; move-result-object p1 check-cast p1, Ljava/lang/Throwable; throw p1 .line 212 :cond_50 new-instance p1, Ljava/lang/IllegalStateException; const-string p2, "closed" invoke-virtual {p2}, Ljava/lang/Object;->toString()Ljava/lang/String; move-result-object p2 invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;->(Ljava/lang/String;)V check-cast p1, Ljava/lang/Throwable; throw p1 .end method