Rabbit-R1/switch port/smali/smali_classes3/okio/InputStreamSource.smali

298 lines
7.1 KiB
Smali
Raw Normal View History

2024-05-21 16:08:36 -05:00
.class final Lokio/InputStreamSource;
.super Ljava/lang/Object;
.source "JvmOkio.kt"
# interfaces
.implements Lokio/Source;
# annotations
.annotation system Ldalvik/annotation/SourceDebugExtension;
value = "SMAP\nJvmOkio.kt\nKotlin\n*S Kotlin\n*F\n+ 1 JvmOkio.kt\nokio/InputStreamSource\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n+ 3 -Util.kt\nokio/-Util\n*L\n1#1,199:1\n1#2:200\n75#3:201\n*E\n*S KotlinDebug\n*F\n+ 1 JvmOkio.kt\nokio/InputStreamSource\n*L\n89#1:201\n*E\n"
.end annotation
.annotation runtime Lkotlin/Metadata;
bv = {
0x1,
0x0,
0x3
}
d1 = {
"\u00002\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\u0000\n\u0002\u0010\t\n\u0000\n\u0002\u0018\u0002\n\u0002\u0008\u0002\n\u0002\u0010\u000e\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\u0018\u0010\t\u001a\u00020\n2\u0006\u0010\u000b\u001a\u00020\u000c2\u0006\u0010\r\u001a\u00020\nH\u0016J\u0008\u0010\u0004\u001a\u00020\u0005H\u0016J\u0008\u0010\u000e\u001a\u00020\u000fH\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\u0010"
}
d2 = {
"Lokio/InputStreamSource;",
"Lokio/Source;",
"input",
"Ljava/io/InputStream;",
"timeout",
"Lokio/Timeout;",
"(Ljava/io/InputStream;Lokio/Timeout;)V",
"close",
"",
"read",
"",
"sink",
"Lokio/Buffer;",
"byteCount",
"toString",
"",
"okio"
}
k = 0x1
mv = {
0x1,
0x4,
0x0
}
.end annotation
# instance fields
.field private final input:Ljava/io/InputStream;
.field private final timeout:Lokio/Timeout;
# direct methods
.method public constructor <init>(Ljava/io/InputStream;Lokio/Timeout;)V
.locals 1
const-string v0, "input"
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 78
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
iput-object p1, p0, Lokio/InputStreamSource;->input:Ljava/io/InputStream;
iput-object p2, p0, Lokio/InputStreamSource;->timeout:Lokio/Timeout;
return-void
.end method
# virtual methods
.method public close()V
.locals 0
iget-object p0, p0, Lokio/InputStreamSource;->input:Ljava/io/InputStream;
.line 108
invoke-virtual {p0}, Ljava/io/InputStream;->close()V
return-void
.end method
.method public read(Lokio/Buffer;J)J
.locals 3
const-string v0, "sink"
invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
const-wide/16 v0, 0x0
cmp-long v2, p2, v0
if-nez v2, :cond_0
return-wide v0
:cond_0
const/4 v0, 0x1
if-ltz v2, :cond_1
move v1, v0
goto :goto_0
:cond_1
const/4 v1, 0x0
:goto_0
if-eqz v1, :cond_5
:try_start_0
iget-object v1, p0, Lokio/InputStreamSource;->timeout:Lokio/Timeout;
.line 87
invoke-virtual {v1}, Lokio/Timeout;->throwIfReached()V
.line 88
invoke-virtual {p1, v0}, Lokio/Buffer;->writableSegment$okio(I)Lokio/Segment;
move-result-object v0
.line 89
iget v1, v0, Lokio/Segment;->limit:I
rsub-int v1, v1, 0x2000
int-to-long v1, v1
.line 201
invoke-static {p2, p3, v1, v2}, Ljava/lang/Math;->min(JJ)J
move-result-wide p2
long-to-int p2, p2
iget-object p0, p0, Lokio/InputStreamSource;->input:Ljava/io/InputStream;
.line 90
iget-object p3, v0, Lokio/Segment;->data:[B
iget v1, v0, Lokio/Segment;->limit:I
invoke-virtual {p0, p3, v1, p2}, Ljava/io/InputStream;->read([BII)I
move-result p0
const/4 p2, -0x1
if-ne p0, p2, :cond_3
.line 92
iget p0, v0, Lokio/Segment;->pos:I
iget p2, v0, Lokio/Segment;->limit:I
if-ne p0, p2, :cond_2
.line 94
invoke-virtual {v0}, Lokio/Segment;->pop()Lokio/Segment;
move-result-object p0
iput-object p0, p1, Lokio/Buffer;->head:Lokio/Segment;
.line 95
invoke-static {v0}, Lokio/SegmentPool;->recycle(Lokio/Segment;)V
:cond_2
const-wide/16 p0, -0x1
return-wide p0
.line 99
:cond_3
iget p2, v0, Lokio/Segment;->limit:I
add-int/2addr p2, p0
iput p2, v0, Lokio/Segment;->limit:I
.line 100
invoke-virtual {p1}, Lokio/Buffer;->size()J
move-result-wide p2
int-to-long v0, p0
add-long/2addr p2, v0
invoke-virtual {p1, p2, p3}, Lokio/Buffer;->setSize$okio(J)V
:try_end_0
.catch Ljava/lang/AssertionError; {:try_start_0 .. :try_end_0} :catch_0
return-wide v0
:catch_0
move-exception p0
.line 103
invoke-static {p0}, Lokio/Okio;->isAndroidGetsocknameError(Ljava/lang/AssertionError;)Z
move-result p1
if-eqz p1, :cond_4
new-instance p1, Ljava/io/IOException;
check-cast p0, Ljava/lang/Throwable;
invoke-direct {p1, p0}, Ljava/io/IOException;-><init>(Ljava/lang/Throwable;)V
check-cast p1, Ljava/lang/Throwable;
throw p1
.line 104
:cond_4
check-cast p0, Ljava/lang/Throwable;
throw p0
.line 85
:cond_5
new-instance p0, Ljava/lang/StringBuilder;
const-string p1, "byteCount < 0: "
invoke-direct {p0, p1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {p0, p2, p3}, Ljava/lang/StringBuilder;->append(J)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 timeout()Lokio/Timeout;
.locals 0
iget-object p0, p0, Lokio/InputStreamSource;->timeout:Lokio/Timeout;
return-object p0
.end method
.method public toString()Ljava/lang/String;
.locals 2
.line 112
new-instance v0, Ljava/lang/StringBuilder;
const-string v1, "source("
invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
iget-object p0, p0, Lokio/InputStreamSource;->input:Ljava/io/InputStream;
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