.class public final Lokio/Segment; .super Ljava/lang/Object; .source "Segment.kt" # annotations .annotation system Ldalvik/annotation/MemberClasses; value = { Lokio/Segment$Companion; } .end annotation .annotation system Ldalvik/annotation/SourceDebugExtension; value = "SMAP\nSegment.kt\nKotlin\n*S Kotlin\n*F\n+ 1 Segment.kt\nokio/Segment\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,183:1\n1#2:184\n*E\n" .end annotation .annotation runtime Lkotlin/Metadata; bv = { 0x1, 0x0, 0x3 } d1 = { "\u0000*\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0008\u0002\n\u0002\u0010\u0012\n\u0000\n\u0002\u0010\u0008\n\u0002\u0008\u0002\n\u0002\u0010\u000b\n\u0002\u0008\u0005\n\u0002\u0010\u0002\n\u0002\u0008\u000b\u0008\u0000\u0018\u0000 \u00192\u00020\u0001:\u0001\u0019B\u0007\u0008\u0016\u00a2\u0006\u0002\u0010\u0002B/\u0008\u0016\u0012\u0006\u0010\u0003\u001a\u00020\u0004\u0012\u0006\u0010\u0005\u001a\u00020\u0006\u0012\u0006\u0010\u0007\u001a\u00020\u0006\u0012\u0006\u0010\u0008\u001a\u00020\t\u0012\u0006\u0010\n\u001a\u00020\t\u00a2\u0006\u0002\u0010\u000bJ\u0006\u0010\u000e\u001a\u00020\u000fJ\u0008\u0010\u0010\u001a\u0004\u0018\u00010\u0000J\u000e\u0010\u0011\u001a\u00020\u00002\u0006\u0010\u0012\u001a\u00020\u0000J\u0006\u0010\u0013\u001a\u00020\u0000J\u000e\u0010\u0014\u001a\u00020\u00002\u0006\u0010\u0015\u001a\u00020\u0006J\u0006\u0010\u0016\u001a\u00020\u0000J\u0016\u0010\u0017\u001a\u00020\u000f2\u0006\u0010\u0018\u001a\u00020\u00002\u0006\u0010\u0015\u001a\u00020\u0006R\u0010\u0010\u0003\u001a\u00020\u00048\u0006X\u0087\u0004\u00a2\u0006\u0002\n\u0000R\u0012\u0010\u0007\u001a\u00020\u00068\u0006@\u0006X\u0087\u000e\u00a2\u0006\u0002\n\u0000R\u0014\u0010\u000c\u001a\u0004\u0018\u00010\u00008\u0006@\u0006X\u0087\u000e\u00a2\u0006\u0002\n\u0000R\u0012\u0010\n\u001a\u00020\t8\u0006@\u0006X\u0087\u000e\u00a2\u0006\u0002\n\u0000R\u0012\u0010\u0005\u001a\u00020\u00068\u0006@\u0006X\u0087\u000e\u00a2\u0006\u0002\n\u0000R\u0014\u0010\r\u001a\u0004\u0018\u00010\u00008\u0006@\u0006X\u0087\u000e\u00a2\u0006\u0002\n\u0000R\u0012\u0010\u0008\u001a\u00020\t8\u0006@\u0006X\u0087\u000e\u00a2\u0006\u0002\n\u0000\u00a8\u0006\u001a" } d2 = { "Lokio/Segment;", "", "()V", "data", "", "pos", "", "limit", "shared", "", "owner", "([BIIZZ)V", "next", "prev", "compact", "", "pop", "push", "segment", "sharedCopy", "split", "byteCount", "unsharedCopy", "writeTo", "sink", "Companion", "okio" } k = 0x1 mv = { 0x1, 0x4, 0x0 } .end annotation # static fields .field public static final Companion:Lokio/Segment$Companion; .field public static final SHARE_MINIMUM:I = 0x400 .field public static final SIZE:I = 0x2000 # instance fields .field public final data:[B .field public limit:I .field public next:Lokio/Segment; .field public owner:Z .field public pos:I .field public prev:Lokio/Segment; .field public shared:Z # direct methods .method static constructor ()V .locals 2 new-instance v0, Lokio/Segment$Companion; const/4 v1, 0x0 invoke-direct {v0, v1}, Lokio/Segment$Companion;->(Lkotlin/jvm/internal/DefaultConstructorMarker;)V sput-object v0, Lokio/Segment;->Companion:Lokio/Segment$Companion; return-void .end method .method public constructor ()V .locals 1 .line 62 invoke-direct {p0}, Ljava/lang/Object;->()V const/16 v0, 0x2000 new-array v0, v0, [B iput-object v0, p0, Lokio/Segment;->data:[B const/4 v0, 0x1 iput-boolean v0, p0, Lokio/Segment;->owner:Z const/4 v0, 0x0 iput-boolean v0, p0, Lokio/Segment;->shared:Z return-void .end method .method public constructor ([BIIZZ)V .locals 1 const-string v0, "data" invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V .line 68 invoke-direct {p0}, Ljava/lang/Object;->()V iput-object p1, p0, Lokio/Segment;->data:[B iput p2, p0, Lokio/Segment;->pos:I iput p3, p0, Lokio/Segment;->limit:I iput-boolean p4, p0, Lokio/Segment;->shared:Z iput-boolean p5, p0, Lokio/Segment;->owner:Z return-void .end method # virtual methods .method public final compact()V .locals 4 iget-object v0, p0, Lokio/Segment;->prev:Lokio/Segment; .line 147 move-object v1, p0 check-cast v1, Lokio/Segment; const/4 v1, 0x0 if-eq v0, p0, :cond_0 const/4 v2, 0x1 goto :goto_0 :cond_0 move v2, v1 :goto_0 if-eqz v2, :cond_4 .line 148 invoke-static {v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;)V iget-boolean v0, v0, Lokio/Segment;->owner:Z if-nez v0, :cond_1 return-void :cond_1 iget v0, p0, Lokio/Segment;->limit:I iget v2, p0, Lokio/Segment;->pos:I sub-int/2addr v0, v2 iget-object v2, p0, Lokio/Segment;->prev:Lokio/Segment; .line 150 invoke-static {v2}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;)V iget v2, v2, Lokio/Segment;->limit:I rsub-int v2, v2, 0x2000 iget-object v3, p0, Lokio/Segment;->prev:Lokio/Segment; invoke-static {v3}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;)V iget-boolean v3, v3, Lokio/Segment;->shared:Z if-eqz v3, :cond_2 goto :goto_1 :cond_2 iget-object v1, p0, Lokio/Segment;->prev:Lokio/Segment; invoke-static {v1}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;)V iget v1, v1, Lokio/Segment;->pos:I :goto_1 add-int/2addr v2, v1 if-le v0, v2, :cond_3 return-void :cond_3 iget-object v1, p0, Lokio/Segment;->prev:Lokio/Segment; .line 152 invoke-static {v1}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;)V invoke-virtual {p0, v1, v0}, Lokio/Segment;->writeTo(Lokio/Segment;I)V .line 153 invoke-virtual {p0}, Lokio/Segment;->pop()Lokio/Segment; .line 154 invoke-static {p0}, Lokio/SegmentPool;->recycle(Lokio/Segment;)V return-void .line 147 :cond_4 new-instance p0, Ljava/lang/IllegalStateException; const-string v0, "cannot compact" invoke-virtual {v0}, Ljava/lang/Object;->toString()Ljava/lang/String; move-result-object v0 invoke-direct {p0, v0}, Ljava/lang/IllegalStateException;->(Ljava/lang/String;)V check-cast p0, Ljava/lang/Throwable; throw p0 .end method .method public final pop()Lokio/Segment; .locals 4 iget-object v0, p0, Lokio/Segment;->next:Lokio/Segment; .line 93 move-object v1, p0 check-cast v1, Lokio/Segment; const/4 v1, 0x0 if-eq v0, p0, :cond_0 goto :goto_0 :cond_0 move-object v0, v1 :goto_0 iget-object v2, p0, Lokio/Segment;->prev:Lokio/Segment; .line 94 invoke-static {v2}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;)V iget-object v3, p0, Lokio/Segment;->next:Lokio/Segment; iput-object v3, v2, Lokio/Segment;->next:Lokio/Segment; iget-object v2, p0, Lokio/Segment;->next:Lokio/Segment; .line 95 invoke-static {v2}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;)V iget-object v3, p0, Lokio/Segment;->prev:Lokio/Segment; iput-object v3, v2, Lokio/Segment;->prev:Lokio/Segment; .line 96 move-object v2, v1 check-cast v2, Lokio/Segment; iput-object v1, p0, Lokio/Segment;->next:Lokio/Segment; iput-object v1, p0, Lokio/Segment;->prev:Lokio/Segment; return-object v0 .end method .method public final push(Lokio/Segment;)Lokio/Segment; .locals 1 const-string v0, "segment" invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V .line 105 move-object v0, p0 check-cast v0, Lokio/Segment; iput-object p0, p1, Lokio/Segment;->prev:Lokio/Segment; iget-object v0, p0, Lokio/Segment;->next:Lokio/Segment; .line 106 iput-object v0, p1, Lokio/Segment;->next:Lokio/Segment; iget-object v0, p0, Lokio/Segment;->next:Lokio/Segment; .line 107 invoke-static {v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;)V iput-object p1, v0, Lokio/Segment;->prev:Lokio/Segment; iput-object p1, p0, Lokio/Segment;->next:Lokio/Segment; return-object p1 .end method .method public final sharedCopy()Lokio/Segment; .locals 7 const/4 v0, 0x1 iput-boolean v0, p0, Lokio/Segment;->shared:Z .line 82 new-instance v0, Lokio/Segment; iget-object v2, p0, Lokio/Segment;->data:[B iget v3, p0, Lokio/Segment;->pos:I iget v4, p0, Lokio/Segment;->limit:I const/4 v5, 0x1 const/4 v6, 0x0 move-object v1, v0 invoke-direct/range {v1 .. v6}, Lokio/Segment;->([BIIZZ)V return-object v0 .end method .method public final split(I)Lokio/Segment; .locals 8 if-lez p1, :cond_0 iget v0, p0, Lokio/Segment;->limit:I iget v1, p0, Lokio/Segment;->pos:I sub-int/2addr v0, v1 if-gt p1, v0, :cond_0 const/4 v0, 0x1 goto :goto_0 :cond_0 const/4 v0, 0x0 :goto_0 if-eqz v0, :cond_2 const/16 v0, 0x400 if-lt p1, v0, :cond_1 .line 130 invoke-virtual {p0}, Lokio/Segment;->sharedCopy()Lokio/Segment; move-result-object v0 goto :goto_1 .line 132 :cond_1 invoke-static {}, Lokio/SegmentPool;->take()Lokio/Segment; move-result-object v0 iget-object v1, p0, Lokio/Segment;->data:[B .line 133 iget-object v2, v0, Lokio/Segment;->data:[B const/4 v3, 0x0 iget v4, p0, Lokio/Segment;->pos:I add-int v5, v4, p1 const/4 v6, 0x2 const/4 v7, 0x0 invoke-static/range {v1 .. v7}, Lkotlin/collections/ArraysKt;->copyInto$default([B[BIIIILjava/lang/Object;)[B .line 136 :goto_1 iget v1, v0, Lokio/Segment;->pos:I add-int/2addr v1, p1 iput v1, v0, Lokio/Segment;->limit:I iget v1, p0, Lokio/Segment;->pos:I add-int/2addr v1, p1 iput v1, p0, Lokio/Segment;->pos:I iget-object p0, p0, Lokio/Segment;->prev:Lokio/Segment; .line 138 invoke-static {p0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;)V invoke-virtual {p0, v0}, Lokio/Segment;->push(Lokio/Segment;)Lokio/Segment; return-object v0 .line 121 :cond_2 new-instance p0, Ljava/lang/IllegalArgumentException; const-string p1, "byteCount out of range" invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String; move-result-object p1 invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;->(Ljava/lang/String;)V check-cast p0, Ljava/lang/Throwable; throw p0 .end method .method public final unsharedCopy()Lokio/Segment; .locals 7 .line 86 new-instance v6, Lokio/Segment; iget-object v0, p0, Lokio/Segment;->data:[B array-length v1, v0 invoke-static {v0, v1}, Ljava/util/Arrays;->copyOf([BI)[B move-result-object v1 const-string v0, "java.util.Arrays.copyOf(this, size)" invoke-static {v1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V iget v2, p0, Lokio/Segment;->pos:I iget v3, p0, Lokio/Segment;->limit:I const/4 v4, 0x0 const/4 v5, 0x1 move-object v0, v6 invoke-direct/range {v0 .. v5}, Lokio/Segment;->([BIIZZ)V return-object v6 .end method .method public final writeTo(Lokio/Segment;I)V .locals 8 const-string v0, "sink" invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V .line 159 iget-boolean v0, p1, Lokio/Segment;->owner:Z if-eqz v0, :cond_3 .line 160 iget v5, p1, Lokio/Segment;->limit:I add-int v0, v5, p2 const/16 v1, 0x2000 if-le v0, v1, :cond_2 .line 162 iget-boolean v0, p1, Lokio/Segment;->shared:Z if-nez v0, :cond_1 add-int v0, v5, p2 .line 163 iget v4, p1, Lokio/Segment;->pos:I sub-int/2addr v0, v4 if-gt v0, v1, :cond_0 .line 164 iget-object v2, p1, Lokio/Segment;->data:[B const/4 v3, 0x0 const/4 v6, 0x2 const/4 v7, 0x0 move-object v1, v2 invoke-static/range {v1 .. v7}, Lkotlin/collections/ArraysKt;->copyInto$default([B[BIIIILjava/lang/Object;)[B .line 165 iget v0, p1, Lokio/Segment;->limit:I iget v1, p1, Lokio/Segment;->pos:I sub-int/2addr v0, v1 iput v0, p1, Lokio/Segment;->limit:I const/4 v0, 0x0 .line 166 iput v0, p1, Lokio/Segment;->pos:I goto :goto_0 .line 163 :cond_0 new-instance p0, Ljava/lang/IllegalArgumentException; invoke-direct {p0}, Ljava/lang/IllegalArgumentException;->()V check-cast p0, Ljava/lang/Throwable; throw p0 .line 162 :cond_1 new-instance p0, Ljava/lang/IllegalArgumentException; invoke-direct {p0}, Ljava/lang/IllegalArgumentException;->()V check-cast p0, Ljava/lang/Throwable; throw p0 :cond_2 :goto_0 iget-object v0, p0, Lokio/Segment;->data:[B .line 169 iget-object v1, p1, Lokio/Segment;->data:[B iget v2, p1, Lokio/Segment;->limit:I iget v3, p0, Lokio/Segment;->pos:I add-int v4, v3, p2 invoke-static {v0, v1, v2, v3, v4}, Lkotlin/collections/ArraysKt;->copyInto([B[BIII)[B .line 171 iget v0, p1, Lokio/Segment;->limit:I add-int/2addr v0, p2 iput v0, p1, Lokio/Segment;->limit:I iget p1, p0, Lokio/Segment;->pos:I add-int/2addr p1, p2 iput p1, p0, Lokio/Segment;->pos:I return-void .line 159 :cond_3 new-instance p0, Ljava/lang/IllegalStateException; const-string p1, "only owner can write" invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String; move-result-object p1 invoke-direct {p0, p1}, Ljava/lang/IllegalStateException;->(Ljava/lang/String;)V check-cast p0, Ljava/lang/Throwable; throw p0 .end method