mirror of
https://github.com/Pinball3D/Rabbit-R1.git
synced 2025-01-09 13:43:22 +00:00
1006 lines
21 KiB
Smali
1006 lines
21 KiB
Smali
.class public final Lokio/Buffer$UnsafeCursor;
|
|
.super Ljava/lang/Object;
|
|
.source "Buffer.kt"
|
|
|
|
# interfaces
|
|
.implements Ljava/io/Closeable;
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
value = Lokio/Buffer;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
accessFlags = 0x19
|
|
name = "UnsafeCursor"
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/SourceDebugExtension;
|
|
value = "SMAP\nBuffer.kt\nKotlin\n*S Kotlin\n*F\n+ 1 Buffer.kt\nokio/Buffer$UnsafeCursor\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n+ 3 -Util.kt\nokio/-Util\n*L\n1#1,1019:1\n1#2:1020\n75#3:1021\n*E\n*S KotlinDebug\n*F\n+ 1 Buffer.kt\nokio/Buffer$UnsafeCursor\n*L\n941#1:1021\n*E\n"
|
|
.end annotation
|
|
|
|
.annotation runtime Lkotlin/Metadata;
|
|
bv = {
|
|
0x1,
|
|
0x0,
|
|
0x3
|
|
}
|
|
d1 = {
|
|
"\u0000:\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0008\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0012\n\u0000\n\u0002\u0010\u0008\n\u0000\n\u0002\u0010\t\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0002\u0008\u0002\n\u0002\u0010\u0002\n\u0002\u0008\u0007\u0018\u00002\u00020\u0001B\u0005\u00a2\u0006\u0002\u0010\u0002J\u0008\u0010\u0010\u001a\u00020\u0011H\u0016J\u000e\u0010\u0012\u001a\u00020\n2\u0006\u0010\u0013\u001a\u00020\u0008J\u0006\u0010\u0014\u001a\u00020\u0008J\u000e\u0010\u0015\u001a\u00020\n2\u0006\u0010\u0016\u001a\u00020\nJ\u000e\u0010\u0017\u001a\u00020\u00082\u0006\u0010\t\u001a\u00020\nR\u0014\u0010\u0003\u001a\u0004\u0018\u00010\u00048\u0006@\u0006X\u0087\u000e\u00a2\u0006\u0002\n\u0000R\u0014\u0010\u0005\u001a\u0004\u0018\u00010\u00068\u0006@\u0006X\u0087\u000e\u00a2\u0006\u0002\n\u0000R\u0012\u0010\u0007\u001a\u00020\u00088\u0006@\u0006X\u0087\u000e\u00a2\u0006\u0002\n\u0000R\u0012\u0010\t\u001a\u00020\n8\u0006@\u0006X\u0087\u000e\u00a2\u0006\u0002\n\u0000R\u0012\u0010\u000b\u001a\u00020\u000c8\u0006@\u0006X\u0087\u000e\u00a2\u0006\u0002\n\u0000R\u0010\u0010\r\u001a\u0004\u0018\u00010\u000eX\u0082\u000e\u00a2\u0006\u0002\n\u0000R\u0012\u0010\u000f\u001a\u00020\u00088\u0006@\u0006X\u0087\u000e\u00a2\u0006\u0002\n\u0000\u00a8\u0006\u0018"
|
|
}
|
|
d2 = {
|
|
"Lokio/Buffer$UnsafeCursor;",
|
|
"Ljava/io/Closeable;",
|
|
"()V",
|
|
"buffer",
|
|
"Lokio/Buffer;",
|
|
"data",
|
|
"",
|
|
"end",
|
|
"",
|
|
"offset",
|
|
"",
|
|
"readWrite",
|
|
"",
|
|
"segment",
|
|
"Lokio/Segment;",
|
|
"start",
|
|
"close",
|
|
"",
|
|
"expandBuffer",
|
|
"minByteCount",
|
|
"next",
|
|
"resizeBuffer",
|
|
"newSize",
|
|
"seek",
|
|
"okio"
|
|
}
|
|
k = 0x1
|
|
mv = {
|
|
0x1,
|
|
0x4,
|
|
0x0
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field public buffer:Lokio/Buffer;
|
|
|
|
.field public data:[B
|
|
|
|
.field public end:I
|
|
|
|
.field public offset:J
|
|
|
|
.field public readWrite:Z
|
|
|
|
.field private segment:Lokio/Segment;
|
|
|
|
.field public start:I
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 2
|
|
|
|
.line 793
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
const-wide/16 v0, -0x1
|
|
|
|
iput-wide v0, p0, Lokio/Buffer$UnsafeCursor;->offset:J
|
|
|
|
const/4 v0, -0x1
|
|
|
|
iput v0, p0, Lokio/Buffer$UnsafeCursor;->start:I
|
|
|
|
iput v0, p0, Lokio/Buffer$UnsafeCursor;->end:I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public close()V
|
|
.locals 3
|
|
|
|
iget-object v0, p0, Lokio/Buffer$UnsafeCursor;->buffer:Lokio/Buffer;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
const/4 v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
if-eqz v0, :cond_1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
.line 1010
|
|
move-object v1, v0
|
|
|
|
check-cast v1, Lokio/Buffer;
|
|
|
|
iput-object v0, p0, Lokio/Buffer$UnsafeCursor;->buffer:Lokio/Buffer;
|
|
|
|
.line 1011
|
|
move-object v1, v0
|
|
|
|
check-cast v1, Lokio/Segment;
|
|
|
|
iput-object v0, p0, Lokio/Buffer$UnsafeCursor;->segment:Lokio/Segment;
|
|
|
|
const-wide/16 v1, -0x1
|
|
|
|
iput-wide v1, p0, Lokio/Buffer$UnsafeCursor;->offset:J
|
|
|
|
.line 1013
|
|
move-object v1, v0
|
|
|
|
check-cast v1, [B
|
|
|
|
iput-object v0, p0, Lokio/Buffer$UnsafeCursor;->data:[B
|
|
|
|
const/4 v0, -0x1
|
|
|
|
iput v0, p0, Lokio/Buffer$UnsafeCursor;->start:I
|
|
|
|
iput v0, p0, Lokio/Buffer$UnsafeCursor;->end:I
|
|
|
|
return-void
|
|
|
|
.line 1008
|
|
:cond_1
|
|
new-instance p0, Ljava/lang/IllegalStateException;
|
|
|
|
const-string v0, "not attached to a buffer"
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Object;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-direct {p0, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
|
|
|
check-cast p0, Ljava/lang/Throwable;
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
.method public final expandBuffer(I)J
|
|
.locals 9
|
|
|
|
const/4 v0, 0x1
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-lez p1, :cond_0
|
|
|
|
move v2, v0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
move v2, v1
|
|
|
|
:goto_0
|
|
if-eqz v2, :cond_5
|
|
|
|
const/16 v2, 0x2000
|
|
|
|
if-gt p1, v2, :cond_1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
move v0, v1
|
|
|
|
:goto_1
|
|
if-eqz v0, :cond_4
|
|
|
|
iget-object v0, p0, Lokio/Buffer$UnsafeCursor;->buffer:Lokio/Buffer;
|
|
|
|
if-eqz v0, :cond_3
|
|
|
|
iget-boolean v1, p0, Lokio/Buffer$UnsafeCursor;->readWrite:Z
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
.line 990
|
|
invoke-virtual {v0}, Lokio/Buffer;->size()J
|
|
|
|
move-result-wide v3
|
|
|
|
.line 991
|
|
invoke-virtual {v0, p1}, Lokio/Buffer;->writableSegment$okio(I)Lokio/Segment;
|
|
|
|
move-result-object p1
|
|
|
|
.line 992
|
|
iget v1, p1, Lokio/Segment;->limit:I
|
|
|
|
rsub-int v1, v1, 0x2000
|
|
|
|
.line 993
|
|
iput v2, p1, Lokio/Segment;->limit:I
|
|
|
|
int-to-long v5, v1
|
|
|
|
add-long v7, v3, v5
|
|
|
|
.line 994
|
|
invoke-virtual {v0, v7, v8}, Lokio/Buffer;->setSize$okio(J)V
|
|
|
|
iput-object p1, p0, Lokio/Buffer$UnsafeCursor;->segment:Lokio/Segment;
|
|
|
|
iput-wide v3, p0, Lokio/Buffer$UnsafeCursor;->offset:J
|
|
|
|
.line 999
|
|
iget-object p1, p1, Lokio/Segment;->data:[B
|
|
|
|
iput-object p1, p0, Lokio/Buffer$UnsafeCursor;->data:[B
|
|
|
|
rsub-int p1, v1, 0x2000
|
|
|
|
iput p1, p0, Lokio/Buffer$UnsafeCursor;->start:I
|
|
|
|
iput v2, p0, Lokio/Buffer$UnsafeCursor;->end:I
|
|
|
|
return-wide v5
|
|
|
|
.line 988
|
|
:cond_2
|
|
new-instance p0, Ljava/lang/IllegalStateException;
|
|
|
|
const-string p1, "expandBuffer() only permitted for read/write buffers"
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p0, p1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
|
|
|
check-cast p0, Ljava/lang/Throwable;
|
|
|
|
throw p0
|
|
|
|
.line 987
|
|
:cond_3
|
|
new-instance p0, Ljava/lang/IllegalStateException;
|
|
|
|
const-string p1, "not attached to a buffer"
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p0, p1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
|
|
|
check-cast p0, Ljava/lang/Throwable;
|
|
|
|
throw p0
|
|
|
|
.line 986
|
|
:cond_4
|
|
new-instance p0, Ljava/lang/StringBuilder;
|
|
|
|
const-string v0, "minByteCount > Segment.SIZE: "
|
|
|
|
invoke-direct {p0, v0}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p0, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
invoke-virtual {p0}, Ljava/lang/Object;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-direct {p1, p0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
check-cast p1, Ljava/lang/Throwable;
|
|
|
|
throw p1
|
|
|
|
.line 985
|
|
:cond_5
|
|
new-instance p0, Ljava/lang/StringBuilder;
|
|
|
|
const-string v0, "minByteCount <= 0: "
|
|
|
|
invoke-direct {p0, v0}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p0, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
invoke-virtual {p0}, Ljava/lang/Object;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-direct {p1, p0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
check-cast p1, Ljava/lang/Throwable;
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final next()I
|
|
.locals 4
|
|
|
|
iget-wide v0, p0, Lokio/Buffer$UnsafeCursor;->offset:J
|
|
|
|
iget-object v2, p0, Lokio/Buffer$UnsafeCursor;->buffer:Lokio/Buffer;
|
|
|
|
.line 809
|
|
invoke-static {v2}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;)V
|
|
|
|
invoke-virtual {v2}, Lokio/Buffer;->size()J
|
|
|
|
move-result-wide v2
|
|
|
|
cmp-long v0, v0, v2
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
const/4 v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
if-eqz v0, :cond_2
|
|
|
|
iget-wide v0, p0, Lokio/Buffer$UnsafeCursor;->offset:J
|
|
|
|
const-wide/16 v2, -0x1
|
|
|
|
cmp-long v2, v0, v2
|
|
|
|
if-nez v2, :cond_1
|
|
|
|
const-wide/16 v0, 0x0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
iget v2, p0, Lokio/Buffer$UnsafeCursor;->end:I
|
|
|
|
iget v3, p0, Lokio/Buffer$UnsafeCursor;->start:I
|
|
|
|
sub-int/2addr v2, v3
|
|
|
|
int-to-long v2, v2
|
|
|
|
add-long/2addr v0, v2
|
|
|
|
.line 810
|
|
:goto_1
|
|
invoke-virtual {p0, v0, v1}, Lokio/Buffer$UnsafeCursor;->seek(J)I
|
|
|
|
move-result p0
|
|
|
|
return p0
|
|
|
|
.line 809
|
|
:cond_2
|
|
new-instance p0, Ljava/lang/IllegalStateException;
|
|
|
|
const-string v0, "no more bytes"
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Object;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-direct {p0, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
|
|
|
check-cast p0, Ljava/lang/Throwable;
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
.method public final resizeBuffer(J)J
|
|
.locals 16
|
|
|
|
move-object/from16 v0, p0
|
|
|
|
move-wide/from16 v1, p1
|
|
|
|
iget-object v3, v0, Lokio/Buffer$UnsafeCursor;->buffer:Lokio/Buffer;
|
|
|
|
if-eqz v3, :cond_8
|
|
|
|
iget-boolean v4, v0, Lokio/Buffer$UnsafeCursor;->readWrite:Z
|
|
|
|
if-eqz v4, :cond_7
|
|
|
|
.line 912
|
|
invoke-virtual {v3}, Lokio/Buffer;->size()J
|
|
|
|
move-result-wide v4
|
|
|
|
cmp-long v6, v1, v4
|
|
|
|
const/4 v8, 0x1
|
|
|
|
const-wide/16 v9, 0x0
|
|
|
|
if-gtz v6, :cond_4
|
|
|
|
cmp-long v6, v1, v9
|
|
|
|
if-ltz v6, :cond_0
|
|
|
|
move v7, v8
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v7, 0x0
|
|
|
|
:goto_0
|
|
if-eqz v7, :cond_3
|
|
|
|
sub-long v6, v4, v1
|
|
|
|
:goto_1
|
|
cmp-long v8, v6, v9
|
|
|
|
if-lez v8, :cond_2
|
|
|
|
.line 918
|
|
iget-object v8, v3, Lokio/Buffer;->head:Lokio/Segment;
|
|
|
|
invoke-static {v8}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;)V
|
|
|
|
iget-object v8, v8, Lokio/Segment;->prev:Lokio/Segment;
|
|
|
|
.line 919
|
|
invoke-static {v8}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;)V
|
|
|
|
iget v11, v8, Lokio/Segment;->limit:I
|
|
|
|
iget v12, v8, Lokio/Segment;->pos:I
|
|
|
|
sub-int/2addr v11, v12
|
|
|
|
int-to-long v11, v11
|
|
|
|
cmp-long v13, v11, v6
|
|
|
|
if-gtz v13, :cond_1
|
|
|
|
.line 921
|
|
invoke-virtual {v8}, Lokio/Segment;->pop()Lokio/Segment;
|
|
|
|
move-result-object v13
|
|
|
|
iput-object v13, v3, Lokio/Buffer;->head:Lokio/Segment;
|
|
|
|
.line 922
|
|
invoke-static {v8}, Lokio/SegmentPool;->recycle(Lokio/Segment;)V
|
|
|
|
sub-long/2addr v6, v11
|
|
|
|
goto :goto_1
|
|
|
|
.line 925
|
|
:cond_1
|
|
iget v9, v8, Lokio/Segment;->limit:I
|
|
|
|
long-to-int v6, v6
|
|
|
|
sub-int/2addr v9, v6
|
|
|
|
iput v9, v8, Lokio/Segment;->limit:I
|
|
|
|
:cond_2
|
|
const/4 v6, 0x0
|
|
|
|
.line 930
|
|
move-object v7, v6
|
|
|
|
check-cast v7, Lokio/Segment;
|
|
|
|
iput-object v6, v0, Lokio/Buffer$UnsafeCursor;->segment:Lokio/Segment;
|
|
|
|
iput-wide v1, v0, Lokio/Buffer$UnsafeCursor;->offset:J
|
|
|
|
.line 932
|
|
move-object v7, v6
|
|
|
|
check-cast v7, [B
|
|
|
|
iput-object v6, v0, Lokio/Buffer$UnsafeCursor;->data:[B
|
|
|
|
const/4 v6, -0x1
|
|
|
|
iput v6, v0, Lokio/Buffer$UnsafeCursor;->start:I
|
|
|
|
iput v6, v0, Lokio/Buffer$UnsafeCursor;->end:I
|
|
|
|
goto :goto_3
|
|
|
|
.line 914
|
|
:cond_3
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
const-string v3, "newSize < 0: "
|
|
|
|
invoke-direct {v0, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v0, v1, v2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
new-instance v1, Ljava/lang/IllegalArgumentException;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Object;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-direct {v1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
check-cast v1, Ljava/lang/Throwable;
|
|
|
|
throw v1
|
|
|
|
:cond_4
|
|
if-lez v6, :cond_6
|
|
|
|
sub-long v11, v1, v4
|
|
|
|
move v6, v8
|
|
|
|
:goto_2
|
|
cmp-long v13, v11, v9
|
|
|
|
if-lez v13, :cond_6
|
|
|
|
.line 940
|
|
invoke-virtual {v3, v8}, Lokio/Buffer;->writableSegment$okio(I)Lokio/Segment;
|
|
|
|
move-result-object v13
|
|
|
|
.line 941
|
|
iget v14, v13, Lokio/Segment;->limit:I
|
|
|
|
rsub-int v14, v14, 0x2000
|
|
|
|
int-to-long v14, v14
|
|
|
|
.line 1021
|
|
invoke-static {v11, v12, v14, v15}, Ljava/lang/Math;->min(JJ)J
|
|
|
|
move-result-wide v14
|
|
|
|
long-to-int v14, v14
|
|
|
|
.line 942
|
|
iget v15, v13, Lokio/Segment;->limit:I
|
|
|
|
add-int/2addr v15, v14
|
|
|
|
iput v15, v13, Lokio/Segment;->limit:I
|
|
|
|
int-to-long v7, v14
|
|
|
|
sub-long/2addr v11, v7
|
|
|
|
if-eqz v6, :cond_5
|
|
|
|
iput-object v13, v0, Lokio/Buffer$UnsafeCursor;->segment:Lokio/Segment;
|
|
|
|
iput-wide v4, v0, Lokio/Buffer$UnsafeCursor;->offset:J
|
|
|
|
.line 949
|
|
iget-object v6, v13, Lokio/Segment;->data:[B
|
|
|
|
iput-object v6, v0, Lokio/Buffer$UnsafeCursor;->data:[B
|
|
|
|
.line 950
|
|
iget v6, v13, Lokio/Segment;->limit:I
|
|
|
|
sub-int/2addr v6, v14
|
|
|
|
iput v6, v0, Lokio/Buffer$UnsafeCursor;->start:I
|
|
|
|
.line 951
|
|
iget v6, v13, Lokio/Segment;->limit:I
|
|
|
|
iput v6, v0, Lokio/Buffer$UnsafeCursor;->end:I
|
|
|
|
const/4 v6, 0x0
|
|
|
|
:cond_5
|
|
const/4 v8, 0x1
|
|
|
|
goto :goto_2
|
|
|
|
.line 957
|
|
:cond_6
|
|
:goto_3
|
|
invoke-virtual {v3, v1, v2}, Lokio/Buffer;->setSize$okio(J)V
|
|
|
|
return-wide v4
|
|
|
|
.line 910
|
|
:cond_7
|
|
new-instance v0, Ljava/lang/IllegalStateException;
|
|
|
|
const-string v1, "resizeBuffer() only permitted for read/write buffers"
|
|
|
|
invoke-virtual {v1}, Ljava/lang/Object;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
|
|
|
check-cast v0, Ljava/lang/Throwable;
|
|
|
|
throw v0
|
|
|
|
.line 909
|
|
:cond_8
|
|
new-instance v0, Ljava/lang/IllegalStateException;
|
|
|
|
const-string v1, "not attached to a buffer"
|
|
|
|
invoke-virtual {v1}, Ljava/lang/Object;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
|
|
|
check-cast v0, Ljava/lang/Throwable;
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public final seek(J)I
|
|
.locals 12
|
|
|
|
iget-object v0, p0, Lokio/Buffer$UnsafeCursor;->buffer:Lokio/Buffer;
|
|
|
|
if-eqz v0, :cond_a
|
|
|
|
const/4 v1, -0x1
|
|
|
|
int-to-long v2, v1
|
|
|
|
cmp-long v2, p1, v2
|
|
|
|
if-ltz v2, :cond_9
|
|
|
|
.line 820
|
|
invoke-virtual {v0}, Lokio/Buffer;->size()J
|
|
|
|
move-result-wide v2
|
|
|
|
cmp-long v2, p1, v2
|
|
|
|
if-gtz v2, :cond_9
|
|
|
|
const-wide/16 v2, -0x1
|
|
|
|
cmp-long v2, p1, v2
|
|
|
|
if-eqz v2, :cond_8
|
|
|
|
.line 825
|
|
invoke-virtual {v0}, Lokio/Buffer;->size()J
|
|
|
|
move-result-wide v2
|
|
|
|
cmp-long v2, p1, v2
|
|
|
|
if-nez v2, :cond_0
|
|
|
|
goto/16 :goto_3
|
|
|
|
.line 836
|
|
:cond_0
|
|
invoke-virtual {v0}, Lokio/Buffer;->size()J
|
|
|
|
move-result-wide v1
|
|
|
|
.line 837
|
|
iget-object v3, v0, Lokio/Buffer;->head:Lokio/Segment;
|
|
|
|
.line 838
|
|
iget-object v4, v0, Lokio/Buffer;->head:Lokio/Segment;
|
|
|
|
iget-object v5, p0, Lokio/Buffer$UnsafeCursor;->segment:Lokio/Segment;
|
|
|
|
const-wide/16 v6, 0x0
|
|
|
|
if-eqz v5, :cond_2
|
|
|
|
iget-wide v8, p0, Lokio/Buffer$UnsafeCursor;->offset:J
|
|
|
|
iget v10, p0, Lokio/Buffer$UnsafeCursor;->start:I
|
|
|
|
.line 840
|
|
invoke-static {v5}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;)V
|
|
|
|
iget v5, v5, Lokio/Segment;->pos:I
|
|
|
|
sub-int/2addr v10, v5
|
|
|
|
int-to-long v10, v10
|
|
|
|
sub-long/2addr v8, v10
|
|
|
|
cmp-long v5, v8, p1
|
|
|
|
if-lez v5, :cond_1
|
|
|
|
iget-object v4, p0, Lokio/Buffer$UnsafeCursor;->segment:Lokio/Segment;
|
|
|
|
move-wide v1, v8
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
iget-object v3, p0, Lokio/Buffer$UnsafeCursor;->segment:Lokio/Segment;
|
|
|
|
move-wide v6, v8
|
|
|
|
:cond_2
|
|
:goto_0
|
|
sub-long v8, v1, p1
|
|
|
|
sub-long v10, p1, v6
|
|
|
|
cmp-long v5, v8, v10
|
|
|
|
if-lez v5, :cond_3
|
|
|
|
.line 858
|
|
:goto_1
|
|
invoke-static {v3}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;)V
|
|
|
|
iget v1, v3, Lokio/Segment;->limit:I
|
|
|
|
iget v2, v3, Lokio/Segment;->pos:I
|
|
|
|
sub-int/2addr v1, v2
|
|
|
|
int-to-long v1, v1
|
|
|
|
add-long/2addr v1, v6
|
|
|
|
cmp-long v1, p1, v1
|
|
|
|
if-ltz v1, :cond_5
|
|
|
|
.line 859
|
|
iget v1, v3, Lokio/Segment;->limit:I
|
|
|
|
iget v2, v3, Lokio/Segment;->pos:I
|
|
|
|
sub-int/2addr v1, v2
|
|
|
|
int-to-long v1, v1
|
|
|
|
add-long/2addr v6, v1
|
|
|
|
.line 860
|
|
iget-object v3, v3, Lokio/Segment;->next:Lokio/Segment;
|
|
|
|
goto :goto_1
|
|
|
|
:cond_3
|
|
:goto_2
|
|
cmp-long v3, v1, p1
|
|
|
|
if-lez v3, :cond_4
|
|
|
|
.line 867
|
|
invoke-static {v4}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;)V
|
|
|
|
iget-object v4, v4, Lokio/Segment;->prev:Lokio/Segment;
|
|
|
|
.line 868
|
|
invoke-static {v4}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;)V
|
|
|
|
iget v3, v4, Lokio/Segment;->limit:I
|
|
|
|
iget v5, v4, Lokio/Segment;->pos:I
|
|
|
|
sub-int/2addr v3, v5
|
|
|
|
int-to-long v5, v3
|
|
|
|
sub-long/2addr v1, v5
|
|
|
|
goto :goto_2
|
|
|
|
:cond_4
|
|
move-wide v6, v1
|
|
|
|
move-object v3, v4
|
|
|
|
:cond_5
|
|
iget-boolean v1, p0, Lokio/Buffer$UnsafeCursor;->readWrite:Z
|
|
|
|
if-eqz v1, :cond_7
|
|
|
|
.line 873
|
|
invoke-static {v3}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;)V
|
|
|
|
iget-boolean v1, v3, Lokio/Segment;->shared:Z
|
|
|
|
if-eqz v1, :cond_7
|
|
|
|
.line 874
|
|
invoke-virtual {v3}, Lokio/Segment;->unsharedCopy()Lokio/Segment;
|
|
|
|
move-result-object v1
|
|
|
|
.line 875
|
|
iget-object v2, v0, Lokio/Buffer;->head:Lokio/Segment;
|
|
|
|
if-ne v2, v3, :cond_6
|
|
|
|
.line 876
|
|
iput-object v1, v0, Lokio/Buffer;->head:Lokio/Segment;
|
|
|
|
.line 878
|
|
:cond_6
|
|
invoke-virtual {v3, v1}, Lokio/Segment;->push(Lokio/Segment;)Lokio/Segment;
|
|
|
|
move-result-object v3
|
|
|
|
.line 879
|
|
iget-object v0, v3, Lokio/Segment;->prev:Lokio/Segment;
|
|
|
|
invoke-static {v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;)V
|
|
|
|
invoke-virtual {v0}, Lokio/Segment;->pop()Lokio/Segment;
|
|
|
|
:cond_7
|
|
iput-object v3, p0, Lokio/Buffer$UnsafeCursor;->segment:Lokio/Segment;
|
|
|
|
iput-wide p1, p0, Lokio/Buffer$UnsafeCursor;->offset:J
|
|
|
|
.line 885
|
|
invoke-static {v3}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;)V
|
|
|
|
iget-object v0, v3, Lokio/Segment;->data:[B
|
|
|
|
iput-object v0, p0, Lokio/Buffer$UnsafeCursor;->data:[B
|
|
|
|
.line 886
|
|
iget v0, v3, Lokio/Segment;->pos:I
|
|
|
|
sub-long/2addr p1, v6
|
|
|
|
long-to-int p1, p1
|
|
|
|
add-int/2addr v0, p1
|
|
|
|
iput v0, p0, Lokio/Buffer$UnsafeCursor;->start:I
|
|
|
|
.line 887
|
|
iget p1, v3, Lokio/Segment;->limit:I
|
|
|
|
iput p1, p0, Lokio/Buffer$UnsafeCursor;->end:I
|
|
|
|
iget p0, p0, Lokio/Buffer$UnsafeCursor;->start:I
|
|
|
|
sub-int/2addr p1, p0
|
|
|
|
return p1
|
|
|
|
:cond_8
|
|
:goto_3
|
|
const/4 v0, 0x0
|
|
|
|
.line 826
|
|
move-object v2, v0
|
|
|
|
check-cast v2, Lokio/Segment;
|
|
|
|
iput-object v0, p0, Lokio/Buffer$UnsafeCursor;->segment:Lokio/Segment;
|
|
|
|
iput-wide p1, p0, Lokio/Buffer$UnsafeCursor;->offset:J
|
|
|
|
.line 828
|
|
move-object p1, v0
|
|
|
|
check-cast p1, [B
|
|
|
|
iput-object v0, p0, Lokio/Buffer$UnsafeCursor;->data:[B
|
|
|
|
iput v1, p0, Lokio/Buffer$UnsafeCursor;->start:I
|
|
|
|
iput v1, p0, Lokio/Buffer$UnsafeCursor;->end:I
|
|
|
|
return v1
|
|
|
|
.line 821
|
|
:cond_9
|
|
new-instance p0, Ljava/lang/ArrayIndexOutOfBoundsException;
|
|
|
|
.line 822
|
|
sget-object v1, Lkotlin/jvm/internal/StringCompanionObject;->INSTANCE:Lkotlin/jvm/internal/StringCompanionObject;
|
|
|
|
invoke-static {p1, p2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {v0}, Lokio/Buffer;->size()J
|
|
|
|
move-result-wide v0
|
|
|
|
invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object p2
|
|
|
|
filled-new-array {p1, p2}, [Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
const/4 p2, 0x2
|
|
|
|
invoke-static {p1, p2}, Ljava/util/Arrays;->copyOf([Ljava/lang/Object;I)[Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "offset=%s > size=%s"
|
|
|
|
invoke-static {p2, p1}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "java.lang.String.format(format, *args)"
|
|
|
|
invoke-static {p1, p2}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
.line 821
|
|
invoke-direct {p0, p1}, Ljava/lang/ArrayIndexOutOfBoundsException;-><init>(Ljava/lang/String;)V
|
|
|
|
check-cast p0, Ljava/lang/Throwable;
|
|
|
|
throw p0
|
|
|
|
.line 819
|
|
:cond_a
|
|
new-instance p0, Ljava/lang/IllegalStateException;
|
|
|
|
const-string p1, "not attached to a buffer"
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p0, p1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
|
|
|
check-cast p0, Ljava/lang/Throwable;
|
|
|
|
throw p0
|
|
.end method
|