.class final Lokio/OutputStreamSink; .super Ljava/lang/Object; .source "JvmOkio.kt" # interfaces .implements Lokio/Sink; # annotations .annotation system Ldalvik/annotation/SourceDebugExtension; value = "SMAP\nJvmOkio.kt\nKotlin\n*S Kotlin\n*F\n+ 1 JvmOkio.kt\nokio/OutputStreamSink\n+ 2 -Util.kt\nokio/-Util\n*L\n1#1,199:1\n75#2:200\n*E\n*S KotlinDebug\n*F\n+ 1 JvmOkio.kt\nokio/OutputStreamSink\n*L\n52#1:200\n*E\n" .end annotation .annotation runtime Lkotlin/Metadata; bv = { 0x1, 0x0, 0x3 } d1 = { "\u00004\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0008\u0002\n\u0002\u0010\u0002\n\u0002\u0008\u0002\n\u0002\u0010\u000e\n\u0002\u0008\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\t\n\u0000\u0008\u0002\u0018\u00002\u00020\u0001B\u0015\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0005\u00a2\u0006\u0002\u0010\u0006J\u0008\u0010\u0007\u001a\u00020\u0008H\u0016J\u0008\u0010\t\u001a\u00020\u0008H\u0016J\u0008\u0010\u0004\u001a\u00020\u0005H\u0016J\u0008\u0010\n\u001a\u00020\u000bH\u0016J\u0018\u0010\u000c\u001a\u00020\u00082\u0006\u0010\r\u001a\u00020\u000e2\u0006\u0010\u000f\u001a\u00020\u0010H\u0016R\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u0004\u001a\u00020\u0005X\u0082\u0004\u00a2\u0006\u0002\n\u0000\u00a8\u0006\u0011" } d2 = { "Lokio/OutputStreamSink;", "Lokio/Sink;", "out", "Ljava/io/OutputStream;", "timeout", "Lokio/Timeout;", "(Ljava/io/OutputStream;Lokio/Timeout;)V", "close", "", "flush", "toString", "", "write", "source", "Lokio/Buffer;", "byteCount", "", "okio" } k = 0x1 mv = { 0x1, 0x4, 0x0 } .end annotation # instance fields .field private final out:Ljava/io/OutputStream; .field private final timeout:Lokio/Timeout; # direct methods .method public constructor (Ljava/io/OutputStream;Lokio/Timeout;)V .locals 1 const-string v0, "out" invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V const-string v0, "timeout" invoke-static {p2, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V .line 41 invoke-direct {p0}, Ljava/lang/Object;->()V iput-object p1, p0, Lokio/OutputStreamSink;->out:Ljava/io/OutputStream; iput-object p2, p0, Lokio/OutputStreamSink;->timeout:Lokio/Timeout; return-void .end method # virtual methods .method public close()V .locals 0 iget-object p0, p0, Lokio/OutputStreamSink;->out:Ljava/io/OutputStream; .line 68 invoke-virtual {p0}, Ljava/io/OutputStream;->close()V return-void .end method .method public flush()V .locals 0 iget-object p0, p0, Lokio/OutputStreamSink;->out:Ljava/io/OutputStream; .line 66 invoke-virtual {p0}, Ljava/io/OutputStream;->flush()V return-void .end method .method public timeout()Lokio/Timeout; .locals 0 iget-object p0, p0, Lokio/OutputStreamSink;->timeout:Lokio/Timeout; return-object p0 .end method .method public toString()Ljava/lang/String; .locals 2 .line 72 new-instance v0, Ljava/lang/StringBuilder; const-string v1, "sink(" invoke-direct {v0, v1}, Ljava/lang/StringBuilder;->(Ljava/lang/String;)V iget-object p0, p0, Lokio/OutputStreamSink;->out:Ljava/io/OutputStream; invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; move-result-object p0 const/16 v0, 0x29 invoke-virtual {p0, v0}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder; move-result-object p0 invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p0 return-object p0 .end method .method public write(Lokio/Buffer;J)V .locals 7 const-string v0, "source" invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V .line 47 invoke-virtual {p1}, Lokio/Buffer;->size()J move-result-wide v1 const-wide/16 v3, 0x0 move-wide v5, p2 invoke-static/range {v1 .. v6}, Lokio/-Util;->checkOffsetAndCount(JJJ)V :cond_0 :goto_0 const-wide/16 v0, 0x0 cmp-long v0, p2, v0 if-lez v0, :cond_1 iget-object v0, p0, Lokio/OutputStreamSink;->timeout:Lokio/Timeout; .line 50 invoke-virtual {v0}, Lokio/Timeout;->throwIfReached()V .line 51 iget-object v0, p1, Lokio/Buffer;->head:Lokio/Segment; invoke-static {v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;)V .line 52 iget v1, v0, Lokio/Segment;->limit:I iget v2, v0, Lokio/Segment;->pos:I sub-int/2addr v1, v2 int-to-long v1, v1 .line 200 invoke-static {p2, p3, v1, v2}, Ljava/lang/Math;->min(JJ)J move-result-wide v1 long-to-int v1, v1 iget-object v2, p0, Lokio/OutputStreamSink;->out:Ljava/io/OutputStream; .line 53 iget-object v3, v0, Lokio/Segment;->data:[B iget v4, v0, Lokio/Segment;->pos:I invoke-virtual {v2, v3, v4, v1}, Ljava/io/OutputStream;->write([BII)V .line 55 iget v2, v0, Lokio/Segment;->pos:I add-int/2addr v2, v1 iput v2, v0, Lokio/Segment;->pos:I int-to-long v1, v1 sub-long/2addr p2, v1 .line 57 invoke-virtual {p1}, Lokio/Buffer;->size()J move-result-wide v3 sub-long/2addr v3, v1 invoke-virtual {p1, v3, v4}, Lokio/Buffer;->setSize$okio(J)V .line 59 iget v1, v0, Lokio/Segment;->pos:I iget v2, v0, Lokio/Segment;->limit:I if-ne v1, v2, :cond_0 .line 60 invoke-virtual {v0}, Lokio/Segment;->pop()Lokio/Segment; move-result-object v1 iput-object v1, p1, Lokio/Buffer;->head:Lokio/Segment; .line 61 invoke-static {v0}, Lokio/SegmentPool;->recycle(Lokio/Segment;)V goto :goto_0 :cond_1 return-void .end method