Add Discord APKTool decompilation (Smali source for modding)

- Imported from https://github.com/supermegamestre/Project-Real-Resurrection-3
- APKTool decompilation (Smali bytecode) for modding and rebuilding APK
- Supports both 32-bit (armeabi-v7a) and 64-bit (arm64-v8a) architectures
- Includes full Smali source, resources, and native libraries
- Ready to rebuild APK after modifications with apktool b command
- Added comprehensive README-apktool.md with modding guide

This branch complements the JADX branches:
- Use JADX (main/discord-community) to UNDERSTAND code (readable Java)
- Use APKTool (this branch) to MODIFY and REBUILD APK (editable Smali)

Total: 44,417 files, 538.51 MB Smali source code
This commit is contained in:
2026-02-18 16:13:44 -08:00
parent c080f0d97f
commit f3960ee359
44288 changed files with 10998761 additions and 0 deletions

View File

@@ -0,0 +1,304 @@
.class public Lokio/AsyncTimeout$1;
.super Ljava/lang/Object;
.source "SourceFile"
# interfaces
.implements Lokio/Sink;
# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
value = Lokio/AsyncTimeout;->sink(Lokio/Sink;)Lokio/Sink;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x1
name = null
.end annotation
# instance fields
.field public final synthetic this$0:Lokio/AsyncTimeout;
.field public final synthetic val$sink:Lokio/Sink;
# direct methods
.method public constructor <init>(Lokio/AsyncTimeout;Lokio/Sink;)V
.locals 0
iput-object p1, p0, Lokio/AsyncTimeout$1;->this$0:Lokio/AsyncTimeout;
iput-object p2, p0, Lokio/AsyncTimeout$1;->val$sink:Lokio/Sink;
.line 160
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
# virtual methods
.method public close()V
.locals 3
iget-object v0, p0, Lokio/AsyncTimeout$1;->this$0:Lokio/AsyncTimeout;
.line 206
invoke-virtual {v0}, Lokio/AsyncTimeout;->enter()V
:try_start_0
iget-object v0, p0, Lokio/AsyncTimeout$1;->val$sink:Lokio/Sink;
.line 208
invoke-interface {v0}, Lokio/Sink;->close()V
:try_end_0
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
const/4 v0, 0x1
iget-object v1, p0, Lokio/AsyncTimeout$1;->this$0:Lokio/AsyncTimeout;
.line 213
invoke-virtual {v1, v0}, Lokio/AsyncTimeout;->exit(Z)V
return-void
:catchall_0
move-exception v0
goto :goto_0
:catch_0
move-exception v0
:try_start_1
iget-object v1, p0, Lokio/AsyncTimeout$1;->this$0:Lokio/AsyncTimeout;
.line 211
invoke-virtual {v1, v0}, Lokio/AsyncTimeout;->exit(Ljava/io/IOException;)Ljava/io/IOException;
move-result-object v0
throw v0
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
:goto_0
iget-object v1, p0, Lokio/AsyncTimeout$1;->this$0:Lokio/AsyncTimeout;
const/4 v2, 0x0
.line 213
invoke-virtual {v1, v2}, Lokio/AsyncTimeout;->exit(Z)V
throw v0
.end method
.method public flush()V
.locals 3
iget-object v0, p0, Lokio/AsyncTimeout$1;->this$0:Lokio/AsyncTimeout;
.line 193
invoke-virtual {v0}, Lokio/AsyncTimeout;->enter()V
:try_start_0
iget-object v0, p0, Lokio/AsyncTimeout$1;->val$sink:Lokio/Sink;
.line 195
invoke-interface {v0}, Lokio/Sink;->flush()V
:try_end_0
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
const/4 v0, 0x1
iget-object v1, p0, Lokio/AsyncTimeout$1;->this$0:Lokio/AsyncTimeout;
.line 200
invoke-virtual {v1, v0}, Lokio/AsyncTimeout;->exit(Z)V
return-void
:catchall_0
move-exception v0
goto :goto_0
:catch_0
move-exception v0
:try_start_1
iget-object v1, p0, Lokio/AsyncTimeout$1;->this$0:Lokio/AsyncTimeout;
.line 198
invoke-virtual {v1, v0}, Lokio/AsyncTimeout;->exit(Ljava/io/IOException;)Ljava/io/IOException;
move-result-object v0
throw v0
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
:goto_0
iget-object v1, p0, Lokio/AsyncTimeout$1;->this$0:Lokio/AsyncTimeout;
const/4 v2, 0x0
.line 200
invoke-virtual {v1, v2}, Lokio/AsyncTimeout;->exit(Z)V
throw v0
.end method
.method public timeout()Lokio/Timeout;
.locals 1
iget-object v0, p0, Lokio/AsyncTimeout$1;->this$0:Lokio/AsyncTimeout;
return-object v0
.end method
.method public toString()Ljava/lang/String;
.locals 2
.line 222
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
const-string v1, "AsyncTimeout.sink("
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
iget-object v1, p0, Lokio/AsyncTimeout$1;->val$sink:Lokio/Sink;
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
const-string v1, ")"
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
return-object v0
.end method
.method public write(Lokio/Buffer;J)V
.locals 6
.line 162
iget-wide v0, p1, Lokio/Buffer;->size:J
const-wide/16 v2, 0x0
move-wide v4, p2
invoke-static/range {v0 .. v5}, Lokio/Util;->checkOffsetAndCount(JJJ)V
:goto_0
const-wide/16 v0, 0x0
cmp-long v2, p2, v0
if-lez v2, :cond_2
.line 167
iget-object v2, p1, Lokio/Buffer;->head:Lokio/Segment;
:goto_1
const-wide/32 v3, 0x10000
cmp-long v3, v0, v3
if-gez v3, :cond_1
.line 168
iget v3, v2, Lokio/Segment;->limit:I
iget v4, v2, Lokio/Segment;->pos:I
sub-int/2addr v3, v4
int-to-long v3, v3
add-long/2addr v0, v3
cmp-long v3, v0, p2
if-ltz v3, :cond_0
move-wide v0, p2
goto :goto_2
.line 167
:cond_0
iget-object v2, v2, Lokio/Segment;->next:Lokio/Segment;
goto :goto_1
:cond_1
:goto_2
iget-object v2, p0, Lokio/AsyncTimeout$1;->this$0:Lokio/AsyncTimeout;
.line 178
invoke-virtual {v2}, Lokio/AsyncTimeout;->enter()V
:try_start_0
iget-object v2, p0, Lokio/AsyncTimeout$1;->val$sink:Lokio/Sink;
.line 180
invoke-interface {v2, p1, v0, v1}, Lokio/Sink;->write(Lokio/Buffer;J)V
:try_end_0
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
sub-long/2addr p2, v0
const/4 v0, 0x1
iget-object v1, p0, Lokio/AsyncTimeout$1;->this$0:Lokio/AsyncTimeout;
.line 186
invoke-virtual {v1, v0}, Lokio/AsyncTimeout;->exit(Z)V
goto :goto_0
:catchall_0
move-exception p1
goto :goto_3
:catch_0
move-exception p1
:try_start_1
iget-object p2, p0, Lokio/AsyncTimeout$1;->this$0:Lokio/AsyncTimeout;
.line 184
invoke-virtual {p2, p1}, Lokio/AsyncTimeout;->exit(Ljava/io/IOException;)Ljava/io/IOException;
move-result-object p1
throw p1
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
:goto_3
iget-object p2, p0, Lokio/AsyncTimeout$1;->this$0:Lokio/AsyncTimeout;
const/4 p3, 0x0
.line 186
invoke-virtual {p2, p3}, Lokio/AsyncTimeout;->exit(Z)V
throw p1
:cond_2
return-void
.end method

View File

@@ -0,0 +1,191 @@
.class public Lokio/AsyncTimeout$2;
.super Ljava/lang/Object;
.source "SourceFile"
# interfaces
.implements Lokio/Source;
# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
value = Lokio/AsyncTimeout;->source(Lokio/Source;)Lokio/Source;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x1
name = null
.end annotation
# instance fields
.field public final synthetic this$0:Lokio/AsyncTimeout;
.field public final synthetic val$source:Lokio/Source;
# direct methods
.method public constructor <init>(Lokio/AsyncTimeout;Lokio/Source;)V
.locals 0
iput-object p1, p0, Lokio/AsyncTimeout$2;->this$0:Lokio/AsyncTimeout;
iput-object p2, p0, Lokio/AsyncTimeout$2;->val$source:Lokio/Source;
.line 232
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
# virtual methods
.method public close()V
.locals 3
iget-object v0, p0, Lokio/AsyncTimeout$2;->this$0:Lokio/AsyncTimeout;
.line 249
invoke-virtual {v0}, Lokio/AsyncTimeout;->enter()V
:try_start_0
iget-object v0, p0, Lokio/AsyncTimeout$2;->val$source:Lokio/Source;
.line 251
invoke-interface {v0}, Lokio/Source;->close()V
:try_end_0
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
const/4 v0, 0x1
iget-object v1, p0, Lokio/AsyncTimeout$2;->this$0:Lokio/AsyncTimeout;
.line 256
invoke-virtual {v1, v0}, Lokio/AsyncTimeout;->exit(Z)V
return-void
:catchall_0
move-exception v0
goto :goto_0
:catch_0
move-exception v0
:try_start_1
iget-object v1, p0, Lokio/AsyncTimeout$2;->this$0:Lokio/AsyncTimeout;
.line 254
invoke-virtual {v1, v0}, Lokio/AsyncTimeout;->exit(Ljava/io/IOException;)Ljava/io/IOException;
move-result-object v0
throw v0
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
:goto_0
iget-object v1, p0, Lokio/AsyncTimeout$2;->this$0:Lokio/AsyncTimeout;
const/4 v2, 0x0
.line 256
invoke-virtual {v1, v2}, Lokio/AsyncTimeout;->exit(Z)V
throw v0
.end method
.method public read(Lokio/Buffer;J)J
.locals 1
iget-object v0, p0, Lokio/AsyncTimeout$2;->this$0:Lokio/AsyncTimeout;
.line 235
invoke-virtual {v0}, Lokio/AsyncTimeout;->enter()V
:try_start_0
iget-object v0, p0, Lokio/AsyncTimeout$2;->val$source:Lokio/Source;
.line 237
invoke-interface {v0, p1, p2, p3}, Lokio/Source;->read(Lokio/Buffer;J)J
move-result-wide p1
:try_end_0
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
const/4 p3, 0x1
iget-object v0, p0, Lokio/AsyncTimeout$2;->this$0:Lokio/AsyncTimeout;
.line 243
invoke-virtual {v0, p3}, Lokio/AsyncTimeout;->exit(Z)V
return-wide p1
:catchall_0
move-exception p1
goto :goto_0
:catch_0
move-exception p1
:try_start_1
iget-object p2, p0, Lokio/AsyncTimeout$2;->this$0:Lokio/AsyncTimeout;
.line 241
invoke-virtual {p2, p1}, Lokio/AsyncTimeout;->exit(Ljava/io/IOException;)Ljava/io/IOException;
move-result-object p1
throw p1
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
:goto_0
iget-object p2, p0, Lokio/AsyncTimeout$2;->this$0:Lokio/AsyncTimeout;
const/4 p3, 0x0
.line 243
invoke-virtual {p2, p3}, Lokio/AsyncTimeout;->exit(Z)V
throw p1
.end method
.method public timeout()Lokio/Timeout;
.locals 1
iget-object v0, p0, Lokio/AsyncTimeout$2;->this$0:Lokio/AsyncTimeout;
return-object v0
.end method
.method public toString()Ljava/lang/String;
.locals 2
.line 265
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
const-string v1, "AsyncTimeout.source("
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
iget-object v1, p0, Lokio/AsyncTimeout$2;->val$source:Lokio/Source;
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
const-string v1, ")"
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
return-object v0
.end method

View File

@@ -0,0 +1,108 @@
.class public final Lokio/AsyncTimeout$Watchdog;
.super Ljava/lang/Thread;
.source "SourceFile"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lokio/AsyncTimeout;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x19
name = "Watchdog"
.end annotation
# direct methods
.method public constructor <init>()V
.locals 1
const-string v0, "Okio Watchdog"
.line 304
invoke-direct {p0, v0}, Ljava/lang/Thread;-><init>(Ljava/lang/String;)V
const/4 v0, 0x1
.line 305
invoke-virtual {p0, v0}, Ljava/lang/Thread;->setDaemon(Z)V
return-void
.end method
# virtual methods
.method public run()V
.locals 3
:catch_0
:goto_0
:try_start_0
const-class v0, Lokio/AsyncTimeout;
.line 312
monitor-enter v0
:try_end_0
.catch Ljava/lang/InterruptedException; {:try_start_0 .. :try_end_0} :catch_0
.line 313
:try_start_1
invoke-static {}, Lokio/AsyncTimeout;->awaitTimeout()Lokio/AsyncTimeout;
move-result-object v1
if-nez v1, :cond_0
.line 316
monitor-exit v0
goto :goto_0
:catchall_0
move-exception v1
goto :goto_1
.line 320
:cond_0
sget-object v2, Lokio/AsyncTimeout;->head:Lokio/AsyncTimeout;
if-ne v1, v2, :cond_1
const/4 v1, 0x0
.line 321
sput-object v1, Lokio/AsyncTimeout;->head:Lokio/AsyncTimeout;
.line 322
monitor-exit v0
return-void
.line 324
:cond_1
monitor-exit v0
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
.line 327
:try_start_2
invoke-virtual {v1}, Lokio/AsyncTimeout;->timedOut()V
:try_end_2
.catch Ljava/lang/InterruptedException; {:try_start_2 .. :try_end_2} :catch_0
goto :goto_0
.line 324
:goto_1
:try_start_3
monitor-exit v0
:try_end_3
.catchall {:try_start_3 .. :try_end_3} :catchall_0
:try_start_4
throw v1
:try_end_4
.catch Ljava/lang/InterruptedException; {:try_start_4 .. :try_end_4} :catch_0
.end method

View File

@@ -0,0 +1,557 @@
.class public Lokio/AsyncTimeout;
.super Lokio/Timeout;
.source "SourceFile"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lokio/AsyncTimeout$Watchdog;
}
.end annotation
# static fields
.field public static final IDLE_TIMEOUT_MILLIS:J
.field public static final IDLE_TIMEOUT_NANOS:J
.field public static head:Lokio/AsyncTimeout;
# instance fields
.field public inQueue:Z
.field public next:Lokio/AsyncTimeout;
.field public timeoutAt:J
# direct methods
.method static constructor <clinit>()V
.locals 3
.line 50
sget-object v0, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit;
const-wide/16 v1, 0x3c
invoke-virtual {v0, v1, v2}, Ljava/util/concurrent/TimeUnit;->toMillis(J)J
move-result-wide v0
sput-wide v0, Lokio/AsyncTimeout;->IDLE_TIMEOUT_MILLIS:J
.line 51
sget-object v2, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;
invoke-virtual {v2, v0, v1}, Ljava/util/concurrent/TimeUnit;->toNanos(J)J
move-result-wide v0
sput-wide v0, Lokio/AsyncTimeout;->IDLE_TIMEOUT_NANOS:J
return-void
.end method
.method public constructor <init>()V
.locals 0
.line 41
invoke-direct {p0}, Lokio/Timeout;-><init>()V
return-void
.end method
.method public static awaitTimeout()Lokio/AsyncTimeout;
.locals 9
sget-object v0, Lokio/AsyncTimeout;->head:Lokio/AsyncTimeout;
.line 343
iget-object v0, v0, Lokio/AsyncTimeout;->next:Lokio/AsyncTimeout;
const-class v1, Lokio/AsyncTimeout;
const/4 v2, 0x0
if-nez v0, :cond_1
.line 347
invoke-static {}, Ljava/lang/System;->nanoTime()J
move-result-wide v3
sget-wide v5, Lokio/AsyncTimeout;->IDLE_TIMEOUT_MILLIS:J
.line 348
invoke-virtual {v1, v5, v6}, Ljava/lang/Object;->wait(J)V
sget-object v0, Lokio/AsyncTimeout;->head:Lokio/AsyncTimeout;
.line 349
iget-object v0, v0, Lokio/AsyncTimeout;->next:Lokio/AsyncTimeout;
if-nez v0, :cond_0
invoke-static {}, Ljava/lang/System;->nanoTime()J
move-result-wide v0
sub-long/2addr v0, v3
sget-wide v3, Lokio/AsyncTimeout;->IDLE_TIMEOUT_NANOS:J
cmp-long v0, v0, v3
if-ltz v0, :cond_0
sget-object v2, Lokio/AsyncTimeout;->head:Lokio/AsyncTimeout;
:cond_0
return-object v2
.line 354
:cond_1
invoke-static {}, Ljava/lang/System;->nanoTime()J
move-result-wide v3
invoke-virtual {v0, v3, v4}, Lokio/AsyncTimeout;->remainingNanos(J)J
move-result-wide v3
const-wide/16 v5, 0x0
cmp-long v5, v3, v5
if-lez v5, :cond_2
const-wide/32 v5, 0xf4240
.line 360
div-long v7, v3, v5
mul-long/2addr v5, v7
sub-long/2addr v3, v5
long-to-int v0, v3
.line 362
invoke-virtual {v1, v7, v8, v0}, Ljava/lang/Object;->wait(JI)V
return-object v2
:cond_2
sget-object v1, Lokio/AsyncTimeout;->head:Lokio/AsyncTimeout;
.line 367
iget-object v3, v0, Lokio/AsyncTimeout;->next:Lokio/AsyncTimeout;
iput-object v3, v1, Lokio/AsyncTimeout;->next:Lokio/AsyncTimeout;
.line 368
iput-object v2, v0, Lokio/AsyncTimeout;->next:Lokio/AsyncTimeout;
return-object v0
.end method
.method public static declared-synchronized cancelScheduledTimeout(Lokio/AsyncTimeout;)Z
.locals 3
const-class v0, Lokio/AsyncTimeout;
monitor-enter v0
:try_start_0
sget-object v1, Lokio/AsyncTimeout;->head:Lokio/AsyncTimeout;
:goto_0
if-eqz v1, :cond_1
.line 129
iget-object v2, v1, Lokio/AsyncTimeout;->next:Lokio/AsyncTimeout;
if-ne v2, p0, :cond_0
.line 130
iget-object v2, p0, Lokio/AsyncTimeout;->next:Lokio/AsyncTimeout;
iput-object v2, v1, Lokio/AsyncTimeout;->next:Lokio/AsyncTimeout;
const/4 v1, 0x0
.line 131
iput-object v1, p0, Lokio/AsyncTimeout;->next:Lokio/AsyncTimeout;
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
.line 132
monitor-exit v0
const/4 p0, 0x0
return p0
:catchall_0
move-exception p0
goto :goto_1
:cond_0
move-object v1, v2
goto :goto_0
.line 137
:cond_1
monitor-exit v0
const/4 p0, 0x1
return p0
:goto_1
monitor-exit v0
throw p0
.end method
.method public static declared-synchronized scheduleTimeout(Lokio/AsyncTimeout;JZ)V
.locals 5
const-class v0, Lokio/AsyncTimeout;
monitor-enter v0
:try_start_0
sget-object v1, Lokio/AsyncTimeout;->head:Lokio/AsyncTimeout;
if-nez v1, :cond_0
.line 87
new-instance v1, Lokio/AsyncTimeout;
invoke-direct {v1}, Lokio/AsyncTimeout;-><init>()V
sput-object v1, Lokio/AsyncTimeout;->head:Lokio/AsyncTimeout;
.line 88
new-instance v1, Lokio/AsyncTimeout$Watchdog;
invoke-direct {v1}, Lokio/AsyncTimeout$Watchdog;-><init>()V
invoke-virtual {v1}, Ljava/lang/Thread;->start()V
goto :goto_0
:catchall_0
move-exception p0
goto :goto_4
.line 91
:cond_0
:goto_0
invoke-static {}, Ljava/lang/System;->nanoTime()J
move-result-wide v1
const-wide/16 v3, 0x0
cmp-long v3, p1, v3
if-eqz v3, :cond_1
if-eqz p3, :cond_1
.line 95
invoke-virtual {p0}, Lokio/Timeout;->deadlineNanoTime()J
move-result-wide v3
sub-long/2addr v3, v1
invoke-static {p1, p2, v3, v4}, Ljava/lang/Math;->min(JJ)J
move-result-wide p1
add-long/2addr p1, v1
iput-wide p1, p0, Lokio/AsyncTimeout;->timeoutAt:J
goto :goto_1
:cond_1
if-eqz v3, :cond_2
add-long/2addr p1, v1
.line 97
iput-wide p1, p0, Lokio/AsyncTimeout;->timeoutAt:J
goto :goto_1
:cond_2
if-eqz p3, :cond_6
.line 99
invoke-virtual {p0}, Lokio/Timeout;->deadlineNanoTime()J
move-result-wide p1
iput-wide p1, p0, Lokio/AsyncTimeout;->timeoutAt:J
.line 105
:goto_1
invoke-virtual {p0, v1, v2}, Lokio/AsyncTimeout;->remainingNanos(J)J
move-result-wide p1
sget-object p3, Lokio/AsyncTimeout;->head:Lokio/AsyncTimeout;
.line 107
:goto_2
iget-object v3, p3, Lokio/AsyncTimeout;->next:Lokio/AsyncTimeout;
if-eqz v3, :cond_4
invoke-virtual {v3, v1, v2}, Lokio/AsyncTimeout;->remainingNanos(J)J
move-result-wide v3
cmp-long v3, p1, v3
if-gez v3, :cond_3
goto :goto_3
.line 106
:cond_3
iget-object p3, p3, Lokio/AsyncTimeout;->next:Lokio/AsyncTimeout;
goto :goto_2
.line 108
:cond_4
:goto_3
iget-object p1, p3, Lokio/AsyncTimeout;->next:Lokio/AsyncTimeout;
iput-object p1, p0, Lokio/AsyncTimeout;->next:Lokio/AsyncTimeout;
.line 109
iput-object p0, p3, Lokio/AsyncTimeout;->next:Lokio/AsyncTimeout;
sget-object p0, Lokio/AsyncTimeout;->head:Lokio/AsyncTimeout;
if-ne p3, p0, :cond_5
const-class p0, Lokio/AsyncTimeout;
.line 111
invoke-virtual {p0}, Ljava/lang/Object;->notify()V
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
.line 116
:cond_5
monitor-exit v0
return-void
.line 101
:cond_6
:try_start_1
new-instance p0, Ljava/lang/AssertionError;
invoke-direct {p0}, Ljava/lang/AssertionError;-><init>()V
throw p0
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
:goto_4
monitor-exit v0
throw p0
.end method
# virtual methods
.method public final enter()V
.locals 5
iget-boolean v0, p0, Lokio/AsyncTimeout;->inQueue:Z
if-nez v0, :cond_1
.line 74
invoke-virtual {p0}, Lokio/Timeout;->timeoutNanos()J
move-result-wide v0
.line 75
invoke-virtual {p0}, Lokio/Timeout;->hasDeadline()Z
move-result v2
const-wide/16 v3, 0x0
cmp-long v3, v0, v3
if-nez v3, :cond_0
if-nez v2, :cond_0
return-void
:cond_0
const/4 v3, 0x1
iput-boolean v3, p0, Lokio/AsyncTimeout;->inQueue:Z
.line 80
invoke-static {p0, v0, v1, v2}, Lokio/AsyncTimeout;->scheduleTimeout(Lokio/AsyncTimeout;JZ)V
return-void
.line 73
:cond_1
new-instance v0, Ljava/lang/IllegalStateException;
const-string v1, "Unbalanced enter/exit"
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw v0
.end method
.method public final exit(Ljava/io/IOException;)Ljava/io/IOException;
.locals 1
.line 285
invoke-virtual {p0}, Lokio/AsyncTimeout;->exit()Z
move-result v0
if-nez v0, :cond_0
return-object p1
.line 286
:cond_0
invoke-virtual {p0, p1}, Lokio/AsyncTimeout;->newTimeoutException(Ljava/io/IOException;)Ljava/io/IOException;
move-result-object p1
return-object p1
.end method
.method public final exit(Z)V
.locals 1
.line 275
invoke-virtual {p0}, Lokio/AsyncTimeout;->exit()Z
move-result v0
if-eqz v0, :cond_1
if-nez p1, :cond_0
goto :goto_0
:cond_0
const/4 p1, 0x0
.line 276
invoke-virtual {p0, p1}, Lokio/AsyncTimeout;->newTimeoutException(Ljava/io/IOException;)Ljava/io/IOException;
move-result-object p1
throw p1
:cond_1
:goto_0
return-void
.end method
.method public final exit()Z
.locals 2
iget-boolean v0, p0, Lokio/AsyncTimeout;->inQueue:Z
const/4 v1, 0x0
if-nez v0, :cond_0
return v1
:cond_0
iput-boolean v1, p0, Lokio/AsyncTimeout;->inQueue:Z
.line 122
invoke-static {p0}, Lokio/AsyncTimeout;->cancelScheduledTimeout(Lokio/AsyncTimeout;)Z
move-result v0
return v0
.end method
.method public newTimeoutException(Ljava/io/IOException;)Ljava/io/IOException;
.locals 2
.line 295
new-instance v0, Ljava/io/InterruptedIOException;
const-string v1, "timeout"
invoke-direct {v0, v1}, Ljava/io/InterruptedIOException;-><init>(Ljava/lang/String;)V
if-eqz p1, :cond_0
.line 297
invoke-virtual {v0, p1}, Ljava/lang/Throwable;->initCause(Ljava/lang/Throwable;)Ljava/lang/Throwable;
:cond_0
return-object v0
.end method
.method public final remainingNanos(J)J
.locals 2
iget-wide v0, p0, Lokio/AsyncTimeout;->timeoutAt:J
sub-long/2addr v0, p1
return-wide v0
.end method
.method public final sink(Lokio/Sink;)Lokio/Sink;
.locals 1
.line 160
new-instance v0, Lokio/AsyncTimeout$1;
invoke-direct {v0, p0, p1}, Lokio/AsyncTimeout$1;-><init>(Lokio/AsyncTimeout;Lokio/Sink;)V
return-object v0
.end method
.method public final source(Lokio/Source;)Lokio/Source;
.locals 1
.line 232
new-instance v0, Lokio/AsyncTimeout$2;
invoke-direct {v0, p0, p1}, Lokio/AsyncTimeout$2;-><init>(Lokio/AsyncTimeout;Lokio/Source;)V
return-object v0
.end method
.method public timedOut()V
.locals 0
return-void
.end method

View File

@@ -0,0 +1,701 @@
.class public abstract Lokio/Base64;
.super Ljava/lang/Object;
.source "SourceFile"
# static fields
.field public static final MAP:[B
.field public static final URL_MAP:[B
# direct methods
.method static constructor <clinit>()V
.locals 2
const/16 v0, 0x40
new-array v1, v0, [B
fill-array-data v1, :array_0
sput-object v1, Lokio/Base64;->MAP:[B
new-array v0, v0, [B
fill-array-data v0, :array_1
sput-object v0, Lokio/Base64;->URL_MAP:[B
return-void
nop
:array_0
.array-data 1
0x41t
0x42t
0x43t
0x44t
0x45t
0x46t
0x47t
0x48t
0x49t
0x4at
0x4bt
0x4ct
0x4dt
0x4et
0x4ft
0x50t
0x51t
0x52t
0x53t
0x54t
0x55t
0x56t
0x57t
0x58t
0x59t
0x5at
0x61t
0x62t
0x63t
0x64t
0x65t
0x66t
0x67t
0x68t
0x69t
0x6at
0x6bt
0x6ct
0x6dt
0x6et
0x6ft
0x70t
0x71t
0x72t
0x73t
0x74t
0x75t
0x76t
0x77t
0x78t
0x79t
0x7at
0x30t
0x31t
0x32t
0x33t
0x34t
0x35t
0x36t
0x37t
0x38t
0x39t
0x2bt
0x2ft
.end array-data
:array_1
.array-data 1
0x41t
0x42t
0x43t
0x44t
0x45t
0x46t
0x47t
0x48t
0x49t
0x4at
0x4bt
0x4ct
0x4dt
0x4et
0x4ft
0x50t
0x51t
0x52t
0x53t
0x54t
0x55t
0x56t
0x57t
0x58t
0x59t
0x5at
0x61t
0x62t
0x63t
0x64t
0x65t
0x66t
0x67t
0x68t
0x69t
0x6at
0x6bt
0x6ct
0x6dt
0x6et
0x6ft
0x70t
0x71t
0x72t
0x73t
0x74t
0x75t
0x76t
0x77t
0x78t
0x79t
0x7at
0x30t
0x31t
0x32t
0x33t
0x34t
0x35t
0x36t
0x37t
0x38t
0x39t
0x2dt
0x5ft
.end array-data
.end method
.method public static decode(Ljava/lang/String;)[B
.locals 15
.line 31
invoke-virtual {p0}, Ljava/lang/String;->length()I
move-result v0
:goto_0
const/16 v1, 0x9
const/16 v2, 0x20
const/16 v3, 0xd
const/16 v4, 0xa
if-lez v0, :cond_1
add-int/lit8 v5, v0, -0x1
.line 33
invoke-virtual {p0, v5}, Ljava/lang/String;->charAt(I)C
move-result v5
const/16 v6, 0x3d
if-eq v5, v6, :cond_0
if-eq v5, v4, :cond_0
if-eq v5, v3, :cond_0
if-eq v5, v2, :cond_0
if-eq v5, v1, :cond_0
goto :goto_1
:cond_0
add-int/lit8 v0, v0, -0x1
goto :goto_0
:cond_1
:goto_1
int-to-long v5, v0
const-wide/16 v7, 0x6
mul-long/2addr v5, v7
const-wide/16 v7, 0x8
.line 40
div-long/2addr v5, v7
long-to-int v5, v5
new-array v6, v5, [B
const/4 v7, 0x0
move v8, v7
move v9, v8
move v10, v9
move v11, v10
:goto_2
const/4 v12, 0x0
if-ge v8, v0, :cond_b
.line 46
invoke-virtual {p0, v8}, Ljava/lang/String;->charAt(I)C
move-result v13
const/16 v14, 0x41
if-lt v13, v14, :cond_2
const/16 v14, 0x5a
if-gt v13, v14, :cond_2
add-int/lit8 v13, v13, -0x41
goto :goto_5
:cond_2
const/16 v14, 0x61
if-lt v13, v14, :cond_3
const/16 v14, 0x7a
if-gt v13, v14, :cond_3
add-int/lit8 v13, v13, -0x47
goto :goto_5
:cond_3
const/16 v14, 0x30
if-lt v13, v14, :cond_4
const/16 v14, 0x39
if-gt v13, v14, :cond_4
add-int/lit8 v13, v13, 0x4
goto :goto_5
:cond_4
const/16 v14, 0x2b
if-eq v13, v14, :cond_9
const/16 v14, 0x2d
if-ne v13, v14, :cond_5
goto :goto_4
:cond_5
const/16 v14, 0x2f
if-eq v13, v14, :cond_8
const/16 v14, 0x5f
if-ne v13, v14, :cond_6
goto :goto_3
:cond_6
if-eq v13, v4, :cond_a
if-eq v13, v3, :cond_a
if-eq v13, v2, :cond_a
if-ne v13, v1, :cond_7
goto :goto_6
:cond_7
return-object v12
:cond_8
:goto_3
const/16 v13, 0x3f
goto :goto_5
:cond_9
:goto_4
const/16 v13, 0x3e
:goto_5
shl-int/lit8 v10, v10, 0x6
int-to-byte v12, v13
or-int/2addr v10, v12
add-int/lit8 v9, v9, 0x1
.line 79
rem-int/lit8 v12, v9, 0x4
if-nez v12, :cond_a
add-int/lit8 v12, v11, 0x1
shr-int/lit8 v13, v10, 0x10
int-to-byte v13, v13
.line 80
aput-byte v13, v6, v11
add-int/lit8 v13, v11, 0x2
shr-int/lit8 v14, v10, 0x8
int-to-byte v14, v14
.line 81
aput-byte v14, v6, v12
add-int/lit8 v11, v11, 0x3
int-to-byte v12, v10
.line 82
aput-byte v12, v6, v13
:cond_a
:goto_6
add-int/lit8 v8, v8, 0x1
goto :goto_2
.line 86
:cond_b
rem-int/lit8 v9, v9, 0x4
const/4 p0, 0x1
if-ne v9, p0, :cond_c
return-object v12
:cond_c
const/4 p0, 0x2
if-ne v9, p0, :cond_d
shl-int/lit8 p0, v10, 0xc
add-int/lit8 v0, v11, 0x1
shr-int/lit8 p0, p0, 0x10
int-to-byte p0, p0
.line 93
aput-byte p0, v6, v11
move v11, v0
goto :goto_7
:cond_d
const/4 p0, 0x3
if-ne v9, p0, :cond_e
shl-int/lit8 p0, v10, 0x6
add-int/lit8 v0, v11, 0x1
shr-int/lit8 v1, p0, 0x10
int-to-byte v1, v1
.line 97
aput-byte v1, v6, v11
add-int/lit8 v11, v11, 0x2
shr-int/lit8 p0, p0, 0x8
int-to-byte p0, p0
.line 98
aput-byte p0, v6, v0
:cond_e
:goto_7
if-ne v11, v5, :cond_f
return-object v6
.line 105
:cond_f
new-array p0, v11, [B
.line 106
invoke-static {v6, v7, p0, v7, v11}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
return-object p0
.end method
.method public static encode([B)Ljava/lang/String;
.locals 1
sget-object v0, Lokio/Base64;->MAP:[B
.line 125
invoke-static {p0, v0}, Lokio/Base64;->encode([B[B)Ljava/lang/String;
move-result-object p0
return-object p0
.end method
.method public static encode([B[B)Ljava/lang/String;
.locals 10
.line 133
array-length v0, p0
const/4 v1, 0x2
add-int/2addr v0, v1
div-int/lit8 v0, v0, 0x3
mul-int/lit8 v0, v0, 0x4
.line 134
new-array v0, v0, [B
.line 135
array-length v2, p0
array-length v3, p0
rem-int/lit8 v3, v3, 0x3
sub-int/2addr v2, v3
const/4 v3, 0x0
move v4, v3
:goto_0
if-ge v3, v2, :cond_0
add-int/lit8 v5, v4, 0x1
.line 137
aget-byte v6, p0, v3
and-int/lit16 v6, v6, 0xff
shr-int/2addr v6, v1
aget-byte v6, p1, v6
aput-byte v6, v0, v4
add-int/lit8 v6, v4, 0x2
.line 138
aget-byte v7, p0, v3
and-int/lit8 v7, v7, 0x3
shl-int/lit8 v7, v7, 0x4
add-int/lit8 v8, v3, 0x1
aget-byte v9, p0, v8
and-int/lit16 v9, v9, 0xff
shr-int/lit8 v9, v9, 0x4
or-int/2addr v7, v9
aget-byte v7, p1, v7
aput-byte v7, v0, v5
add-int/lit8 v5, v4, 0x3
.line 139
aget-byte v7, p0, v8
and-int/lit8 v7, v7, 0xf
shl-int/2addr v7, v1
add-int/lit8 v8, v3, 0x2
aget-byte v9, p0, v8
and-int/lit16 v9, v9, 0xff
shr-int/lit8 v9, v9, 0x6
or-int/2addr v7, v9
aget-byte v7, p1, v7
aput-byte v7, v0, v6
add-int/lit8 v4, v4, 0x4
.line 140
aget-byte v6, p0, v8
and-int/lit8 v6, v6, 0x3f
aget-byte v6, p1, v6
aput-byte v6, v0, v5
add-int/lit8 v3, v3, 0x3
goto :goto_0
.line 142
:cond_0
array-length v3, p0
rem-int/lit8 v3, v3, 0x3
const/16 v5, 0x3d
const/4 v6, 0x1
if-eq v3, v6, :cond_2
if-eq v3, v1, :cond_1
goto :goto_1
:cond_1
add-int/lit8 v3, v4, 0x1
.line 150
aget-byte v7, p0, v2
and-int/lit16 v7, v7, 0xff
shr-int/2addr v7, v1
aget-byte v7, p1, v7
aput-byte v7, v0, v4
add-int/lit8 v7, v4, 0x2
.line 151
aget-byte v8, p0, v2
and-int/lit8 v8, v8, 0x3
shl-int/lit8 v8, v8, 0x4
add-int/2addr v2, v6
aget-byte v6, p0, v2
and-int/lit16 v6, v6, 0xff
shr-int/lit8 v6, v6, 0x4
or-int/2addr v6, v8
aget-byte v6, p1, v6
aput-byte v6, v0, v3
add-int/lit8 v4, v4, 0x3
.line 152
aget-byte p0, p0, v2
and-int/lit8 p0, p0, 0xf
shl-int/2addr p0, v1
aget-byte p0, p1, p0
aput-byte p0, v0, v7
.line 153
aput-byte v5, v0, v4
goto :goto_1
:cond_2
add-int/lit8 v3, v4, 0x1
.line 144
aget-byte v6, p0, v2
and-int/lit16 v6, v6, 0xff
shr-int/lit8 v1, v6, 0x2
aget-byte v1, p1, v1
aput-byte v1, v0, v4
add-int/lit8 v1, v4, 0x2
.line 145
aget-byte p0, p0, v2
and-int/lit8 p0, p0, 0x3
shl-int/lit8 p0, p0, 0x4
aget-byte p0, p1, p0
aput-byte p0, v0, v3
add-int/lit8 v4, v4, 0x3
.line 146
aput-byte v5, v0, v1
.line 147
aput-byte v5, v0, v4
.line 157
:goto_1
:try_start_0
new-instance p0, Ljava/lang/String;
const-string p1, "US-ASCII"
invoke-direct {p0, v0, p1}, Ljava/lang/String;-><init>([BLjava/lang/String;)V
:try_end_0
.catch Ljava/io/UnsupportedEncodingException; {:try_start_0 .. :try_end_0} :catch_0
return-object p0
:catch_0
move-exception p0
.line 159
new-instance p1, Ljava/lang/AssertionError;
invoke-direct {p1, p0}, Ljava/lang/AssertionError;-><init>(Ljava/lang/Object;)V
throw p1
.end method

View File

@@ -0,0 +1,122 @@
.class public Lokio/Buffer$2;
.super Ljava/io/InputStream;
.source "SourceFile"
# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
value = Lokio/Buffer;->inputStream()Ljava/io/InputStream;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x1
name = null
.end annotation
# instance fields
.field public final synthetic this$0:Lokio/Buffer;
# direct methods
.method public constructor <init>(Lokio/Buffer;)V
.locals 0
iput-object p1, p0, Lokio/Buffer$2;->this$0:Lokio/Buffer;
.line 125
invoke-direct {p0}, Ljava/io/InputStream;-><init>()V
return-void
.end method
# virtual methods
.method public available()I
.locals 4
iget-object v0, p0, Lokio/Buffer$2;->this$0:Lokio/Buffer;
.line 136
iget-wide v0, v0, Lokio/Buffer;->size:J
const-wide/32 v2, 0x7fffffff
invoke-static {v0, v1, v2, v3}, Ljava/lang/Math;->min(JJ)J
move-result-wide v0
long-to-int v0, v0
return v0
.end method
.method public close()V
.locals 0
return-void
.end method
.method public read()I
.locals 5
iget-object v0, p0, Lokio/Buffer$2;->this$0:Lokio/Buffer;
.line 127
iget-wide v1, v0, Lokio/Buffer;->size:J
const-wide/16 v3, 0x0
cmp-long v1, v1, v3
if-lez v1, :cond_0
invoke-virtual {v0}, Lokio/Buffer;->readByte()B
move-result v0
and-int/lit16 v0, v0, 0xff
return v0
:cond_0
const/4 v0, -0x1
return v0
.end method
.method public read([BII)I
.locals 1
iget-object v0, p0, Lokio/Buffer$2;->this$0:Lokio/Buffer;
.line 132
invoke-virtual {v0, p1, p2, p3}, Lokio/Buffer;->read([BII)I
move-result p1
return p1
.end method
.method public toString()Ljava/lang/String;
.locals 2
.line 143
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
iget-object v1, p0, Lokio/Buffer$2;->this$0:Lokio/Buffer;
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
const-string v1, ".inputStream()"
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
return-object v0
.end method

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,54 @@
.class public interface abstract Lokio/BufferedSink;
.super Ljava/lang/Object;
.source "SourceFile"
# interfaces
.implements Lokio/Sink;
.implements Ljava/nio/channels/WritableByteChannel;
# virtual methods
.method public abstract buffer()Lokio/Buffer;
.end method
.method public abstract emit()Lokio/BufferedSink;
.end method
.method public abstract emitCompleteSegments()Lokio/BufferedSink;
.end method
.method public abstract flush()V
.end method
.method public abstract write(Lokio/ByteString;)Lokio/BufferedSink;
.end method
.method public abstract write([B)Lokio/BufferedSink;
.end method
.method public abstract write([BII)Lokio/BufferedSink;
.end method
.method public abstract writeAll(Lokio/Source;)J
.end method
.method public abstract writeByte(I)Lokio/BufferedSink;
.end method
.method public abstract writeDecimalLong(J)Lokio/BufferedSink;
.end method
.method public abstract writeHexadecimalUnsignedLong(J)Lokio/BufferedSink;
.end method
.method public abstract writeInt(I)Lokio/BufferedSink;
.end method
.method public abstract writeIntLe(I)Lokio/BufferedSink;
.end method
.method public abstract writeShort(I)Lokio/BufferedSink;
.end method
.method public abstract writeUtf8(Ljava/lang/String;)Lokio/BufferedSink;
.end method

View File

@@ -0,0 +1,78 @@
.class public interface abstract Lokio/BufferedSource;
.super Ljava/lang/Object;
.source "SourceFile"
# interfaces
.implements Lokio/Source;
.implements Ljava/nio/channels/ReadableByteChannel;
# virtual methods
.method public abstract buffer()Lokio/Buffer;
.end method
.method public abstract exhausted()Z
.end method
.method public abstract getBuffer()Lokio/Buffer;
.end method
.method public abstract indexOf(B)J
.end method
.method public abstract inputStream()Ljava/io/InputStream;
.end method
.method public abstract readAll(Lokio/Sink;)J
.end method
.method public abstract readByte()B
.end method
.method public abstract readByteArray()[B
.end method
.method public abstract readByteArray(J)[B
.end method
.method public abstract readByteString(J)Lokio/ByteString;
.end method
.method public abstract readDecimalLong()J
.end method
.method public abstract readFully([B)V
.end method
.method public abstract readHexadecimalUnsignedLong()J
.end method
.method public abstract readInt()I
.end method
.method public abstract readIntLe()I
.end method
.method public abstract readShort()S
.end method
.method public abstract readShortLe()S
.end method
.method public abstract readString(Ljava/nio/charset/Charset;)Ljava/lang/String;
.end method
.method public abstract readUtf8LineStrict()Ljava/lang/String;
.end method
.method public abstract readUtf8LineStrict(J)Ljava/lang/String;
.end method
.method public abstract require(J)V
.end method
.method public abstract select(Lokio/Options;)I
.end method
.method public abstract skip(J)V
.end method

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,402 @@
.class public final Lokio/DeflaterSink;
.super Ljava/lang/Object;
.source "SourceFile"
# interfaces
.implements Lokio/Sink;
# instance fields
.field public closed:Z
.field public final deflater:Ljava/util/zip/Deflater;
.field public final sink:Lokio/BufferedSink;
# direct methods
.method public constructor <init>(Lokio/BufferedSink;Ljava/util/zip/Deflater;)V
.locals 0
.line 52
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
if-eqz p1, :cond_1
if-eqz p2, :cond_0
iput-object p1, p0, Lokio/DeflaterSink;->sink:Lokio/BufferedSink;
iput-object p2, p0, Lokio/DeflaterSink;->deflater:Ljava/util/zip/Deflater;
return-void
.line 54
:cond_0
new-instance p1, Ljava/lang/IllegalArgumentException;
const-string p2, "inflater == null"
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p1
.line 53
:cond_1
new-instance p1, Ljava/lang/IllegalArgumentException;
const-string p2, "source == null"
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p1
.end method
# virtual methods
.method public close()V
.locals 2
iget-boolean v0, p0, Lokio/DeflaterSink;->closed:Z
if-eqz v0, :cond_0
return-void
.line 128
:cond_0
:try_start_0
invoke-virtual {p0}, Lokio/DeflaterSink;->finishDeflate()V
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
const/4 v0, 0x0
goto :goto_0
:catchall_0
move-exception v0
:goto_0
:try_start_1
iget-object v1, p0, Lokio/DeflaterSink;->deflater:Ljava/util/zip/Deflater;
.line 134
invoke-virtual {v1}, Ljava/util/zip/Deflater;->end()V
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_1
goto :goto_1
:catchall_1
move-exception v1
if-nez v0, :cond_1
move-object v0, v1
:cond_1
:goto_1
:try_start_2
iget-object v1, p0, Lokio/DeflaterSink;->sink:Lokio/BufferedSink;
.line 140
invoke-interface {v1}, Lokio/Sink;->close()V
:try_end_2
.catchall {:try_start_2 .. :try_end_2} :catchall_2
goto :goto_2
:catchall_2
move-exception v1
if-nez v0, :cond_2
move-object v0, v1
:cond_2
:goto_2
const/4 v1, 0x1
iput-boolean v1, p0, Lokio/DeflaterSink;->closed:Z
if-eqz v0, :cond_3
.line 146
invoke-static {v0}, Lokio/Util;->sneakyRethrow(Ljava/lang/Throwable;)V
:cond_3
return-void
.end method
.method public final deflate(Z)V
.locals 7
iget-object v0, p0, Lokio/DeflaterSink;->sink:Lokio/BufferedSink;
.line 84
invoke-interface {v0}, Lokio/BufferedSink;->buffer()Lokio/Buffer;
move-result-object v0
:cond_0
:goto_0
const/4 v1, 0x1
.line 86
invoke-virtual {v0, v1}, Lokio/Buffer;->writableSegment(I)Lokio/Segment;
move-result-object v1
if-eqz p1, :cond_1
iget-object v2, p0, Lokio/DeflaterSink;->deflater:Ljava/util/zip/Deflater;
.line 93
iget-object v3, v1, Lokio/Segment;->data:[B
iget v4, v1, Lokio/Segment;->limit:I
rsub-int v5, v4, 0x2000
const/4 v6, 0x2
invoke-virtual {v2, v3, v4, v5, v6}, Ljava/util/zip/Deflater;->deflate([BIII)I
move-result v2
goto :goto_1
:cond_1
iget-object v2, p0, Lokio/DeflaterSink;->deflater:Ljava/util/zip/Deflater;
.line 94
iget-object v3, v1, Lokio/Segment;->data:[B
iget v4, v1, Lokio/Segment;->limit:I
rsub-int v5, v4, 0x2000
invoke-virtual {v2, v3, v4, v5}, Ljava/util/zip/Deflater;->deflate([BII)I
move-result v2
:goto_1
if-lez v2, :cond_2
.line 97
iget v3, v1, Lokio/Segment;->limit:I
add-int/2addr v3, v2
iput v3, v1, Lokio/Segment;->limit:I
.line 98
iget-wide v3, v0, Lokio/Buffer;->size:J
int-to-long v1, v2
add-long/2addr v3, v1
iput-wide v3, v0, Lokio/Buffer;->size:J
iget-object v1, p0, Lokio/DeflaterSink;->sink:Lokio/BufferedSink;
.line 99
invoke-interface {v1}, Lokio/BufferedSink;->emitCompleteSegments()Lokio/BufferedSink;
goto :goto_0
:cond_2
iget-object v2, p0, Lokio/DeflaterSink;->deflater:Ljava/util/zip/Deflater;
.line 100
invoke-virtual {v2}, Ljava/util/zip/Deflater;->needsInput()Z
move-result v2
if-eqz v2, :cond_0
.line 101
iget p1, v1, Lokio/Segment;->pos:I
iget v2, v1, Lokio/Segment;->limit:I
if-ne p1, v2, :cond_3
.line 103
invoke-virtual {v1}, Lokio/Segment;->pop()Lokio/Segment;
move-result-object p1
iput-object p1, v0, Lokio/Buffer;->head:Lokio/Segment;
.line 104
invoke-static {v1}, Lokio/SegmentPool;->recycle(Lokio/Segment;)V
:cond_3
return-void
.end method
.method public finishDeflate()V
.locals 1
iget-object v0, p0, Lokio/DeflaterSink;->deflater:Ljava/util/zip/Deflater;
.line 117
invoke-virtual {v0}, Ljava/util/zip/Deflater;->finish()V
const/4 v0, 0x0
.line 118
invoke-virtual {p0, v0}, Lokio/DeflaterSink;->deflate(Z)V
return-void
.end method
.method public flush()V
.locals 1
const/4 v0, 0x1
.line 112
invoke-virtual {p0, v0}, Lokio/DeflaterSink;->deflate(Z)V
iget-object v0, p0, Lokio/DeflaterSink;->sink:Lokio/BufferedSink;
.line 113
invoke-interface {v0}, Lokio/BufferedSink;->flush()V
return-void
.end method
.method public timeout()Lokio/Timeout;
.locals 1
iget-object v0, p0, Lokio/DeflaterSink;->sink:Lokio/BufferedSink;
.line 150
invoke-interface {v0}, Lokio/Sink;->timeout()Lokio/Timeout;
move-result-object v0
return-object v0
.end method
.method public toString()Ljava/lang/String;
.locals 2
.line 154
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
const-string v1, "DeflaterSink("
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
iget-object v1, p0, Lokio/DeflaterSink;->sink:Lokio/BufferedSink;
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
const-string v1, ")"
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
return-object v0
.end method
.method public write(Lokio/Buffer;J)V
.locals 6
.line 60
iget-wide v0, p1, Lokio/Buffer;->size:J
const-wide/16 v2, 0x0
move-wide v4, p2
invoke-static/range {v0 .. v5}, Lokio/Util;->checkOffsetAndCount(JJJ)V
:goto_0
const-wide/16 v0, 0x0
cmp-long v0, p2, v0
if-lez v0, :cond_1
.line 63
iget-object v0, p1, Lokio/Buffer;->head:Lokio/Segment;
.line 64
iget v1, v0, Lokio/Segment;->limit:I
iget v2, v0, Lokio/Segment;->pos:I
sub-int/2addr v1, v2
int-to-long v1, v1
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/DeflaterSink;->deflater:Ljava/util/zip/Deflater;
.line 65
iget-object v3, v0, Lokio/Segment;->data:[B
iget v4, v0, Lokio/Segment;->pos:I
invoke-virtual {v2, v3, v4, v1}, Ljava/util/zip/Deflater;->setInput([BII)V
const/4 v2, 0x0
.line 68
invoke-virtual {p0, v2}, Lokio/DeflaterSink;->deflate(Z)V
.line 71
iget-wide v2, p1, Lokio/Buffer;->size:J
int-to-long v4, v1
sub-long/2addr v2, v4
iput-wide v2, p1, Lokio/Buffer;->size:J
.line 72
iget v2, v0, Lokio/Segment;->pos:I
add-int/2addr v2, v1
iput v2, v0, Lokio/Segment;->pos:I
.line 73
iget v1, v0, Lokio/Segment;->limit:I
if-ne v2, v1, :cond_0
.line 74
invoke-virtual {v0}, Lokio/Segment;->pop()Lokio/Segment;
move-result-object v1
iput-object v1, p1, Lokio/Buffer;->head:Lokio/Segment;
.line 75
invoke-static {v0}, Lokio/SegmentPool;->recycle(Lokio/Segment;)V
:cond_0
sub-long/2addr p2, v4
goto :goto_0
:cond_1
return-void
.end method

View File

@@ -0,0 +1,124 @@
.class public abstract Lokio/ForwardingSink;
.super Ljava/lang/Object;
.source "SourceFile"
# interfaces
.implements Lokio/Sink;
# instance fields
.field public final delegate:Lokio/Sink;
# direct methods
.method public constructor <init>(Lokio/Sink;)V
.locals 1
.line 24
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
if-eqz p1, :cond_0
iput-object p1, p0, Lokio/ForwardingSink;->delegate:Lokio/Sink;
return-void
.line 25
:cond_0
new-instance p1, Ljava/lang/IllegalArgumentException;
const-string v0, "delegate == null"
invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p1
.end method
# virtual methods
.method public close()V
.locals 1
iget-object v0, p0, Lokio/ForwardingSink;->delegate:Lokio/Sink;
.line 47
invoke-interface {v0}, Lokio/Sink;->close()V
return-void
.end method
.method public flush()V
.locals 1
iget-object v0, p0, Lokio/ForwardingSink;->delegate:Lokio/Sink;
.line 39
invoke-interface {v0}, Lokio/Sink;->flush()V
return-void
.end method
.method public timeout()Lokio/Timeout;
.locals 1
iget-object v0, p0, Lokio/ForwardingSink;->delegate:Lokio/Sink;
.line 43
invoke-interface {v0}, Lokio/Sink;->timeout()Lokio/Timeout;
move-result-object v0
return-object v0
.end method
.method public toString()Ljava/lang/String;
.locals 2
.line 51
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String;
move-result-object v1
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v1, "("
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
iget-object v1, p0, Lokio/ForwardingSink;->delegate:Lokio/Sink;
invoke-virtual {v1}, Ljava/lang/Object;->toString()Ljava/lang/String;
move-result-object v1
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v1, ")"
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
return-object v0
.end method
.method public write(Lokio/Buffer;J)V
.locals 1
iget-object v0, p0, Lokio/ForwardingSink;->delegate:Lokio/Sink;
.line 35
invoke-interface {v0, p1, p2, p3}, Lokio/Sink;->write(Lokio/Buffer;J)V
return-void
.end method

View File

@@ -0,0 +1,128 @@
.class public abstract Lokio/ForwardingSource;
.super Ljava/lang/Object;
.source "SourceFile"
# interfaces
.implements Lokio/Source;
# instance fields
.field private final delegate:Lokio/Source;
# direct methods
.method public constructor <init>(Lokio/Source;)V
.locals 1
.line 24
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
if-eqz p1, :cond_0
iput-object p1, p0, Lokio/ForwardingSource;->delegate:Lokio/Source;
return-void
.line 25
:cond_0
new-instance p1, Ljava/lang/IllegalArgumentException;
const-string v0, "delegate == null"
invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p1
.end method
# virtual methods
.method public close()V
.locals 1
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
iget-object v0, p0, Lokio/ForwardingSource;->delegate:Lokio/Source;
.line 43
invoke-interface {v0}, Lokio/Source;->close()V
return-void
.end method
.method public final delegate()Lokio/Source;
.locals 1
iget-object v0, p0, Lokio/ForwardingSource;->delegate:Lokio/Source;
return-object v0
.end method
.method public read(Lokio/Buffer;J)J
.locals 1
iget-object v0, p0, Lokio/ForwardingSource;->delegate:Lokio/Source;
.line 35
invoke-interface {v0, p1, p2, p3}, Lokio/Source;->read(Lokio/Buffer;J)J
move-result-wide p1
return-wide p1
.end method
.method public timeout()Lokio/Timeout;
.locals 1
iget-object v0, p0, Lokio/ForwardingSource;->delegate:Lokio/Source;
.line 39
invoke-interface {v0}, Lokio/Source;->timeout()Lokio/Timeout;
move-result-object v0
return-object v0
.end method
.method public toString()Ljava/lang/String;
.locals 2
.line 47
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String;
move-result-object v1
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v1, "("
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
iget-object v1, p0, Lokio/ForwardingSource;->delegate:Lokio/Source;
invoke-virtual {v1}, Ljava/lang/Object;->toString()Ljava/lang/String;
move-result-object v1
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v1, ")"
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
return-object v0
.end method

View File

@@ -0,0 +1,151 @@
.class public Lokio/ForwardingTimeout;
.super Lokio/Timeout;
.source "SourceFile"
# instance fields
.field public delegate:Lokio/Timeout;
# direct methods
.method public constructor <init>(Lokio/Timeout;)V
.locals 1
.line 25
invoke-direct {p0}, Lokio/Timeout;-><init>()V
if-eqz p1, :cond_0
iput-object p1, p0, Lokio/ForwardingTimeout;->delegate:Lokio/Timeout;
return-void
.line 26
:cond_0
new-instance p1, Ljava/lang/IllegalArgumentException;
const-string v0, "delegate == null"
invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p1
.end method
# virtual methods
.method public clearDeadline()Lokio/Timeout;
.locals 1
iget-object v0, p0, Lokio/ForwardingTimeout;->delegate:Lokio/Timeout;
.line 66
invoke-virtual {v0}, Lokio/Timeout;->clearDeadline()Lokio/Timeout;
move-result-object v0
return-object v0
.end method
.method public clearTimeout()Lokio/Timeout;
.locals 1
iget-object v0, p0, Lokio/ForwardingTimeout;->delegate:Lokio/Timeout;
.line 62
invoke-virtual {v0}, Lokio/Timeout;->clearTimeout()Lokio/Timeout;
move-result-object v0
return-object v0
.end method
.method public deadlineNanoTime()J
.locals 2
iget-object v0, p0, Lokio/ForwardingTimeout;->delegate:Lokio/Timeout;
.line 54
invoke-virtual {v0}, Lokio/Timeout;->deadlineNanoTime()J
move-result-wide v0
return-wide v0
.end method
.method public deadlineNanoTime(J)Lokio/Timeout;
.locals 1
iget-object v0, p0, Lokio/ForwardingTimeout;->delegate:Lokio/Timeout;
.line 58
invoke-virtual {v0, p1, p2}, Lokio/Timeout;->deadlineNanoTime(J)Lokio/Timeout;
move-result-object p1
return-object p1
.end method
.method public final delegate()Lokio/Timeout;
.locals 1
iget-object v0, p0, Lokio/ForwardingTimeout;->delegate:Lokio/Timeout;
return-object v0
.end method
.method public hasDeadline()Z
.locals 1
iget-object v0, p0, Lokio/ForwardingTimeout;->delegate:Lokio/Timeout;
.line 50
invoke-virtual {v0}, Lokio/Timeout;->hasDeadline()Z
move-result v0
return v0
.end method
.method public final setDelegate(Lokio/Timeout;)Lokio/ForwardingTimeout;
.locals 1
if-eqz p1, :cond_0
iput-object p1, p0, Lokio/ForwardingTimeout;->delegate:Lokio/Timeout;
return-object p0
.line 36
:cond_0
new-instance p1, Ljava/lang/IllegalArgumentException;
const-string v0, "delegate == null"
invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method public throwIfReached()V
.locals 1
iget-object v0, p0, Lokio/ForwardingTimeout;->delegate:Lokio/Timeout;
.line 70
invoke-virtual {v0}, Lokio/Timeout;->throwIfReached()V
return-void
.end method
.method public timeout(JLjava/util/concurrent/TimeUnit;)Lokio/Timeout;
.locals 1
iget-object v0, p0, Lokio/ForwardingTimeout;->delegate:Lokio/Timeout;
.line 42
invoke-virtual {v0, p1, p2, p3}, Lokio/Timeout;->timeout(JLjava/util/concurrent/TimeUnit;)Lokio/Timeout;
move-result-object p1
return-object p1
.end method

View File

@@ -0,0 +1,348 @@
.class public final Lokio/GzipSink;
.super Ljava/lang/Object;
.source "SourceFile"
# interfaces
.implements Lokio/Sink;
# instance fields
.field public closed:Z
.field public final crc:Ljava/util/zip/CRC32;
.field public final deflater:Ljava/util/zip/Deflater;
.field public final deflaterSink:Lokio/DeflaterSink;
.field public final sink:Lokio/BufferedSink;
# direct methods
.method public constructor <init>(Lokio/Sink;)V
.locals 3
.line 56
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 54
new-instance v0, Ljava/util/zip/CRC32;
invoke-direct {v0}, Ljava/util/zip/CRC32;-><init>()V
iput-object v0, p0, Lokio/GzipSink;->crc:Ljava/util/zip/CRC32;
if-eqz p1, :cond_0
.line 58
new-instance v0, Ljava/util/zip/Deflater;
const/4 v1, -0x1
const/4 v2, 0x1
invoke-direct {v0, v1, v2}, Ljava/util/zip/Deflater;-><init>(IZ)V
iput-object v0, p0, Lokio/GzipSink;->deflater:Ljava/util/zip/Deflater;
.line 59
invoke-static {p1}, Lokio/Okio;->buffer(Lokio/Sink;)Lokio/BufferedSink;
move-result-object p1
iput-object p1, p0, Lokio/GzipSink;->sink:Lokio/BufferedSink;
.line 60
new-instance v1, Lokio/DeflaterSink;
invoke-direct {v1, p1, v0}, Lokio/DeflaterSink;-><init>(Lokio/BufferedSink;Ljava/util/zip/Deflater;)V
iput-object v1, p0, Lokio/GzipSink;->deflaterSink:Lokio/DeflaterSink;
.line 62
invoke-virtual {p0}, Lokio/GzipSink;->writeHeader()V
return-void
.line 57
:cond_0
new-instance p1, Ljava/lang/IllegalArgumentException;
const-string v0, "sink == null"
invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p1
.end method
# virtual methods
.method public close()V
.locals 2
iget-boolean v0, p0, Lokio/GzipSink;->closed:Z
if-eqz v0, :cond_0
return-void
:cond_0
:try_start_0
iget-object v0, p0, Lokio/GzipSink;->deflaterSink:Lokio/DeflaterSink;
.line 91
invoke-virtual {v0}, Lokio/DeflaterSink;->finishDeflate()V
.line 92
invoke-virtual {p0}, Lokio/GzipSink;->writeFooter()V
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
const/4 v0, 0x0
goto :goto_0
:catchall_0
move-exception v0
:goto_0
:try_start_1
iget-object v1, p0, Lokio/GzipSink;->deflater:Ljava/util/zip/Deflater;
.line 98
invoke-virtual {v1}, Ljava/util/zip/Deflater;->end()V
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_1
goto :goto_1
:catchall_1
move-exception v1
if-nez v0, :cond_1
move-object v0, v1
:cond_1
:goto_1
:try_start_2
iget-object v1, p0, Lokio/GzipSink;->sink:Lokio/BufferedSink;
.line 104
invoke-interface {v1}, Lokio/Sink;->close()V
:try_end_2
.catchall {:try_start_2 .. :try_end_2} :catchall_2
goto :goto_2
:catchall_2
move-exception v1
if-nez v0, :cond_2
move-object v0, v1
:cond_2
:goto_2
const/4 v1, 0x1
iput-boolean v1, p0, Lokio/GzipSink;->closed:Z
if-eqz v0, :cond_3
.line 110
invoke-static {v0}, Lokio/Util;->sneakyRethrow(Ljava/lang/Throwable;)V
:cond_3
return-void
.end method
.method public flush()V
.locals 1
iget-object v0, p0, Lokio/GzipSink;->deflaterSink:Lokio/DeflaterSink;
.line 74
invoke-virtual {v0}, Lokio/DeflaterSink;->flush()V
return-void
.end method
.method public timeout()Lokio/Timeout;
.locals 1
iget-object v0, p0, Lokio/GzipSink;->sink:Lokio/BufferedSink;
.line 78
invoke-interface {v0}, Lokio/Sink;->timeout()Lokio/Timeout;
move-result-object v0
return-object v0
.end method
.method public final updateCrc(Lokio/Buffer;J)V
.locals 4
.line 139
iget-object p1, p1, Lokio/Buffer;->head:Lokio/Segment;
:goto_0
const-wide/16 v0, 0x0
cmp-long v0, p2, v0
if-lez v0, :cond_0
.line 140
iget v0, p1, Lokio/Segment;->limit:I
iget v1, p1, Lokio/Segment;->pos:I
sub-int/2addr v0, v1
int-to-long v0, v0
invoke-static {p2, p3, v0, v1}, Ljava/lang/Math;->min(JJ)J
move-result-wide v0
long-to-int v0, v0
iget-object v1, p0, Lokio/GzipSink;->crc:Ljava/util/zip/CRC32;
.line 141
iget-object v2, p1, Lokio/Segment;->data:[B
iget v3, p1, Lokio/Segment;->pos:I
invoke-virtual {v1, v2, v3, v0}, Ljava/util/zip/CRC32;->update([BII)V
int-to-long v0, v0
sub-long/2addr p2, v0
.line 139
iget-object p1, p1, Lokio/Segment;->next:Lokio/Segment;
goto :goto_0
:cond_0
return-void
.end method
.method public write(Lokio/Buffer;J)V
.locals 2
const-wide/16 v0, 0x0
cmp-long v0, p2, v0
if-ltz v0, :cond_1
if-nez v0, :cond_0
return-void
.line 69
:cond_0
invoke-virtual {p0, p1, p2, p3}, Lokio/GzipSink;->updateCrc(Lokio/Buffer;J)V
iget-object v0, p0, Lokio/GzipSink;->deflaterSink:Lokio/DeflaterSink;
.line 70
invoke-virtual {v0, p1, p2, p3}, Lokio/DeflaterSink;->write(Lokio/Buffer;J)V
return-void
.line 66
:cond_1
new-instance p1, Ljava/lang/IllegalArgumentException;
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
const-string v1, "byteCount < 0: "
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0, p2, p3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p2
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method public final writeFooter()V
.locals 3
iget-object v0, p0, Lokio/GzipSink;->sink:Lokio/BufferedSink;
iget-object v1, p0, Lokio/GzipSink;->crc:Ljava/util/zip/CRC32;
.line 133
invoke-virtual {v1}, Ljava/util/zip/CRC32;->getValue()J
move-result-wide v1
long-to-int v1, v1
invoke-interface {v0, v1}, Lokio/BufferedSink;->writeIntLe(I)Lokio/BufferedSink;
iget-object v0, p0, Lokio/GzipSink;->sink:Lokio/BufferedSink;
iget-object v1, p0, Lokio/GzipSink;->deflater:Ljava/util/zip/Deflater;
.line 134
invoke-virtual {v1}, Ljava/util/zip/Deflater;->getBytesRead()J
move-result-wide v1
long-to-int v1, v1
invoke-interface {v0, v1}, Lokio/BufferedSink;->writeIntLe(I)Lokio/BufferedSink;
return-void
.end method
.method public final writeHeader()V
.locals 2
iget-object v0, p0, Lokio/GzipSink;->sink:Lokio/BufferedSink;
.line 123
invoke-interface {v0}, Lokio/BufferedSink;->buffer()Lokio/Buffer;
move-result-object v0
const/16 v1, 0x1f8b
.line 124
invoke-virtual {v0, v1}, Lokio/Buffer;->writeShort(I)Lokio/Buffer;
const/16 v1, 0x8
.line 125
invoke-virtual {v0, v1}, Lokio/Buffer;->writeByte(I)Lokio/Buffer;
const/4 v1, 0x0
.line 126
invoke-virtual {v0, v1}, Lokio/Buffer;->writeByte(I)Lokio/Buffer;
.line 127
invoke-virtual {v0, v1}, Lokio/Buffer;->writeInt(I)Lokio/Buffer;
.line 128
invoke-virtual {v0, v1}, Lokio/Buffer;->writeByte(I)Lokio/Buffer;
.line 129
invoke-virtual {v0, v1}, Lokio/Buffer;->writeByte(I)Lokio/Buffer;
return-void
.end method

View File

@@ -0,0 +1,684 @@
.class public final Lokio/GzipSource;
.super Ljava/lang/Object;
.source "SourceFile"
# interfaces
.implements Lokio/Source;
# instance fields
.field public final crc:Ljava/util/zip/CRC32;
.field public final inflater:Ljava/util/zip/Inflater;
.field public final inflaterSource:Lokio/InflaterSource;
.field public section:I
.field public final source:Lokio/BufferedSource;
# direct methods
.method public constructor <init>(Lokio/Source;)V
.locals 2
.line 60
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
const/4 v0, 0x0
iput v0, p0, Lokio/GzipSource;->section:I
.line 58
new-instance v0, Ljava/util/zip/CRC32;
invoke-direct {v0}, Ljava/util/zip/CRC32;-><init>()V
iput-object v0, p0, Lokio/GzipSource;->crc:Ljava/util/zip/CRC32;
if-eqz p1, :cond_0
.line 62
new-instance v0, Ljava/util/zip/Inflater;
const/4 v1, 0x1
invoke-direct {v0, v1}, Ljava/util/zip/Inflater;-><init>(Z)V
iput-object v0, p0, Lokio/GzipSource;->inflater:Ljava/util/zip/Inflater;
.line 63
invoke-static {p1}, Lokio/Okio;->buffer(Lokio/Source;)Lokio/BufferedSource;
move-result-object p1
iput-object p1, p0, Lokio/GzipSource;->source:Lokio/BufferedSource;
.line 64
new-instance v1, Lokio/InflaterSource;
invoke-direct {v1, p1, v0}, Lokio/InflaterSource;-><init>(Lokio/BufferedSource;Ljava/util/zip/Inflater;)V
iput-object v1, p0, Lokio/GzipSource;->inflaterSource:Lokio/InflaterSource;
return-void
.line 61
:cond_0
new-instance p1, Ljava/lang/IllegalArgumentException;
const-string v0, "source == null"
invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p1
.end method
# virtual methods
.method public final checkEqual(Ljava/lang/String;II)V
.locals 1
if-ne p3, p2, :cond_0
return-void
.line 205
:cond_0
new-instance v0, Ljava/io/IOException;
.line 206
invoke-static {p3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object p3
invoke-static {p2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object p2
filled-new-array {p1, p3, p2}, [Ljava/lang/Object;
move-result-object p1
const-string p2, "%s: actual 0x%08x != expected 0x%08x"
.line 205
invoke-static {p2, p1}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
move-result-object p1
invoke-direct {v0, p1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
throw v0
.end method
.method public close()V
.locals 1
iget-object v0, p0, Lokio/GzipSource;->inflaterSource:Lokio/InflaterSource;
.line 182
invoke-virtual {v0}, Lokio/InflaterSource;->close()V
return-void
.end method
.method public final consumeHeader()V
.locals 17
move-object/from16 v6, p0
iget-object v0, v6, Lokio/GzipSource;->source:Lokio/BufferedSource;
const-wide/16 v1, 0xa
.line 114
invoke-interface {v0, v1, v2}, Lokio/BufferedSource;->require(J)V
iget-object v0, v6, Lokio/GzipSource;->source:Lokio/BufferedSource;
.line 115
invoke-interface {v0}, Lokio/BufferedSource;->buffer()Lokio/Buffer;
move-result-object v0
const-wide/16 v1, 0x3
invoke-virtual {v0, v1, v2}, Lokio/Buffer;->getByte(J)B
move-result v7
shr-int/lit8 v0, v7, 0x1
const/4 v8, 0x1
and-int/2addr v0, v8
const/4 v9, 0x0
if-ne v0, v8, :cond_0
move v10, v8
goto :goto_0
:cond_0
move v10, v9
:goto_0
if-eqz v10, :cond_1
iget-object v0, v6, Lokio/GzipSource;->source:Lokio/BufferedSource;
.line 117
invoke-interface {v0}, Lokio/BufferedSource;->buffer()Lokio/Buffer;
move-result-object v1
const-wide/16 v2, 0x0
const-wide/16 v4, 0xa
move-object/from16 v0, p0
invoke-virtual/range {v0 .. v5}, Lokio/GzipSource;->updateCrc(Lokio/Buffer;JJ)V
:cond_1
iget-object v0, v6, Lokio/GzipSource;->source:Lokio/BufferedSource;
.line 119
invoke-interface {v0}, Lokio/BufferedSource;->readShort()S
move-result v0
const-string v1, "ID1ID2"
const/16 v2, 0x1f8b
.line 120
invoke-virtual {v6, v1, v2, v0}, Lokio/GzipSource;->checkEqual(Ljava/lang/String;II)V
iget-object v0, v6, Lokio/GzipSource;->source:Lokio/BufferedSource;
const-wide/16 v1, 0x8
.line 121
invoke-interface {v0, v1, v2}, Lokio/BufferedSource;->skip(J)V
shr-int/lit8 v0, v7, 0x2
and-int/2addr v0, v8
if-ne v0, v8, :cond_4
iget-object v0, v6, Lokio/GzipSource;->source:Lokio/BufferedSource;
const-wide/16 v1, 0x2
.line 128
invoke-interface {v0, v1, v2}, Lokio/BufferedSource;->require(J)V
if-eqz v10, :cond_2
iget-object v0, v6, Lokio/GzipSource;->source:Lokio/BufferedSource;
.line 129
invoke-interface {v0}, Lokio/BufferedSource;->buffer()Lokio/Buffer;
move-result-object v1
const-wide/16 v2, 0x0
const-wide/16 v4, 0x2
move-object/from16 v0, p0
invoke-virtual/range {v0 .. v5}, Lokio/GzipSource;->updateCrc(Lokio/Buffer;JJ)V
:cond_2
iget-object v0, v6, Lokio/GzipSource;->source:Lokio/BufferedSource;
.line 130
invoke-interface {v0}, Lokio/BufferedSource;->buffer()Lokio/Buffer;
move-result-object v0
invoke-virtual {v0}, Lokio/Buffer;->readShortLe()S
move-result v0
iget-object v1, v6, Lokio/GzipSource;->source:Lokio/BufferedSource;
int-to-long v11, v0
.line 131
invoke-interface {v1, v11, v12}, Lokio/BufferedSource;->require(J)V
if-eqz v10, :cond_3
iget-object v0, v6, Lokio/GzipSource;->source:Lokio/BufferedSource;
.line 132
invoke-interface {v0}, Lokio/BufferedSource;->buffer()Lokio/Buffer;
move-result-object v1
const-wide/16 v2, 0x0
move-object/from16 v0, p0
move-wide v4, v11
invoke-virtual/range {v0 .. v5}, Lokio/GzipSource;->updateCrc(Lokio/Buffer;JJ)V
:cond_3
iget-object v0, v6, Lokio/GzipSource;->source:Lokio/BufferedSource;
.line 133
invoke-interface {v0, v11, v12}, Lokio/BufferedSource;->skip(J)V
:cond_4
shr-int/lit8 v0, v7, 0x3
and-int/2addr v0, v8
const-wide/16 v11, -0x1
const-wide/16 v13, 0x1
if-ne v0, v8, :cond_7
iget-object v0, v6, Lokio/GzipSource;->source:Lokio/BufferedSource;
.line 141
invoke-interface {v0, v9}, Lokio/BufferedSource;->indexOf(B)J
move-result-wide v15
cmp-long v0, v15, v11
if-eqz v0, :cond_6
if-eqz v10, :cond_5
iget-object v0, v6, Lokio/GzipSource;->source:Lokio/BufferedSource;
.line 143
invoke-interface {v0}, Lokio/BufferedSource;->buffer()Lokio/Buffer;
move-result-object v1
const-wide/16 v2, 0x0
add-long v4, v15, v13
move-object/from16 v0, p0
invoke-virtual/range {v0 .. v5}, Lokio/GzipSource;->updateCrc(Lokio/Buffer;JJ)V
:cond_5
iget-object v0, v6, Lokio/GzipSource;->source:Lokio/BufferedSource;
add-long v1, v15, v13
.line 144
invoke-interface {v0, v1, v2}, Lokio/BufferedSource;->skip(J)V
goto :goto_1
.line 142
:cond_6
new-instance v0, Ljava/io/EOFException;
invoke-direct {v0}, Ljava/io/EOFException;-><init>()V
throw v0
:cond_7
:goto_1
shr-int/lit8 v0, v7, 0x4
and-int/2addr v0, v8
if-ne v0, v8, :cond_a
iget-object v0, v6, Lokio/GzipSource;->source:Lokio/BufferedSource;
.line 152
invoke-interface {v0, v9}, Lokio/BufferedSource;->indexOf(B)J
move-result-wide v7
cmp-long v0, v7, v11
if-eqz v0, :cond_9
if-eqz v10, :cond_8
iget-object v0, v6, Lokio/GzipSource;->source:Lokio/BufferedSource;
.line 154
invoke-interface {v0}, Lokio/BufferedSource;->buffer()Lokio/Buffer;
move-result-object v1
const-wide/16 v2, 0x0
add-long v4, v7, v13
move-object/from16 v0, p0
invoke-virtual/range {v0 .. v5}, Lokio/GzipSource;->updateCrc(Lokio/Buffer;JJ)V
:cond_8
iget-object v0, v6, Lokio/GzipSource;->source:Lokio/BufferedSource;
add-long/2addr v7, v13
.line 155
invoke-interface {v0, v7, v8}, Lokio/BufferedSource;->skip(J)V
goto :goto_2
.line 153
:cond_9
new-instance v0, Ljava/io/EOFException;
invoke-direct {v0}, Ljava/io/EOFException;-><init>()V
throw v0
:cond_a
:goto_2
if-eqz v10, :cond_b
iget-object v0, v6, Lokio/GzipSource;->source:Lokio/BufferedSource;
.line 163
invoke-interface {v0}, Lokio/BufferedSource;->readShortLe()S
move-result v0
iget-object v1, v6, Lokio/GzipSource;->crc:Ljava/util/zip/CRC32;
invoke-virtual {v1}, Ljava/util/zip/CRC32;->getValue()J
move-result-wide v1
long-to-int v1, v1
int-to-short v1, v1
const-string v2, "FHCRC"
invoke-virtual {v6, v2, v0, v1}, Lokio/GzipSource;->checkEqual(Ljava/lang/String;II)V
iget-object v0, v6, Lokio/GzipSource;->crc:Ljava/util/zip/CRC32;
.line 164
invoke-virtual {v0}, Ljava/util/zip/CRC32;->reset()V
:cond_b
return-void
.end method
.method public final consumeTrailer()V
.locals 3
iget-object v0, p0, Lokio/GzipSource;->source:Lokio/BufferedSource;
.line 173
invoke-interface {v0}, Lokio/BufferedSource;->readIntLe()I
move-result v0
iget-object v1, p0, Lokio/GzipSource;->crc:Ljava/util/zip/CRC32;
invoke-virtual {v1}, Ljava/util/zip/CRC32;->getValue()J
move-result-wide v1
long-to-int v1, v1
const-string v2, "CRC"
invoke-virtual {p0, v2, v0, v1}, Lokio/GzipSource;->checkEqual(Ljava/lang/String;II)V
iget-object v0, p0, Lokio/GzipSource;->source:Lokio/BufferedSource;
.line 174
invoke-interface {v0}, Lokio/BufferedSource;->readIntLe()I
move-result v0
iget-object v1, p0, Lokio/GzipSource;->inflater:Ljava/util/zip/Inflater;
invoke-virtual {v1}, Ljava/util/zip/Inflater;->getBytesWritten()J
move-result-wide v1
long-to-int v1, v1
const-string v2, "ISIZE"
invoke-virtual {p0, v2, v0, v1}, Lokio/GzipSource;->checkEqual(Ljava/lang/String;II)V
return-void
.end method
.method public read(Lokio/Buffer;J)J
.locals 11
const-wide/16 v0, 0x0
cmp-long v2, p2, v0
if-ltz v2, :cond_6
if-nez v2, :cond_0
return-wide v0
:cond_0
iget v0, p0, Lokio/GzipSource;->section:I
const/4 v1, 0x1
if-nez v0, :cond_1
.line 73
invoke-virtual {p0}, Lokio/GzipSource;->consumeHeader()V
iput v1, p0, Lokio/GzipSource;->section:I
:cond_1
iget v0, p0, Lokio/GzipSource;->section:I
const/4 v2, 0x2
const-wide/16 v3, -0x1
if-ne v0, v1, :cond_3
.line 79
iget-wide v7, p1, Lokio/Buffer;->size:J
iget-object v0, p0, Lokio/GzipSource;->inflaterSource:Lokio/InflaterSource;
.line 80
invoke-virtual {v0, p1, p2, p3}, Lokio/InflaterSource;->read(Lokio/Buffer;J)J
move-result-wide p2
cmp-long v0, p2, v3
if-eqz v0, :cond_2
move-object v5, p0
move-object v6, p1
move-wide v9, p2
.line 82
invoke-virtual/range {v5 .. v10}, Lokio/GzipSource;->updateCrc(Lokio/Buffer;JJ)V
return-wide p2
:cond_2
iput v2, p0, Lokio/GzipSource;->section:I
:cond_3
iget p1, p0, Lokio/GzipSource;->section:I
if-ne p1, v2, :cond_5
.line 92
invoke-virtual {p0}, Lokio/GzipSource;->consumeTrailer()V
const/4 p1, 0x3
iput p1, p0, Lokio/GzipSource;->section:I
iget-object p1, p0, Lokio/GzipSource;->source:Lokio/BufferedSource;
.line 99
invoke-interface {p1}, Lokio/BufferedSource;->exhausted()Z
move-result p1
if-eqz p1, :cond_4
goto :goto_0
.line 100
:cond_4
new-instance p1, Ljava/io/IOException;
const-string p2, "gzip finished without exhausting source"
invoke-direct {p1, p2}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
throw p1
:cond_5
:goto_0
return-wide v3
.line 68
:cond_6
new-instance p1, Ljava/lang/IllegalArgumentException;
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
const-string v1, "byteCount < 0: "
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0, p2, p3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p2
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method public timeout()Lokio/Timeout;
.locals 1
iget-object v0, p0, Lokio/GzipSource;->source:Lokio/BufferedSource;
.line 178
invoke-interface {v0}, Lokio/Source;->timeout()Lokio/Timeout;
move-result-object v0
return-object v0
.end method
.method public final updateCrc(Lokio/Buffer;JJ)V
.locals 4
.line 188
iget-object p1, p1, Lokio/Buffer;->head:Lokio/Segment;
.line 189
:goto_0
iget v0, p1, Lokio/Segment;->limit:I
iget v1, p1, Lokio/Segment;->pos:I
sub-int v2, v0, v1
int-to-long v2, v2
cmp-long v2, p2, v2
if-ltz v2, :cond_0
sub-int/2addr v0, v1
int-to-long v0, v0
sub-long/2addr p2, v0
iget-object p1, p1, Lokio/Segment;->next:Lokio/Segment;
goto :goto_0
:cond_0
:goto_1
const-wide/16 v0, 0x0
cmp-long v2, p4, v0
if-lez v2, :cond_1
.line 195
iget v2, p1, Lokio/Segment;->pos:I
int-to-long v2, v2
add-long/2addr v2, p2
long-to-int p2, v2
.line 196
iget p3, p1, Lokio/Segment;->limit:I
sub-int/2addr p3, p2
int-to-long v2, p3
invoke-static {v2, v3, p4, p5}, Ljava/lang/Math;->min(JJ)J
move-result-wide v2
long-to-int p3, v2
iget-object v2, p0, Lokio/GzipSource;->crc:Ljava/util/zip/CRC32;
.line 197
iget-object v3, p1, Lokio/Segment;->data:[B
invoke-virtual {v2, v3, p2, p3}, Ljava/util/zip/CRC32;->update([BII)V
int-to-long p2, p3
sub-long/2addr p4, p2
.line 194
iget-object p1, p1, Lokio/Segment;->next:Lokio/Segment;
move-wide p2, v0
goto :goto_1
:cond_1
return-void
.end method

View File

@@ -0,0 +1,399 @@
.class public final Lokio/InflaterSource;
.super Ljava/lang/Object;
.source "SourceFile"
# interfaces
.implements Lokio/Source;
# instance fields
.field public bufferBytesHeldByInflater:I
.field public closed:Z
.field public final inflater:Ljava/util/zip/Inflater;
.field public final source:Lokio/BufferedSource;
# direct methods
.method public constructor <init>(Lokio/BufferedSource;Ljava/util/zip/Inflater;)V
.locals 0
.line 48
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
if-eqz p1, :cond_1
if-eqz p2, :cond_0
iput-object p1, p0, Lokio/InflaterSource;->source:Lokio/BufferedSource;
iput-object p2, p0, Lokio/InflaterSource;->inflater:Ljava/util/zip/Inflater;
return-void
.line 50
:cond_0
new-instance p1, Ljava/lang/IllegalArgumentException;
const-string p2, "inflater == null"
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p1
.line 49
:cond_1
new-instance p1, Ljava/lang/IllegalArgumentException;
const-string p2, "source == null"
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p1
.end method
# virtual methods
.method public close()V
.locals 1
iget-boolean v0, p0, Lokio/InflaterSource;->closed:Z
if-eqz v0, :cond_0
return-void
:cond_0
iget-object v0, p0, Lokio/InflaterSource;->inflater:Ljava/util/zip/Inflater;
.line 125
invoke-virtual {v0}, Ljava/util/zip/Inflater;->end()V
const/4 v0, 0x1
iput-boolean v0, p0, Lokio/InflaterSource;->closed:Z
iget-object v0, p0, Lokio/InflaterSource;->source:Lokio/BufferedSource;
.line 127
invoke-interface {v0}, Lokio/Source;->close()V
return-void
.end method
.method public read(Lokio/Buffer;J)J
.locals 6
const-wide/16 v0, 0x0
cmp-long v2, p2, v0
if-ltz v2, :cond_7
iget-boolean v3, p0, Lokio/InflaterSource;->closed:Z
if-nez v3, :cond_6
if-nez v2, :cond_0
return-wide v0
.line 62
:cond_0
:goto_0
invoke-virtual {p0}, Lokio/InflaterSource;->refill()Z
move-result v0
const/4 v1, 0x1
.line 66
:try_start_0
invoke-virtual {p1, v1}, Lokio/Buffer;->writableSegment(I)Lokio/Segment;
move-result-object v1
.line 67
iget v2, v1, Lokio/Segment;->limit:I
rsub-int v2, v2, 0x2000
int-to-long v2, v2
invoke-static {p2, p3, v2, v3}, Ljava/lang/Math;->min(JJ)J
move-result-wide v2
long-to-int v2, v2
iget-object v3, p0, Lokio/InflaterSource;->inflater:Ljava/util/zip/Inflater;
.line 68
iget-object v4, v1, Lokio/Segment;->data:[B
iget v5, v1, Lokio/Segment;->limit:I
invoke-virtual {v3, v4, v5, v2}, Ljava/util/zip/Inflater;->inflate([BII)I
move-result v2
if-lez v2, :cond_1
.line 70
iget p2, v1, Lokio/Segment;->limit:I
add-int/2addr p2, v2
iput p2, v1, Lokio/Segment;->limit:I
.line 71
iget-wide p2, p1, Lokio/Buffer;->size:J
int-to-long v0, v2
add-long/2addr p2, v0
iput-wide p2, p1, Lokio/Buffer;->size:J
return-wide v0
:catch_0
move-exception p1
goto :goto_2
:cond_1
iget-object v2, p0, Lokio/InflaterSource;->inflater:Ljava/util/zip/Inflater;
.line 74
invoke-virtual {v2}, Ljava/util/zip/Inflater;->finished()Z
move-result v2
if-nez v2, :cond_4
iget-object v2, p0, Lokio/InflaterSource;->inflater:Ljava/util/zip/Inflater;
invoke-virtual {v2}, Ljava/util/zip/Inflater;->needsDictionary()Z
move-result v2
if-eqz v2, :cond_2
goto :goto_1
:cond_2
if-nez v0, :cond_3
goto :goto_0
.line 83
:cond_3
new-instance p1, Ljava/io/EOFException;
const-string p2, "source exhausted prematurely"
invoke-direct {p1, p2}, Ljava/io/EOFException;-><init>(Ljava/lang/String;)V
throw p1
.line 75
:cond_4
:goto_1
invoke-virtual {p0}, Lokio/InflaterSource;->releaseInflatedBytes()V
.line 76
iget p2, v1, Lokio/Segment;->pos:I
iget p3, v1, Lokio/Segment;->limit:I
if-ne p2, p3, :cond_5
.line 78
invoke-virtual {v1}, Lokio/Segment;->pop()Lokio/Segment;
move-result-object p2
iput-object p2, p1, Lokio/Buffer;->head:Lokio/Segment;
.line 79
invoke-static {v1}, Lokio/SegmentPool;->recycle(Lokio/Segment;)V
:try_end_0
.catch Ljava/util/zip/DataFormatException; {:try_start_0 .. :try_end_0} :catch_0
:cond_5
const-wide/16 p1, -0x1
return-wide p1
.line 85
:goto_2
new-instance p2, Ljava/io/IOException;
invoke-direct {p2, p1}, Ljava/io/IOException;-><init>(Ljava/lang/Throwable;)V
throw p2
.line 58
:cond_6
new-instance p1, Ljava/lang/IllegalStateException;
const-string p2, "closed"
invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p1
.line 57
:cond_7
new-instance p1, Ljava/lang/IllegalArgumentException;
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
const-string v1, "byteCount < 0: "
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0, p2, p3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p2
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method public final refill()Z
.locals 5
iget-object v0, p0, Lokio/InflaterSource;->inflater:Ljava/util/zip/Inflater;
.line 96
invoke-virtual {v0}, Ljava/util/zip/Inflater;->needsInput()Z
move-result v0
const/4 v1, 0x0
if-nez v0, :cond_0
return v1
.line 98
:cond_0
invoke-virtual {p0}, Lokio/InflaterSource;->releaseInflatedBytes()V
iget-object v0, p0, Lokio/InflaterSource;->inflater:Ljava/util/zip/Inflater;
.line 99
invoke-virtual {v0}, Ljava/util/zip/Inflater;->getRemaining()I
move-result v0
if-nez v0, :cond_2
iget-object v0, p0, Lokio/InflaterSource;->source:Lokio/BufferedSource;
.line 102
invoke-interface {v0}, Lokio/BufferedSource;->exhausted()Z
move-result v0
if-eqz v0, :cond_1
const/4 v0, 0x1
return v0
:cond_1
iget-object v0, p0, Lokio/InflaterSource;->source:Lokio/BufferedSource;
.line 105
invoke-interface {v0}, Lokio/BufferedSource;->buffer()Lokio/Buffer;
move-result-object v0
iget-object v0, v0, Lokio/Buffer;->head:Lokio/Segment;
.line 106
iget v2, v0, Lokio/Segment;->limit:I
iget v3, v0, Lokio/Segment;->pos:I
sub-int/2addr v2, v3
iput v2, p0, Lokio/InflaterSource;->bufferBytesHeldByInflater:I
iget-object v4, p0, Lokio/InflaterSource;->inflater:Ljava/util/zip/Inflater;
.line 107
iget-object v0, v0, Lokio/Segment;->data:[B
invoke-virtual {v4, v0, v3, v2}, Ljava/util/zip/Inflater;->setInput([BII)V
return v1
.line 99
:cond_2
new-instance v0, Ljava/lang/IllegalStateException;
const-string v1, "?"
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw v0
.end method
.method public final releaseInflatedBytes()V
.locals 4
iget v0, p0, Lokio/InflaterSource;->bufferBytesHeldByInflater:I
if-nez v0, :cond_0
return-void
:cond_0
iget-object v1, p0, Lokio/InflaterSource;->inflater:Ljava/util/zip/Inflater;
.line 114
invoke-virtual {v1}, Ljava/util/zip/Inflater;->getRemaining()I
move-result v1
sub-int/2addr v0, v1
iget v1, p0, Lokio/InflaterSource;->bufferBytesHeldByInflater:I
sub-int/2addr v1, v0
iput v1, p0, Lokio/InflaterSource;->bufferBytesHeldByInflater:I
iget-object v1, p0, Lokio/InflaterSource;->source:Lokio/BufferedSource;
int-to-long v2, v0
.line 116
invoke-interface {v1, v2, v3}, Lokio/BufferedSource;->skip(J)V
return-void
.end method
.method public timeout()Lokio/Timeout;
.locals 1
iget-object v0, p0, Lokio/InflaterSource;->source:Lokio/BufferedSource;
.line 120
invoke-interface {v0}, Lokio/Source;->timeout()Lokio/Timeout;
move-result-object v0
return-object v0
.end method

View File

@@ -0,0 +1,188 @@
.class public final Lokio/Okio$1;
.super Ljava/lang/Object;
.source "SourceFile"
# interfaces
.implements Lokio/Sink;
# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
value = Lokio/Okio;->sink(Ljava/io/OutputStream;Lokio/Timeout;)Lokio/Sink;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x1
name = null
.end annotation
# instance fields
.field public final synthetic val$out:Ljava/io/OutputStream;
.field public final synthetic val$timeout:Lokio/Timeout;
# direct methods
.method public constructor <init>(Lokio/Timeout;Ljava/io/OutputStream;)V
.locals 0
iput-object p1, p0, Lokio/Okio$1;->val$timeout:Lokio/Timeout;
iput-object p2, p0, Lokio/Okio$1;->val$out:Ljava/io/OutputStream;
.line 72
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
# virtual methods
.method public close()V
.locals 1
iget-object v0, p0, Lokio/Okio$1;->val$out:Ljava/io/OutputStream;
.line 97
invoke-virtual {v0}, Ljava/io/OutputStream;->close()V
return-void
.end method
.method public flush()V
.locals 1
iget-object v0, p0, Lokio/Okio$1;->val$out:Ljava/io/OutputStream;
.line 93
invoke-virtual {v0}, Ljava/io/OutputStream;->flush()V
return-void
.end method
.method public timeout()Lokio/Timeout;
.locals 1
iget-object v0, p0, Lokio/Okio$1;->val$timeout:Lokio/Timeout;
return-object v0
.end method
.method public toString()Ljava/lang/String;
.locals 2
.line 105
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
const-string v1, "sink("
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
iget-object v1, p0, Lokio/Okio$1;->val$out:Ljava/io/OutputStream;
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
const-string v1, ")"
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
return-object v0
.end method
.method public write(Lokio/Buffer;J)V
.locals 7
.line 74
iget-wide v0, p1, Lokio/Buffer;->size:J
const-wide/16 v2, 0x0
move-wide v4, p2
invoke-static/range {v0 .. v5}, 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/Okio$1;->val$timeout:Lokio/Timeout;
.line 76
invoke-virtual {v0}, Lokio/Timeout;->throwIfReached()V
.line 77
iget-object v0, p1, Lokio/Buffer;->head:Lokio/Segment;
.line 78
iget v1, v0, Lokio/Segment;->limit:I
iget v2, v0, Lokio/Segment;->pos:I
sub-int/2addr v1, v2
int-to-long v1, v1
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/Okio$1;->val$out:Ljava/io/OutputStream;
.line 79
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 81
iget v2, v0, Lokio/Segment;->pos:I
add-int/2addr v2, v1
iput v2, v0, Lokio/Segment;->pos:I
int-to-long v3, v1
sub-long/2addr p2, v3
.line 83
iget-wide v5, p1, Lokio/Buffer;->size:J
sub-long/2addr v5, v3
iput-wide v5, p1, Lokio/Buffer;->size:J
.line 85
iget v1, v0, Lokio/Segment;->limit:I
if-ne v2, v1, :cond_0
.line 86
invoke-virtual {v0}, Lokio/Segment;->pop()Lokio/Segment;
move-result-object v1
iput-object v1, p1, Lokio/Buffer;->head:Lokio/Segment;
.line 87
invoke-static {v0}, Lokio/SegmentPool;->recycle(Lokio/Segment;)V
goto :goto_0
:cond_1
return-void
.end method

View File

@@ -0,0 +1,209 @@
.class public final Lokio/Okio$2;
.super Ljava/lang/Object;
.source "SourceFile"
# interfaces
.implements Lokio/Source;
# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
value = Lokio/Okio;->source(Ljava/io/InputStream;Lokio/Timeout;)Lokio/Source;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x1
name = null
.end annotation
# instance fields
.field public final synthetic val$in:Ljava/io/InputStream;
.field public final synthetic val$timeout:Lokio/Timeout;
# direct methods
.method public constructor <init>(Lokio/Timeout;Ljava/io/InputStream;)V
.locals 0
iput-object p1, p0, Lokio/Okio$2;->val$timeout:Lokio/Timeout;
iput-object p2, p0, Lokio/Okio$2;->val$in:Ljava/io/InputStream;
.line 132
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
# virtual methods
.method public close()V
.locals 1
iget-object v0, p0, Lokio/Okio$2;->val$in:Ljava/io/InputStream;
.line 152
invoke-virtual {v0}, Ljava/io/InputStream;->close()V
return-void
.end method
.method public read(Lokio/Buffer;J)J
.locals 3
const-wide/16 v0, 0x0
cmp-long v2, p2, v0
if-ltz v2, :cond_3
if-nez v2, :cond_0
return-wide v0
:cond_0
:try_start_0
iget-object v0, p0, Lokio/Okio$2;->val$timeout:Lokio/Timeout;
.line 137
invoke-virtual {v0}, Lokio/Timeout;->throwIfReached()V
const/4 v0, 0x1
.line 138
invoke-virtual {p1, v0}, Lokio/Buffer;->writableSegment(I)Lokio/Segment;
move-result-object v0
.line 139
iget v1, v0, Lokio/Segment;->limit:I
rsub-int v1, v1, 0x2000
int-to-long v1, v1
invoke-static {p2, p3, v1, v2}, Ljava/lang/Math;->min(JJ)J
move-result-wide p2
long-to-int p2, p2
iget-object p3, p0, Lokio/Okio$2;->val$in:Ljava/io/InputStream;
.line 140
iget-object v1, v0, Lokio/Segment;->data:[B
iget v2, v0, Lokio/Segment;->limit:I
invoke-virtual {p3, v1, v2, p2}, Ljava/io/InputStream;->read([BII)I
move-result p2
const/4 p3, -0x1
if-ne p2, p3, :cond_1
const-wide/16 p1, -0x1
return-wide p1
.line 142
:cond_1
iget p3, v0, Lokio/Segment;->limit:I
add-int/2addr p3, p2
iput p3, v0, Lokio/Segment;->limit:I
.line 143
iget-wide v0, p1, Lokio/Buffer;->size:J
int-to-long p2, p2
add-long/2addr v0, p2
iput-wide v0, p1, Lokio/Buffer;->size:J
:try_end_0
.catch Ljava/lang/AssertionError; {:try_start_0 .. :try_end_0} :catch_0
return-wide p2
:catch_0
move-exception p1
.line 146
invoke-static {p1}, Lokio/Okio;->isAndroidGetsocknameError(Ljava/lang/AssertionError;)Z
move-result p2
if-eqz p2, :cond_2
new-instance p2, Ljava/io/IOException;
invoke-direct {p2, p1}, Ljava/io/IOException;-><init>(Ljava/lang/Throwable;)V
throw p2
.line 147
:cond_2
throw p1
.line 134
:cond_3
new-instance p1, Ljava/lang/IllegalArgumentException;
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
const-string v1, "byteCount < 0: "
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0, p2, p3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p2
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method public timeout()Lokio/Timeout;
.locals 1
iget-object v0, p0, Lokio/Okio$2;->val$timeout:Lokio/Timeout;
return-object v0
.end method
.method public toString()Ljava/lang/String;
.locals 2
.line 160
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
const-string v1, "source("
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
iget-object v1, p0, Lokio/Okio$2;->val$in:Ljava/io/InputStream;
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
const-string v1, ")"
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
return-object v0
.end method

View File

@@ -0,0 +1,60 @@
.class public final Lokio/Okio$3;
.super Ljava/lang/Object;
.source "SourceFile"
# interfaces
.implements Lokio/Sink;
# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
value = Lokio/Okio;->blackhole()Lokio/Sink;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x1
name = null
.end annotation
# direct methods
.method public constructor <init>()V
.locals 0
.line 199
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
# virtual methods
.method public close()V
.locals 0
return-void
.end method
.method public flush()V
.locals 0
return-void
.end method
.method public timeout()Lokio/Timeout;
.locals 1
.line 208
sget-object v0, Lokio/Timeout;->NONE:Lokio/Timeout;
return-object v0
.end method
.method public write(Lokio/Buffer;J)V
.locals 0
.line 201
invoke-virtual {p1, p2, p3}, Lokio/Buffer;->skip(J)V
return-void
.end method

View File

@@ -0,0 +1,139 @@
.class public final Lokio/Okio$4;
.super Lokio/AsyncTimeout;
.source "SourceFile"
# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
value = Lokio/Okio;->timeout(Ljava/net/Socket;)Lokio/AsyncTimeout;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x1
name = null
.end annotation
# instance fields
.field public final synthetic val$socket:Ljava/net/Socket;
# direct methods
.method public constructor <init>(Ljava/net/Socket;)V
.locals 0
iput-object p1, p0, Lokio/Okio$4;->val$socket:Ljava/net/Socket;
.line 230
invoke-direct {p0}, Lokio/AsyncTimeout;-><init>()V
return-void
.end method
# virtual methods
.method public newTimeoutException(Ljava/io/IOException;)Ljava/io/IOException;
.locals 2
.line 232
new-instance v0, Ljava/net/SocketTimeoutException;
const-string v1, "timeout"
invoke-direct {v0, v1}, Ljava/net/SocketTimeoutException;-><init>(Ljava/lang/String;)V
if-eqz p1, :cond_0
.line 234
invoke-virtual {v0, p1}, Ljava/lang/Throwable;->initCause(Ljava/lang/Throwable;)Ljava/lang/Throwable;
:cond_0
return-object v0
.end method
.method public timedOut()V
.locals 5
const-string v0, "Failed to close timed out socket "
:try_start_0
iget-object v1, p0, Lokio/Okio$4;->val$socket:Ljava/net/Socket;
.line 241
invoke-virtual {v1}, Ljava/net/Socket;->close()V
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1
.catch Ljava/lang/AssertionError; {:try_start_0 .. :try_end_0} :catch_0
goto :goto_2
:catch_0
move-exception v1
goto :goto_0
:catch_1
move-exception v1
goto :goto_1
.line 245
:goto_0
invoke-static {v1}, Lokio/Okio;->isAndroidGetsocknameError(Ljava/lang/AssertionError;)Z
move-result v2
if-eqz v2, :cond_0
.line 248
sget-object v2, Lokio/Okio;->logger:Ljava/util/logging/Logger;
sget-object v3, Ljava/util/logging/Level;->WARNING:Ljava/util/logging/Level;
new-instance v4, Ljava/lang/StringBuilder;
invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
iget-object v0, p0, Lokio/Okio$4;->val$socket:Ljava/net/Socket;
invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
invoke-virtual {v2, v3, v0, v1}, Ljava/util/logging/Logger;->log(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/Throwable;)V
goto :goto_2
.line 250
:cond_0
throw v1
.line 243
:goto_1
sget-object v2, Lokio/Okio;->logger:Ljava/util/logging/Logger;
sget-object v3, Ljava/util/logging/Level;->WARNING:Ljava/util/logging/Level;
new-instance v4, Ljava/lang/StringBuilder;
invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
iget-object v0, p0, Lokio/Okio$4;->val$socket:Ljava/net/Socket;
invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
invoke-virtual {v2, v3, v0, v1}, Ljava/util/logging/Logger;->log(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/Throwable;)V
:goto_2
return-void
.end method

View File

@@ -0,0 +1,403 @@
.class public abstract Lokio/Okio;
.super Ljava/lang/Object;
.source "SourceFile"
# static fields
.field public static final logger:Ljava/util/logging/Logger;
# direct methods
.method static constructor <clinit>()V
.locals 1
const-class v0, Lokio/Okio;
.line 40
invoke-virtual {v0}, Ljava/lang/Class;->getName()Ljava/lang/String;
move-result-object v0
invoke-static {v0}, Ljava/util/logging/Logger;->getLogger(Ljava/lang/String;)Ljava/util/logging/Logger;
move-result-object v0
sput-object v0, Lokio/Okio;->logger:Ljava/util/logging/Logger;
return-void
.end method
.method public static appendingSink(Ljava/io/File;)Lokio/Sink;
.locals 2
if-eqz p0, :cond_0
.line 187
new-instance v0, Ljava/io/FileOutputStream;
const/4 v1, 0x1
invoke-direct {v0, p0, v1}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;Z)V
invoke-static {v0}, Lokio/Okio;->sink(Ljava/io/OutputStream;)Lokio/Sink;
move-result-object p0
return-object p0
.line 186
:cond_0
new-instance p0, Ljava/lang/IllegalArgumentException;
const-string v0, "file == null"
invoke-direct {p0, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p0
.end method
.method public static blackhole()Lokio/Sink;
.locals 1
.line 199
new-instance v0, Lokio/Okio$3;
invoke-direct {v0}, Lokio/Okio$3;-><init>()V
return-object v0
.end method
.method public static buffer(Lokio/Sink;)Lokio/BufferedSink;
.locals 1
.line 60
new-instance v0, Lokio/RealBufferedSink;
invoke-direct {v0, p0}, Lokio/RealBufferedSink;-><init>(Lokio/Sink;)V
return-object v0
.end method
.method public static buffer(Lokio/Source;)Lokio/BufferedSource;
.locals 1
.line 51
new-instance v0, Lokio/RealBufferedSource;
invoke-direct {v0, p0}, Lokio/RealBufferedSource;-><init>(Lokio/Source;)V
return-object v0
.end method
.method public static isAndroidGetsocknameError(Ljava/lang/AssertionError;)Z
.locals 1
.line 262
invoke-virtual {p0}, Ljava/lang/Throwable;->getCause()Ljava/lang/Throwable;
move-result-object v0
if-eqz v0, :cond_0
invoke-virtual {p0}, Ljava/lang/Throwable;->getMessage()Ljava/lang/String;
move-result-object v0
if-eqz v0, :cond_0
.line 263
invoke-virtual {p0}, Ljava/lang/Throwable;->getMessage()Ljava/lang/String;
move-result-object p0
const-string v0, "getsockname failed"
invoke-virtual {p0, v0}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z
move-result p0
if-eqz p0, :cond_0
const/4 p0, 0x1
goto :goto_0
:cond_0
const/4 p0, 0x0
:goto_0
return p0
.end method
.method public static sink(Ljava/io/File;)Lokio/Sink;
.locals 1
if-eqz p0, :cond_0
.line 181
new-instance v0, Ljava/io/FileOutputStream;
invoke-direct {v0, p0}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;)V
invoke-static {v0}, Lokio/Okio;->sink(Ljava/io/OutputStream;)Lokio/Sink;
move-result-object p0
return-object p0
.line 180
:cond_0
new-instance p0, Ljava/lang/IllegalArgumentException;
const-string v0, "file == null"
invoke-direct {p0, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p0
.end method
.method public static sink(Ljava/io/OutputStream;)Lokio/Sink;
.locals 1
.line 65
new-instance v0, Lokio/Timeout;
invoke-direct {v0}, Lokio/Timeout;-><init>()V
invoke-static {p0, v0}, Lokio/Okio;->sink(Ljava/io/OutputStream;Lokio/Timeout;)Lokio/Sink;
move-result-object p0
return-object p0
.end method
.method public static sink(Ljava/io/OutputStream;Lokio/Timeout;)Lokio/Sink;
.locals 1
if-eqz p0, :cond_1
if-eqz p1, :cond_0
.line 72
new-instance v0, Lokio/Okio$1;
invoke-direct {v0, p1, p0}, Lokio/Okio$1;-><init>(Lokio/Timeout;Ljava/io/OutputStream;)V
return-object v0
.line 70
:cond_0
new-instance p0, Ljava/lang/IllegalArgumentException;
const-string p1, "timeout == null"
invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p0
.line 69
:cond_1
new-instance p0, Ljava/lang/IllegalArgumentException;
const-string p1, "out == null"
invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p0
.end method
.method public static sink(Ljava/net/Socket;)Lokio/Sink;
.locals 1
if-eqz p0, :cond_1
.line 117
invoke-virtual {p0}, Ljava/net/Socket;->getOutputStream()Ljava/io/OutputStream;
move-result-object v0
if-eqz v0, :cond_0
.line 118
invoke-static {p0}, Lokio/Okio;->timeout(Ljava/net/Socket;)Lokio/AsyncTimeout;
move-result-object v0
.line 119
invoke-virtual {p0}, Ljava/net/Socket;->getOutputStream()Ljava/io/OutputStream;
move-result-object p0
invoke-static {p0, v0}, Lokio/Okio;->sink(Ljava/io/OutputStream;Lokio/Timeout;)Lokio/Sink;
move-result-object p0
.line 120
invoke-virtual {v0, p0}, Lokio/AsyncTimeout;->sink(Lokio/Sink;)Lokio/Sink;
move-result-object p0
return-object p0
.line 117
:cond_0
new-instance p0, Ljava/io/IOException;
const-string v0, "socket\'s output stream == null"
invoke-direct {p0, v0}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
throw p0
.line 116
:cond_1
new-instance p0, Ljava/lang/IllegalArgumentException;
const-string v0, "socket == null"
invoke-direct {p0, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p0
.end method
.method public static source(Ljava/io/File;)Lokio/Source;
.locals 1
if-eqz p0, :cond_0
.line 168
new-instance v0, Ljava/io/FileInputStream;
invoke-direct {v0, p0}, Ljava/io/FileInputStream;-><init>(Ljava/io/File;)V
invoke-static {v0}, Lokio/Okio;->source(Ljava/io/InputStream;)Lokio/Source;
move-result-object p0
return-object p0
.line 167
:cond_0
new-instance p0, Ljava/lang/IllegalArgumentException;
const-string v0, "file == null"
invoke-direct {p0, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p0
.end method
.method public static source(Ljava/io/InputStream;)Lokio/Source;
.locals 1
.line 125
new-instance v0, Lokio/Timeout;
invoke-direct {v0}, Lokio/Timeout;-><init>()V
invoke-static {p0, v0}, Lokio/Okio;->source(Ljava/io/InputStream;Lokio/Timeout;)Lokio/Source;
move-result-object p0
return-object p0
.end method
.method public static source(Ljava/io/InputStream;Lokio/Timeout;)Lokio/Source;
.locals 1
if-eqz p0, :cond_1
if-eqz p1, :cond_0
.line 132
new-instance v0, Lokio/Okio$2;
invoke-direct {v0, p1, p0}, Lokio/Okio$2;-><init>(Lokio/Timeout;Ljava/io/InputStream;)V
return-object v0
.line 130
:cond_0
new-instance p0, Ljava/lang/IllegalArgumentException;
const-string p1, "timeout == null"
invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p0
.line 129
:cond_1
new-instance p0, Ljava/lang/IllegalArgumentException;
const-string p1, "in == null"
invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p0
.end method
.method public static source(Ljava/net/Socket;)Lokio/Source;
.locals 1
if-eqz p0, :cond_1
.line 223
invoke-virtual {p0}, Ljava/net/Socket;->getInputStream()Ljava/io/InputStream;
move-result-object v0
if-eqz v0, :cond_0
.line 224
invoke-static {p0}, Lokio/Okio;->timeout(Ljava/net/Socket;)Lokio/AsyncTimeout;
move-result-object v0
.line 225
invoke-virtual {p0}, Ljava/net/Socket;->getInputStream()Ljava/io/InputStream;
move-result-object p0
invoke-static {p0, v0}, Lokio/Okio;->source(Ljava/io/InputStream;Lokio/Timeout;)Lokio/Source;
move-result-object p0
.line 226
invoke-virtual {v0, p0}, Lokio/AsyncTimeout;->source(Lokio/Source;)Lokio/Source;
move-result-object p0
return-object p0
.line 223
:cond_0
new-instance p0, Ljava/io/IOException;
const-string v0, "socket\'s input stream == null"
invoke-direct {p0, v0}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
throw p0
.line 222
:cond_1
new-instance p0, Ljava/lang/IllegalArgumentException;
const-string v0, "socket == null"
invoke-direct {p0, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p0
.end method
.method public static timeout(Ljava/net/Socket;)Lokio/AsyncTimeout;
.locals 1
.line 230
new-instance v0, Lokio/Okio$4;
invoke-direct {v0, p0}, Lokio/Okio$4;-><init>(Ljava/net/Socket;)V
return-object v0
.end method

View File

@@ -0,0 +1,945 @@
.class public final Lokio/Options;
.super Ljava/util/AbstractList;
.source "SourceFile"
# interfaces
.implements Ljava/util/RandomAccess;
# instance fields
.field public final byteStrings:[Lokio/ByteString;
.field public final trie:[I
# direct methods
.method public constructor <init>([Lokio/ByteString;[I)V
.locals 0
.line 30
invoke-direct {p0}, Ljava/util/AbstractList;-><init>()V
iput-object p1, p0, Lokio/Options;->byteStrings:[Lokio/ByteString;
iput-object p2, p0, Lokio/Options;->trie:[I
return-void
.end method
.method public static buildTrieRecursive(JLokio/Buffer;ILjava/util/List;IILjava/util/List;)V
.locals 18
move-object/from16 v0, p2
move/from16 v1, p3
move-object/from16 v10, p4
move/from16 v2, p5
move/from16 v11, p6
move-object/from16 v12, p7
if-ge v2, v11, :cond_11
move v3, v2
:goto_0
if-ge v3, v11, :cond_1
.line 125
invoke-interface {v10, v3}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v4
check-cast v4, Lokio/ByteString;
invoke-virtual {v4}, Lokio/ByteString;->size()I
move-result v4
if-lt v4, v1, :cond_0
add-int/lit8 v3, v3, 0x1
goto :goto_0
:cond_0
new-instance v0, Ljava/lang/AssertionError;
invoke-direct {v0}, Ljava/lang/AssertionError;-><init>()V
throw v0
.line 128
:cond_1
invoke-interface/range {p4 .. p5}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v3
check-cast v3, Lokio/ByteString;
add-int/lit8 v4, v11, -0x1
.line 129
invoke-interface {v10, v4}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v4
check-cast v4, Lokio/ByteString;
.line 133
invoke-virtual {v3}, Lokio/ByteString;->size()I
move-result v5
if-ne v1, v5, :cond_2
.line 134
invoke-interface {v12, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v3
check-cast v3, Ljava/lang/Integer;
invoke-virtual {v3}, Ljava/lang/Integer;->intValue()I
move-result v3
add-int/lit8 v2, v2, 0x1
.line 136
invoke-interface {v10, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v5
check-cast v5, Lokio/ByteString;
move v6, v2
move-object/from16 v17, v5
move v5, v3
move-object/from16 v3, v17
goto :goto_1
:cond_2
const/4 v5, -0x1
move v6, v2
.line 139
:goto_1
invoke-virtual {v3, v1}, Lokio/ByteString;->getByte(I)B
move-result v2
invoke-virtual {v4, v1}, Lokio/ByteString;->getByte(I)B
move-result v7
const-wide/16 v8, 0x2
if-eq v2, v7, :cond_c
add-int/lit8 v2, v6, 0x1
const/4 v3, 0x1
:goto_2
if-ge v2, v11, :cond_4
add-int/lit8 v4, v2, -0x1
.line 143
invoke-interface {v10, v4}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v4
check-cast v4, Lokio/ByteString;
invoke-virtual {v4, v1}, Lokio/ByteString;->getByte(I)B
move-result v4
.line 144
invoke-interface {v10, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v7
check-cast v7, Lokio/ByteString;
invoke-virtual {v7, v1}, Lokio/ByteString;->getByte(I)B
move-result v7
if-eq v4, v7, :cond_3
add-int/lit8 v3, v3, 0x1
:cond_3
add-int/lit8 v2, v2, 0x1
goto :goto_2
.line 150
:cond_4
invoke-static/range {p2 .. p2}, Lokio/Options;->intCount(Lokio/Buffer;)I
move-result v2
int-to-long v13, v2
add-long v13, p0, v13
add-long/2addr v13, v8
mul-int/lit8 v2, v3, 0x2
int-to-long v7, v2
add-long/2addr v13, v7
.line 152
invoke-virtual {v0, v3}, Lokio/Buffer;->writeInt(I)Lokio/Buffer;
.line 153
invoke-virtual {v0, v5}, Lokio/Buffer;->writeInt(I)Lokio/Buffer;
move v2, v6
:goto_3
if-ge v2, v11, :cond_7
.line 156
invoke-interface {v10, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v3
check-cast v3, Lokio/ByteString;
invoke-virtual {v3, v1}, Lokio/ByteString;->getByte(I)B
move-result v3
if-eq v2, v6, :cond_5
add-int/lit8 v4, v2, -0x1
.line 157
invoke-interface {v10, v4}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v4
check-cast v4, Lokio/ByteString;
invoke-virtual {v4, v1}, Lokio/ByteString;->getByte(I)B
move-result v4
if-eq v3, v4, :cond_6
:cond_5
and-int/lit16 v3, v3, 0xff
.line 158
invoke-virtual {v0, v3}, Lokio/Buffer;->writeInt(I)Lokio/Buffer;
:cond_6
add-int/lit8 v2, v2, 0x1
goto :goto_3
.line 162
:cond_7
new-instance v9, Lokio/Buffer;
invoke-direct {v9}, Lokio/Buffer;-><init>()V
move v7, v6
:goto_4
if-ge v7, v11, :cond_b
.line 165
invoke-interface {v10, v7}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v2
check-cast v2, Lokio/ByteString;
invoke-virtual {v2, v1}, Lokio/ByteString;->getByte(I)B
move-result v2
add-int/lit8 v3, v7, 0x1
move v4, v3
:goto_5
if-ge v4, v11, :cond_9
.line 168
invoke-interface {v10, v4}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v5
check-cast v5, Lokio/ByteString;
invoke-virtual {v5, v1}, Lokio/ByteString;->getByte(I)B
move-result v5
if-eq v2, v5, :cond_8
move v8, v4
goto :goto_6
:cond_8
add-int/lit8 v4, v4, 0x1
goto :goto_5
:cond_9
move v8, v11
:goto_6
if-ne v3, v8, :cond_a
add-int/lit8 v2, v1, 0x1
.line 175
invoke-interface {v10, v7}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v3
check-cast v3, Lokio/ByteString;
invoke-virtual {v3}, Lokio/ByteString;->size()I
move-result v3
if-ne v2, v3, :cond_a
.line 177
invoke-interface {v12, v7}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v2
check-cast v2, Ljava/lang/Integer;
invoke-virtual {v2}, Ljava/lang/Integer;->intValue()I
move-result v2
invoke-virtual {v0, v2}, Lokio/Buffer;->writeInt(I)Lokio/Buffer;
move/from16 v16, v8
move-object/from16 p0, v9
goto :goto_7
.line 180
:cond_a
invoke-static {v9}, Lokio/Options;->intCount(Lokio/Buffer;)I
move-result v2
int-to-long v2, v2
add-long/2addr v2, v13
const-wide/16 v4, -0x1
mul-long/2addr v2, v4
long-to-int v2, v2
invoke-virtual {v0, v2}, Lokio/Buffer;->writeInt(I)Lokio/Buffer;
add-int/lit8 v5, v1, 0x1
move-wide v2, v13
move-object v4, v9
move-object/from16 v6, p4
move/from16 v16, v8
move-object/from16 p0, v9
move-object/from16 v9, p7
.line 181
invoke-static/range {v2 .. v9}, Lokio/Options;->buildTrieRecursive(JLokio/Buffer;ILjava/util/List;IILjava/util/List;)V
:goto_7
move-object/from16 v9, p0
move/from16 v7, v16
goto :goto_4
:cond_b
move-object/from16 p0, v9
.line 194
invoke-virtual/range {p0 .. p0}, Lokio/Buffer;->size()J
move-result-wide v1
move-object/from16 v3, p0
invoke-virtual {v0, v3, v1, v2}, Lokio/Buffer;->write(Lokio/Buffer;J)V
goto/16 :goto_a
.line 199
:cond_c
invoke-virtual {v3}, Lokio/ByteString;->size()I
move-result v2
invoke-virtual {v4}, Lokio/ByteString;->size()I
move-result v7
invoke-static {v2, v7}, Ljava/lang/Math;->min(II)I
move-result v2
const/4 v7, 0x0
move v13, v1
:goto_8
if-ge v13, v2, :cond_d
.line 200
invoke-virtual {v3, v13}, Lokio/ByteString;->getByte(I)B
move-result v14
invoke-virtual {v4, v13}, Lokio/ByteString;->getByte(I)B
move-result v15
if-ne v14, v15, :cond_d
add-int/lit8 v7, v7, 0x1
add-int/lit8 v13, v13, 0x1
goto :goto_8
.line 208
:cond_d
invoke-static/range {p2 .. p2}, Lokio/Options;->intCount(Lokio/Buffer;)I
move-result v2
int-to-long v13, v2
add-long v13, p0, v13
add-long/2addr v13, v8
int-to-long v8, v7
add-long/2addr v13, v8
const-wide/16 v8, 0x1
add-long/2addr v8, v13
neg-int v2, v7
.line 210
invoke-virtual {v0, v2}, Lokio/Buffer;->writeInt(I)Lokio/Buffer;
.line 211
invoke-virtual {v0, v5}, Lokio/Buffer;->writeInt(I)Lokio/Buffer;
move v2, v1
:goto_9
add-int v4, v1, v7
if-ge v2, v4, :cond_e
.line 214
invoke-virtual {v3, v2}, Lokio/ByteString;->getByte(I)B
move-result v4
and-int/lit16 v4, v4, 0xff
invoke-virtual {v0, v4}, Lokio/Buffer;->writeInt(I)Lokio/Buffer;
add-int/lit8 v2, v2, 0x1
goto :goto_9
:cond_e
add-int/lit8 v1, v6, 0x1
if-ne v1, v11, :cond_10
.line 219
invoke-interface {v10, v6}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v1
check-cast v1, Lokio/ByteString;
invoke-virtual {v1}, Lokio/ByteString;->size()I
move-result v1
if-ne v4, v1, :cond_f
.line 222
invoke-interface {v12, v6}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v1
check-cast v1, Ljava/lang/Integer;
invoke-virtual {v1}, Ljava/lang/Integer;->intValue()I
move-result v1
invoke-virtual {v0, v1}, Lokio/Buffer;->writeInt(I)Lokio/Buffer;
goto :goto_a
.line 220
:cond_f
new-instance v0, Ljava/lang/AssertionError;
invoke-direct {v0}, Ljava/lang/AssertionError;-><init>()V
throw v0
.line 225
:cond_10
new-instance v13, Lokio/Buffer;
invoke-direct {v13}, Lokio/Buffer;-><init>()V
.line 226
invoke-static {v13}, Lokio/Options;->intCount(Lokio/Buffer;)I
move-result v1
int-to-long v1, v1
add-long/2addr v1, v8
const-wide/16 v14, -0x1
mul-long/2addr v1, v14
long-to-int v1, v1
invoke-virtual {v0, v1}, Lokio/Buffer;->writeInt(I)Lokio/Buffer;
move-wide v1, v8
move-object v3, v13
move-object/from16 v5, p4
move/from16 v7, p6
move-object/from16 v8, p7
.line 227
invoke-static/range {v1 .. v8}, Lokio/Options;->buildTrieRecursive(JLokio/Buffer;ILjava/util/List;IILjava/util/List;)V
.line 235
invoke-virtual {v13}, Lokio/Buffer;->size()J
move-result-wide v1
invoke-virtual {v0, v13, v1, v2}, Lokio/Buffer;->write(Lokio/Buffer;J)V
:goto_a
return-void
.line 123
:cond_11
new-instance v0, Ljava/lang/AssertionError;
invoke-direct {v0}, Ljava/lang/AssertionError;-><init>()V
throw v0
.end method
.method public static intCount(Lokio/Buffer;)I
.locals 4
.line 249
invoke-virtual {p0}, Lokio/Buffer;->size()J
move-result-wide v0
const-wide/16 v2, 0x4
div-long/2addr v0, v2
long-to-int p0, v0
return p0
.end method
.method public static varargs of([Lokio/ByteString;)Lokio/Options;
.locals 11
.line 36
array-length v0, p0
const/4 v1, -0x1
const/4 v2, 0x0
if-nez v0, :cond_0
.line 38
new-instance p0, Lokio/Options;
new-array v0, v2, [Lokio/ByteString;
filled-new-array {v2, v1}, [I
move-result-object v1
invoke-direct {p0, v0, v1}, Lokio/Options;-><init>([Lokio/ByteString;[I)V
return-object p0
.line 43
:cond_0
new-instance v7, Ljava/util/ArrayList;
invoke-static {p0}, Ljava/util/Arrays;->asList([Ljava/lang/Object;)Ljava/util/List;
move-result-object v0
invoke-direct {v7, v0}, Ljava/util/ArrayList;-><init>(Ljava/util/Collection;)V
.line 44
invoke-static {v7}, Ljava/util/Collections;->sort(Ljava/util/List;)V
.line 45
new-instance v10, Ljava/util/ArrayList;
invoke-direct {v10}, Ljava/util/ArrayList;-><init>()V
move v0, v2
.line 46
:goto_0
invoke-interface {v7}, Ljava/util/List;->size()I
move-result v3
if-ge v0, v3, :cond_1
.line 47
invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v3
invoke-interface {v10, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z
add-int/lit8 v0, v0, 0x1
goto :goto_0
:cond_1
move v0, v2
.line 49
:goto_1
invoke-interface {v7}, Ljava/util/List;->size()I
move-result v1
if-ge v0, v1, :cond_2
.line 50
aget-object v1, p0, v0
invoke-static {v7, v1}, Ljava/util/Collections;->binarySearch(Ljava/util/List;Ljava/lang/Object;)I
move-result v1
.line 51
invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v3
invoke-interface {v10, v1, v3}, Ljava/util/List;->set(ILjava/lang/Object;)Ljava/lang/Object;
add-int/lit8 v0, v0, 0x1
goto :goto_1
.line 53
:cond_2
invoke-interface {v7, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Lokio/ByteString;
invoke-virtual {v0}, Lokio/ByteString;->size()I
move-result v0
if-eqz v0, :cond_a
move v0, v2
.line 60
:goto_2
invoke-interface {v7}, Ljava/util/List;->size()I
move-result v1
if-ge v0, v1, :cond_7
.line 61
invoke-interface {v7, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v1
check-cast v1, Lokio/ByteString;
add-int/lit8 v3, v0, 0x1
move v4, v3
.line 62
:goto_3
invoke-interface {v7}, Ljava/util/List;->size()I
move-result v5
if-ge v4, v5, :cond_6
.line 63
invoke-interface {v7, v4}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v5
check-cast v5, Lokio/ByteString;
.line 64
invoke-virtual {v5, v1}, Lokio/ByteString;->startsWith(Lokio/ByteString;)Z
move-result v6
if-nez v6, :cond_3
goto :goto_4
.line 65
:cond_3
invoke-virtual {v5}, Lokio/ByteString;->size()I
move-result v6
invoke-virtual {v1}, Lokio/ByteString;->size()I
move-result v8
if-eq v6, v8, :cond_5
.line 68
invoke-interface {v10, v4}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v5
check-cast v5, Ljava/lang/Integer;
invoke-virtual {v5}, Ljava/lang/Integer;->intValue()I
move-result v5
invoke-interface {v10, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v6
check-cast v6, Ljava/lang/Integer;
invoke-virtual {v6}, Ljava/lang/Integer;->intValue()I
move-result v6
if-le v5, v6, :cond_4
.line 69
invoke-interface {v7, v4}, Ljava/util/List;->remove(I)Ljava/lang/Object;
.line 70
invoke-interface {v10, v4}, Ljava/util/List;->remove(I)Ljava/lang/Object;
goto :goto_3
:cond_4
add-int/lit8 v4, v4, 0x1
goto :goto_3
.line 66
:cond_5
new-instance p0, Ljava/lang/IllegalArgumentException;
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
const-string v1, "duplicate option: "
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
invoke-direct {p0, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p0
:cond_6
:goto_4
move v0, v3
goto :goto_2
.line 77
:cond_7
new-instance v0, Lokio/Buffer;
invoke-direct {v0}, Lokio/Buffer;-><init>()V
const-wide/16 v3, 0x0
const/4 v6, 0x0
const/4 v8, 0x0
.line 78
invoke-interface {v7}, Ljava/util/List;->size()I
move-result v9
move-object v5, v0
invoke-static/range {v3 .. v10}, Lokio/Options;->buildTrieRecursive(JLokio/Buffer;ILjava/util/List;IILjava/util/List;)V
.line 80
invoke-static {v0}, Lokio/Options;->intCount(Lokio/Buffer;)I
move-result v1
new-array v3, v1, [I
:goto_5
if-ge v2, v1, :cond_8
.line 82
invoke-virtual {v0}, Lokio/Buffer;->readInt()I
move-result v4
aput v4, v3, v2
add-int/lit8 v2, v2, 0x1
goto :goto_5
.line 84
:cond_8
invoke-virtual {v0}, Lokio/Buffer;->exhausted()Z
move-result v0
if-eqz v0, :cond_9
.line 88
new-instance v0, Lokio/Options;
invoke-virtual {p0}, [Lokio/ByteString;->clone()Ljava/lang/Object;
move-result-object p0
check-cast p0, [Lokio/ByteString;
invoke-direct {v0, p0, v3}, Lokio/Options;-><init>([Lokio/ByteString;[I)V
return-object v0
.line 85
:cond_9
new-instance p0, Ljava/lang/AssertionError;
invoke-direct {p0}, Ljava/lang/AssertionError;-><init>()V
throw p0
.line 54
:cond_a
new-instance p0, Ljava/lang/IllegalArgumentException;
const-string v0, "the empty byte string is not a supported option"
invoke-direct {p0, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p0
.end method
# virtual methods
.method public bridge synthetic get(I)Ljava/lang/Object;
.locals 0
.line 26
invoke-virtual {p0, p1}, Lokio/Options;->get(I)Lokio/ByteString;
move-result-object p1
return-object p1
.end method
.method public get(I)Lokio/ByteString;
.locals 1
iget-object v0, p0, Lokio/Options;->byteStrings:[Lokio/ByteString;
.line 241
aget-object p1, v0, p1
return-object p1
.end method
.method public final size()I
.locals 1
iget-object v0, p0, Lokio/Options;->byteStrings:[Lokio/ByteString;
.line 245
array-length v0, v0
return v0
.end method

View File

@@ -0,0 +1,705 @@
.class public final Lokio/RealBufferedSink;
.super Ljava/lang/Object;
.source "SourceFile"
# interfaces
.implements Lokio/BufferedSink;
# instance fields
.field public final buffer:Lokio/Buffer;
.field public closed:Z
.field public final sink:Lokio/Sink;
# direct methods
.method public constructor <init>(Lokio/Sink;)V
.locals 1
.line 29
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 25
new-instance v0, Lokio/Buffer;
invoke-direct {v0}, Lokio/Buffer;-><init>()V
iput-object v0, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
if-eqz p1, :cond_0
iput-object p1, p0, Lokio/RealBufferedSink;->sink:Lokio/Sink;
return-void
.line 30
:cond_0
new-instance p1, Ljava/lang/NullPointerException;
const-string v0, "sink == null"
invoke-direct {p1, v0}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
throw p1
.end method
# virtual methods
.method public buffer()Lokio/Buffer;
.locals 1
iget-object v0, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
return-object v0
.end method
.method public close()V
.locals 5
iget-boolean v0, p0, Lokio/RealBufferedSink;->closed:Z
if-eqz v0, :cond_0
return-void
:cond_0
:try_start_0
iget-object v0, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
.line 240
iget-wide v1, v0, Lokio/Buffer;->size:J
const-wide/16 v3, 0x0
cmp-long v3, v1, v3
if-lez v3, :cond_1
iget-object v3, p0, Lokio/RealBufferedSink;->sink:Lokio/Sink;
.line 241
invoke-interface {v3, v0, v1, v2}, Lokio/Sink;->write(Lokio/Buffer;J)V
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
goto :goto_0
:catchall_0
move-exception v0
goto :goto_1
:cond_1
:goto_0
const/4 v0, 0x0
:goto_1
:try_start_1
iget-object v1, p0, Lokio/RealBufferedSink;->sink:Lokio/Sink;
.line 248
invoke-interface {v1}, Lokio/Sink;->close()V
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_1
goto :goto_2
:catchall_1
move-exception v1
if-nez v0, :cond_2
move-object v0, v1
:cond_2
:goto_2
const/4 v1, 0x1
iput-boolean v1, p0, Lokio/RealBufferedSink;->closed:Z
if-eqz v0, :cond_3
.line 254
invoke-static {v0}, Lokio/Util;->sneakyRethrow(Ljava/lang/Throwable;)V
:cond_3
return-void
.end method
.method public emit()Lokio/BufferedSink;
.locals 4
iget-boolean v0, p0, Lokio/RealBufferedSink;->closed:Z
if-nez v0, :cond_1
iget-object v0, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
.line 185
invoke-virtual {v0}, Lokio/Buffer;->size()J
move-result-wide v0
const-wide/16 v2, 0x0
cmp-long v2, v0, v2
if-lez v2, :cond_0
iget-object v2, p0, Lokio/RealBufferedSink;->sink:Lokio/Sink;
iget-object v3, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
.line 186
invoke-interface {v2, v3, v0, v1}, Lokio/Sink;->write(Lokio/Buffer;J)V
:cond_0
return-object p0
.line 184
:cond_1
new-instance v0, Ljava/lang/IllegalStateException;
const-string v1, "closed"
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw v0
.end method
.method public emitCompleteSegments()Lokio/BufferedSink;
.locals 4
iget-boolean v0, p0, Lokio/RealBufferedSink;->closed:Z
if-nez v0, :cond_1
iget-object v0, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
.line 178
invoke-virtual {v0}, Lokio/Buffer;->completeSegmentByteCount()J
move-result-wide v0
const-wide/16 v2, 0x0
cmp-long v2, v0, v2
if-lez v2, :cond_0
iget-object v2, p0, Lokio/RealBufferedSink;->sink:Lokio/Sink;
iget-object v3, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
.line 179
invoke-interface {v2, v3, v0, v1}, Lokio/Sink;->write(Lokio/Buffer;J)V
:cond_0
return-object p0
.line 177
:cond_1
new-instance v0, Ljava/lang/IllegalStateException;
const-string v1, "closed"
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw v0
.end method
.method public flush()V
.locals 5
iget-boolean v0, p0, Lokio/RealBufferedSink;->closed:Z
if-nez v0, :cond_1
iget-object v0, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
.line 223
iget-wide v1, v0, Lokio/Buffer;->size:J
const-wide/16 v3, 0x0
cmp-long v3, v1, v3
if-lez v3, :cond_0
iget-object v3, p0, Lokio/RealBufferedSink;->sink:Lokio/Sink;
.line 224
invoke-interface {v3, v0, v1, v2}, Lokio/Sink;->write(Lokio/Buffer;J)V
:cond_0
iget-object v0, p0, Lokio/RealBufferedSink;->sink:Lokio/Sink;
.line 226
invoke-interface {v0}, Lokio/Sink;->flush()V
return-void
.line 222
:cond_1
new-instance v0, Ljava/lang/IllegalStateException;
const-string v1, "closed"
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw v0
.end method
.method public isOpen()Z
.locals 1
iget-boolean v0, p0, Lokio/RealBufferedSink;->closed:Z
xor-int/lit8 v0, v0, 0x1
return v0
.end method
.method public timeout()Lokio/Timeout;
.locals 1
iget-object v0, p0, Lokio/RealBufferedSink;->sink:Lokio/Sink;
.line 258
invoke-interface {v0}, Lokio/Sink;->timeout()Lokio/Timeout;
move-result-object v0
return-object v0
.end method
.method public toString()Ljava/lang/String;
.locals 2
.line 262
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
const-string v1, "buffer("
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
iget-object v1, p0, Lokio/RealBufferedSink;->sink:Lokio/Sink;
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
const-string v1, ")"
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
return-object v0
.end method
.method public write(Ljava/nio/ByteBuffer;)I
.locals 1
iget-boolean v0, p0, Lokio/RealBufferedSink;->closed:Z
if-nez v0, :cond_0
iget-object v0, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
.line 97
invoke-virtual {v0, p1}, Lokio/Buffer;->write(Ljava/nio/ByteBuffer;)I
move-result p1
.line 98
invoke-virtual {p0}, Lokio/RealBufferedSink;->emitCompleteSegments()Lokio/BufferedSink;
return p1
.line 96
:cond_0
new-instance p1, Ljava/lang/IllegalStateException;
const-string v0, "closed"
invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method public write(Lokio/ByteString;)Lokio/BufferedSink;
.locals 1
iget-boolean v0, p0, Lokio/RealBufferedSink;->closed:Z
if-nez v0, :cond_0
iget-object v0, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
.line 47
invoke-virtual {v0, p1}, Lokio/Buffer;->write(Lokio/ByteString;)Lokio/Buffer;
.line 48
invoke-virtual {p0}, Lokio/RealBufferedSink;->emitCompleteSegments()Lokio/BufferedSink;
move-result-object p1
return-object p1
.line 46
:cond_0
new-instance p1, Ljava/lang/IllegalStateException;
const-string v0, "closed"
invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method public write([B)Lokio/BufferedSink;
.locals 1
iget-boolean v0, p0, Lokio/RealBufferedSink;->closed:Z
if-nez v0, :cond_0
iget-object v0, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
.line 85
invoke-virtual {v0, p1}, Lokio/Buffer;->write([B)Lokio/Buffer;
.line 86
invoke-virtual {p0}, Lokio/RealBufferedSink;->emitCompleteSegments()Lokio/BufferedSink;
move-result-object p1
return-object p1
.line 84
:cond_0
new-instance p1, Ljava/lang/IllegalStateException;
const-string v0, "closed"
invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method public write([BII)Lokio/BufferedSink;
.locals 1
iget-boolean v0, p0, Lokio/RealBufferedSink;->closed:Z
if-nez v0, :cond_0
iget-object v0, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
.line 91
invoke-virtual {v0, p1, p2, p3}, Lokio/Buffer;->write([BII)Lokio/Buffer;
.line 92
invoke-virtual {p0}, Lokio/RealBufferedSink;->emitCompleteSegments()Lokio/BufferedSink;
move-result-object p1
return-object p1
.line 90
:cond_0
new-instance p1, Ljava/lang/IllegalStateException;
const-string p2, "closed"
invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method public write(Lokio/Buffer;J)V
.locals 1
iget-boolean v0, p0, Lokio/RealBufferedSink;->closed:Z
if-nez v0, :cond_0
iget-object v0, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
.line 41
invoke-virtual {v0, p1, p2, p3}, Lokio/Buffer;->write(Lokio/Buffer;J)V
.line 42
invoke-virtual {p0}, Lokio/RealBufferedSink;->emitCompleteSegments()Lokio/BufferedSink;
return-void
.line 40
:cond_0
new-instance p1, Ljava/lang/IllegalStateException;
const-string p2, "closed"
invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method public writeAll(Lokio/Source;)J
.locals 6
if-eqz p1, :cond_1
const-wide/16 v0, 0x0
:goto_0
iget-object v2, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
const-wide/16 v3, 0x2000
.line 105
invoke-interface {p1, v2, v3, v4}, Lokio/Source;->read(Lokio/Buffer;J)J
move-result-wide v2
const-wide/16 v4, -0x1
cmp-long v4, v2, v4
if-eqz v4, :cond_0
add-long/2addr v0, v2
.line 107
invoke-virtual {p0}, Lokio/RealBufferedSink;->emitCompleteSegments()Lokio/BufferedSink;
goto :goto_0
:cond_0
return-wide v0
.line 103
:cond_1
new-instance p1, Ljava/lang/IllegalArgumentException;
const-string v0, "source == null"
invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method public writeByte(I)Lokio/BufferedSink;
.locals 1
iget-boolean v0, p0, Lokio/RealBufferedSink;->closed:Z
if-nez v0, :cond_0
iget-object v0, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
.line 124
invoke-virtual {v0, p1}, Lokio/Buffer;->writeByte(I)Lokio/Buffer;
.line 125
invoke-virtual {p0}, Lokio/RealBufferedSink;->emitCompleteSegments()Lokio/BufferedSink;
move-result-object p1
return-object p1
.line 123
:cond_0
new-instance p1, Ljava/lang/IllegalStateException;
const-string v0, "closed"
invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method public writeDecimalLong(J)Lokio/BufferedSink;
.locals 1
iget-boolean v0, p0, Lokio/RealBufferedSink;->closed:Z
if-nez v0, :cond_0
iget-object v0, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
.line 166
invoke-virtual {v0, p1, p2}, Lokio/Buffer;->writeDecimalLong(J)Lokio/Buffer;
.line 167
invoke-virtual {p0}, Lokio/RealBufferedSink;->emitCompleteSegments()Lokio/BufferedSink;
move-result-object p1
return-object p1
.line 165
:cond_0
new-instance p1, Ljava/lang/IllegalStateException;
const-string p2, "closed"
invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method public writeHexadecimalUnsignedLong(J)Lokio/BufferedSink;
.locals 1
iget-boolean v0, p0, Lokio/RealBufferedSink;->closed:Z
if-nez v0, :cond_0
iget-object v0, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
.line 172
invoke-virtual {v0, p1, p2}, Lokio/Buffer;->writeHexadecimalUnsignedLong(J)Lokio/Buffer;
.line 173
invoke-virtual {p0}, Lokio/RealBufferedSink;->emitCompleteSegments()Lokio/BufferedSink;
move-result-object p1
return-object p1
.line 171
:cond_0
new-instance p1, Ljava/lang/IllegalStateException;
const-string p2, "closed"
invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method public writeInt(I)Lokio/BufferedSink;
.locals 1
iget-boolean v0, p0, Lokio/RealBufferedSink;->closed:Z
if-nez v0, :cond_0
iget-object v0, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
.line 142
invoke-virtual {v0, p1}, Lokio/Buffer;->writeInt(I)Lokio/Buffer;
.line 143
invoke-virtual {p0}, Lokio/RealBufferedSink;->emitCompleteSegments()Lokio/BufferedSink;
move-result-object p1
return-object p1
.line 141
:cond_0
new-instance p1, Ljava/lang/IllegalStateException;
const-string v0, "closed"
invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method public writeIntLe(I)Lokio/BufferedSink;
.locals 1
iget-boolean v0, p0, Lokio/RealBufferedSink;->closed:Z
if-nez v0, :cond_0
iget-object v0, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
.line 148
invoke-virtual {v0, p1}, Lokio/Buffer;->writeIntLe(I)Lokio/Buffer;
.line 149
invoke-virtual {p0}, Lokio/RealBufferedSink;->emitCompleteSegments()Lokio/BufferedSink;
move-result-object p1
return-object p1
.line 147
:cond_0
new-instance p1, Ljava/lang/IllegalStateException;
const-string v0, "closed"
invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method public writeShort(I)Lokio/BufferedSink;
.locals 1
iget-boolean v0, p0, Lokio/RealBufferedSink;->closed:Z
if-nez v0, :cond_0
iget-object v0, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
.line 130
invoke-virtual {v0, p1}, Lokio/Buffer;->writeShort(I)Lokio/Buffer;
.line 131
invoke-virtual {p0}, Lokio/RealBufferedSink;->emitCompleteSegments()Lokio/BufferedSink;
move-result-object p1
return-object p1
.line 129
:cond_0
new-instance p1, Ljava/lang/IllegalStateException;
const-string v0, "closed"
invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method public writeUtf8(Ljava/lang/String;)Lokio/BufferedSink;
.locals 1
iget-boolean v0, p0, Lokio/RealBufferedSink;->closed:Z
if-nez v0, :cond_0
iget-object v0, p0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
.line 53
invoke-virtual {v0, p1}, Lokio/Buffer;->writeUtf8(Ljava/lang/String;)Lokio/Buffer;
.line 54
invoke-virtual {p0}, Lokio/RealBufferedSink;->emitCompleteSegments()Lokio/BufferedSink;
move-result-object p1
return-object p1
.line 52
:cond_0
new-instance p1, Ljava/lang/IllegalStateException;
const-string v0, "closed"
invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p1
.end method

View File

@@ -0,0 +1,244 @@
.class public Lokio/RealBufferedSource$1;
.super Ljava/io/InputStream;
.source "SourceFile"
# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
value = Lokio/RealBufferedSource;->inputStream()Ljava/io/InputStream;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x1
name = null
.end annotation
# instance fields
.field public final synthetic this$0:Lokio/RealBufferedSource;
# direct methods
.method public constructor <init>(Lokio/RealBufferedSource;)V
.locals 0
iput-object p1, p0, Lokio/RealBufferedSource$1;->this$0:Lokio/RealBufferedSource;
.line 432
invoke-direct {p0}, Ljava/io/InputStream;-><init>()V
return-void
.end method
# virtual methods
.method public available()I
.locals 4
iget-object v0, p0, Lokio/RealBufferedSource$1;->this$0:Lokio/RealBufferedSource;
.line 455
iget-boolean v1, v0, Lokio/RealBufferedSource;->closed:Z
if-nez v1, :cond_0
.line 456
iget-object v0, v0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
iget-wide v0, v0, Lokio/Buffer;->size:J
const-wide/32 v2, 0x7fffffff
invoke-static {v0, v1, v2, v3}, Ljava/lang/Math;->min(JJ)J
move-result-wide v0
long-to-int v0, v0
return v0
.line 455
:cond_0
new-instance v0, Ljava/io/IOException;
const-string v1, "closed"
invoke-direct {v0, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
throw v0
.end method
.method public close()V
.locals 1
iget-object v0, p0, Lokio/RealBufferedSource$1;->this$0:Lokio/RealBufferedSource;
.line 460
invoke-virtual {v0}, Lokio/RealBufferedSource;->close()V
return-void
.end method
.method public read()I
.locals 6
iget-object v0, p0, Lokio/RealBufferedSource$1;->this$0:Lokio/RealBufferedSource;
.line 434
iget-boolean v1, v0, Lokio/RealBufferedSource;->closed:Z
if-nez v1, :cond_1
.line 435
iget-object v1, v0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
iget-wide v2, v1, Lokio/Buffer;->size:J
const-wide/16 v4, 0x0
cmp-long v2, v2, v4
if-nez v2, :cond_0
.line 436
iget-object v0, v0, Lokio/RealBufferedSource;->source:Lokio/Source;
const-wide/16 v2, 0x2000
invoke-interface {v0, v1, v2, v3}, Lokio/Source;->read(Lokio/Buffer;J)J
move-result-wide v0
const-wide/16 v2, -0x1
cmp-long v0, v0, v2
if-nez v0, :cond_0
const/4 v0, -0x1
return v0
:cond_0
iget-object v0, p0, Lokio/RealBufferedSource$1;->this$0:Lokio/RealBufferedSource;
.line 439
iget-object v0, v0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
invoke-virtual {v0}, Lokio/Buffer;->readByte()B
move-result v0
and-int/lit16 v0, v0, 0xff
return v0
.line 434
:cond_1
new-instance v0, Ljava/io/IOException;
const-string v1, "closed"
invoke-direct {v0, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
throw v0
.end method
.method public read([BII)I
.locals 7
iget-object v0, p0, Lokio/RealBufferedSource$1;->this$0:Lokio/RealBufferedSource;
.line 443
iget-boolean v0, v0, Lokio/RealBufferedSource;->closed:Z
if-nez v0, :cond_1
.line 444
array-length v0, p1
int-to-long v1, v0
int-to-long v3, p2
int-to-long v5, p3
invoke-static/range {v1 .. v6}, Lokio/Util;->checkOffsetAndCount(JJJ)V
iget-object v0, p0, Lokio/RealBufferedSource$1;->this$0:Lokio/RealBufferedSource;
.line 446
iget-object v1, v0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
iget-wide v2, v1, Lokio/Buffer;->size:J
const-wide/16 v4, 0x0
cmp-long v2, v2, v4
if-nez v2, :cond_0
.line 447
iget-object v0, v0, Lokio/RealBufferedSource;->source:Lokio/Source;
const-wide/16 v2, 0x2000
invoke-interface {v0, v1, v2, v3}, Lokio/Source;->read(Lokio/Buffer;J)J
move-result-wide v0
const-wide/16 v2, -0x1
cmp-long v0, v0, v2
if-nez v0, :cond_0
const/4 p1, -0x1
return p1
:cond_0
iget-object v0, p0, Lokio/RealBufferedSource$1;->this$0:Lokio/RealBufferedSource;
.line 451
iget-object v0, v0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
invoke-virtual {v0, p1, p2, p3}, Lokio/Buffer;->read([BII)I
move-result p1
return p1
.line 443
:cond_1
new-instance p1, Ljava/io/IOException;
const-string p2, "closed"
invoke-direct {p1, p2}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method public toString()Ljava/lang/String;
.locals 2
.line 464
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
iget-object v1, p0, Lokio/RealBufferedSource$1;->this$0:Lokio/RealBufferedSource;
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
const-string v1, ".inputStream()"
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
return-object v0
.end method

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,390 @@
.class public final Lokio/Segment;
.super Ljava/lang/Object;
.source "SourceFile"
# 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 public constructor <init>()V
.locals 1
.line 62
invoke-direct {p0}, Ljava/lang/Object;-><init>()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 <init>([BIIZZ)V
.locals 0
.line 68
invoke-direct {p0}, Ljava/lang/Object;-><init>()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;
if-eq v0, p0, :cond_3
.line 152
iget-boolean v1, v0, Lokio/Segment;->owner:Z
if-nez v1, :cond_0
return-void
:cond_0
iget v1, p0, Lokio/Segment;->limit:I
iget v2, p0, Lokio/Segment;->pos:I
sub-int/2addr v1, v2
.line 154
iget v2, v0, Lokio/Segment;->limit:I
rsub-int v2, v2, 0x2000
iget-boolean v3, v0, Lokio/Segment;->shared:Z
if-eqz v3, :cond_1
const/4 v3, 0x0
goto :goto_0
:cond_1
iget v3, v0, Lokio/Segment;->pos:I
:goto_0
add-int/2addr v2, v3
if-le v1, v2, :cond_2
return-void
.line 156
:cond_2
invoke-virtual {p0, v0, v1}, Lokio/Segment;->writeTo(Lokio/Segment;I)V
.line 157
invoke-virtual {p0}, Lokio/Segment;->pop()Lokio/Segment;
.line 158
invoke-static {p0}, Lokio/SegmentPool;->recycle(Lokio/Segment;)V
return-void
.line 151
:cond_3
new-instance v0, Ljava/lang/IllegalStateException;
invoke-direct {v0}, Ljava/lang/IllegalStateException;-><init>()V
throw v0
.end method
.method public final pop()Lokio/Segment;
.locals 4
iget-object v0, p0, Lokio/Segment;->next:Lokio/Segment;
const/4 v1, 0x0
if-eq v0, p0, :cond_0
move-object v2, v0
goto :goto_0
:cond_0
move-object v2, v1
:goto_0
iget-object v3, p0, Lokio/Segment;->prev:Lokio/Segment;
.line 97
iput-object v0, v3, Lokio/Segment;->next:Lokio/Segment;
iget-object v0, p0, Lokio/Segment;->next:Lokio/Segment;
.line 98
iput-object v3, v0, Lokio/Segment;->prev:Lokio/Segment;
iput-object v1, p0, Lokio/Segment;->next:Lokio/Segment;
iput-object v1, p0, Lokio/Segment;->prev:Lokio/Segment;
return-object v2
.end method
.method public final push(Lokio/Segment;)Lokio/Segment;
.locals 1
.line 109
iput-object p0, p1, Lokio/Segment;->prev:Lokio/Segment;
iget-object v0, p0, Lokio/Segment;->next:Lokio/Segment;
.line 110
iput-object v0, p1, Lokio/Segment;->next:Lokio/Segment;
iget-object v0, p0, Lokio/Segment;->next:Lokio/Segment;
.line 111
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 83
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;-><init>([BIIZZ)V
return-object v0
.end method
.method public final split(I)Lokio/Segment;
.locals 5
if-lez p1, :cond_1
iget v0, p0, Lokio/Segment;->limit:I
iget v1, p0, Lokio/Segment;->pos:I
sub-int/2addr v0, v1
if-gt p1, v0, :cond_1
const/16 v0, 0x400
if-lt p1, v0, :cond_0
.line 134
invoke-virtual {p0}, Lokio/Segment;->sharedCopy()Lokio/Segment;
move-result-object v0
goto :goto_0
.line 136
:cond_0
invoke-static {}, Lokio/SegmentPool;->take()Lokio/Segment;
move-result-object v0
iget-object v1, p0, Lokio/Segment;->data:[B
iget v2, p0, Lokio/Segment;->pos:I
.line 137
iget-object v3, v0, Lokio/Segment;->data:[B
const/4 v4, 0x0
invoke-static {v1, v2, v3, v4, p1}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
.line 140
:goto_0
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 p1, p0, Lokio/Segment;->prev:Lokio/Segment;
.line 142
invoke-virtual {p1, v0}, Lokio/Segment;->push(Lokio/Segment;)Lokio/Segment;
return-object v0
.line 125
:cond_1
new-instance p1, Ljava/lang/IllegalArgumentException;
invoke-direct {p1}, Ljava/lang/IllegalArgumentException;-><init>()V
throw p1
.end method
.method public final writeTo(Lokio/Segment;I)V
.locals 4
.line 163
iget-boolean v0, p1, Lokio/Segment;->owner:Z
if-eqz v0, :cond_3
.line 164
iget v0, p1, Lokio/Segment;->limit:I
add-int v1, v0, p2
const/16 v2, 0x2000
if-le v1, v2, :cond_2
.line 166
iget-boolean v1, p1, Lokio/Segment;->shared:Z
if-nez v1, :cond_1
add-int v1, v0, p2
.line 167
iget v3, p1, Lokio/Segment;->pos:I
sub-int/2addr v1, v3
if-gt v1, v2, :cond_0
.line 168
iget-object v1, p1, Lokio/Segment;->data:[B
sub-int/2addr v0, v3
const/4 v2, 0x0
invoke-static {v1, v3, v1, v2, v0}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
.line 169
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
.line 170
iput v2, p1, Lokio/Segment;->pos:I
goto :goto_0
.line 167
:cond_0
new-instance p1, Ljava/lang/IllegalArgumentException;
invoke-direct {p1}, Ljava/lang/IllegalArgumentException;-><init>()V
throw p1
.line 166
:cond_1
new-instance p1, Ljava/lang/IllegalArgumentException;
invoke-direct {p1}, Ljava/lang/IllegalArgumentException;-><init>()V
throw p1
:cond_2
:goto_0
iget-object v0, p0, Lokio/Segment;->data:[B
iget v1, p0, Lokio/Segment;->pos:I
.line 173
iget-object v2, p1, Lokio/Segment;->data:[B
iget v3, p1, Lokio/Segment;->limit:I
invoke-static {v0, v1, v2, v3, p2}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
.line 174
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 163
:cond_3
new-instance p1, Ljava/lang/IllegalArgumentException;
invoke-direct {p1}, Ljava/lang/IllegalArgumentException;-><init>()V
throw p1
.end method

View File

@@ -0,0 +1,163 @@
.class public abstract Lokio/SegmentPool;
.super Ljava/lang/Object;
.source "SourceFile"
# static fields
.field public static byteCount:J
.field public static next:Lokio/Segment;
# direct methods
.method public static recycle(Lokio/Segment;)V
.locals 9
.line 52
iget-object v0, p0, Lokio/Segment;->next:Lokio/Segment;
if-nez v0, :cond_2
iget-object v0, p0, Lokio/Segment;->prev:Lokio/Segment;
if-nez v0, :cond_2
.line 53
iget-boolean v0, p0, Lokio/Segment;->shared:Z
if-eqz v0, :cond_0
return-void
:cond_0
const-class v0, Lokio/SegmentPool;
.line 54
monitor-enter v0
:try_start_0
sget-wide v1, Lokio/SegmentPool;->byteCount:J
const-wide/16 v3, 0x2000
add-long v5, v1, v3
const-wide/32 v7, 0x10000
cmp-long v5, v5, v7
if-lez v5, :cond_1
.line 55
monitor-exit v0
return-void
:catchall_0
move-exception p0
goto :goto_0
:cond_1
add-long/2addr v1, v3
sput-wide v1, Lokio/SegmentPool;->byteCount:J
sget-object v1, Lokio/SegmentPool;->next:Lokio/Segment;
.line 57
iput-object v1, p0, Lokio/Segment;->next:Lokio/Segment;
const/4 v1, 0x0
.line 58
iput v1, p0, Lokio/Segment;->limit:I
iput v1, p0, Lokio/Segment;->pos:I
sput-object p0, Lokio/SegmentPool;->next:Lokio/Segment;
.line 60
monitor-exit v0
return-void
:goto_0
monitor-exit v0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
throw p0
.line 52
:cond_2
new-instance p0, Ljava/lang/IllegalArgumentException;
invoke-direct {p0}, Ljava/lang/IllegalArgumentException;-><init>()V
throw p0
.end method
.method public static take()Lokio/Segment;
.locals 6
const-class v0, Lokio/SegmentPool;
.line 39
monitor-enter v0
:try_start_0
sget-object v1, Lokio/SegmentPool;->next:Lokio/Segment;
if-eqz v1, :cond_0
.line 42
iget-object v2, v1, Lokio/Segment;->next:Lokio/Segment;
sput-object v2, Lokio/SegmentPool;->next:Lokio/Segment;
const/4 v2, 0x0
.line 43
iput-object v2, v1, Lokio/Segment;->next:Lokio/Segment;
sget-wide v2, Lokio/SegmentPool;->byteCount:J
const-wide/16 v4, 0x2000
sub-long/2addr v2, v4
sput-wide v2, Lokio/SegmentPool;->byteCount:J
.line 45
monitor-exit v0
return-object v1
:catchall_0
move-exception v1
goto :goto_0
.line 47
:cond_0
monitor-exit v0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
.line 48
new-instance v0, Lokio/Segment;
invoke-direct {v0}, Lokio/Segment;-><init>()V
return-object v0
.line 47
:goto_0
:try_start_1
monitor-exit v0
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
throw v1
.end method

View File

@@ -0,0 +1,876 @@
.class public final Lokio/SegmentedByteString;
.super Lokio/ByteString;
.source "SourceFile"
# instance fields
.field public final transient directory:[I
.field public final transient segments:[[B
# direct methods
.method public constructor <init>(Lokio/Buffer;I)V
.locals 7
const/4 v0, 0x0
.line 57
invoke-direct {p0, v0}, Lokio/ByteString;-><init>([B)V
.line 58
iget-wide v1, p1, Lokio/Buffer;->size:J
const-wide/16 v3, 0x0
int-to-long v5, p2
invoke-static/range {v1 .. v6}, Lokio/Util;->checkOffsetAndCount(JJJ)V
.line 63
iget-object v0, p1, Lokio/Buffer;->head:Lokio/Segment;
const/4 v1, 0x0
move v2, v1
move v3, v2
:goto_0
if-ge v2, p2, :cond_1
.line 64
iget v4, v0, Lokio/Segment;->limit:I
iget v5, v0, Lokio/Segment;->pos:I
if-eq v4, v5, :cond_0
sub-int/2addr v4, v5
add-int/2addr v2, v4
add-int/lit8 v3, v3, 0x1
.line 63
iget-object v0, v0, Lokio/Segment;->next:Lokio/Segment;
goto :goto_0
.line 65
:cond_0
new-instance p1, Ljava/lang/AssertionError;
const-string p2, "s.limit == s.pos"
invoke-direct {p1, p2}, Ljava/lang/AssertionError;-><init>(Ljava/lang/Object;)V
throw p1
.line 72
:cond_1
new-array v0, v3, [[B
iput-object v0, p0, Lokio/SegmentedByteString;->segments:[[B
mul-int/lit8 v3, v3, 0x2
.line 73
new-array v0, v3, [I
iput-object v0, p0, Lokio/SegmentedByteString;->directory:[I
.line 76
iget-object p1, p1, Lokio/Buffer;->head:Lokio/Segment;
move v0, v1
:goto_1
if-ge v1, p2, :cond_3
iget-object v2, p0, Lokio/SegmentedByteString;->segments:[[B
.line 77
iget-object v3, p1, Lokio/Segment;->data:[B
aput-object v3, v2, v0
.line 78
iget v3, p1, Lokio/Segment;->limit:I
iget v4, p1, Lokio/Segment;->pos:I
sub-int/2addr v3, v4
add-int/2addr v1, v3
if-le v1, p2, :cond_2
move v1, p2
:cond_2
iget-object v3, p0, Lokio/SegmentedByteString;->directory:[I
.line 82
aput v1, v3, v0
.line 83
array-length v2, v2
add-int/2addr v2, v0
aput v4, v3, v2
const/4 v2, 0x1
.line 84
iput-boolean v2, p1, Lokio/Segment;->shared:Z
add-int/lit8 v0, v0, 0x1
.line 76
iget-object p1, p1, Lokio/Segment;->next:Lokio/Segment;
goto :goto_1
:cond_3
return-void
.end method
.method private writeReplace()Ljava/lang/Object;
.locals 1
.line 296
invoke-virtual {p0}, Lokio/SegmentedByteString;->toByteString()Lokio/ByteString;
move-result-object v0
return-object v0
.end method
# virtual methods
.method public base64()Ljava/lang/String;
.locals 1
.line 98
invoke-virtual {p0}, Lokio/SegmentedByteString;->toByteString()Lokio/ByteString;
move-result-object v0
invoke-virtual {v0}, Lokio/ByteString;->base64()Ljava/lang/String;
move-result-object v0
return-object v0
.end method
.method public equals(Ljava/lang/Object;)Z
.locals 4
const/4 v0, 0x1
if-ne p1, p0, :cond_0
return v0
.line 266
:cond_0
instance-of v1, p1, Lokio/ByteString;
const/4 v2, 0x0
if-eqz v1, :cond_1
check-cast p1, Lokio/ByteString;
.line 267
invoke-virtual {p1}, Lokio/ByteString;->size()I
move-result v1
invoke-virtual {p0}, Lokio/SegmentedByteString;->size()I
move-result v3
if-ne v1, v3, :cond_1
.line 268
invoke-virtual {p0}, Lokio/SegmentedByteString;->size()I
move-result v1
invoke-virtual {p0, v2, p1, v2, v1}, Lokio/SegmentedByteString;->rangeEquals(ILokio/ByteString;II)Z
move-result p1
if-eqz p1, :cond_1
goto :goto_0
:cond_1
move v0, v2
:goto_0
return v0
.end method
.method public getByte(I)B
.locals 7
iget-object v0, p0, Lokio/SegmentedByteString;->directory:[I
iget-object v1, p0, Lokio/SegmentedByteString;->segments:[[B
.line 146
array-length v1, v1
add-int/lit8 v1, v1, -0x1
aget v0, v0, v1
int-to-long v1, v0
int-to-long v3, p1
const-wide/16 v5, 0x1
invoke-static/range {v1 .. v6}, Lokio/Util;->checkOffsetAndCount(JJJ)V
.line 147
invoke-virtual {p0, p1}, Lokio/SegmentedByteString;->segment(I)I
move-result v0
if-nez v0, :cond_0
const/4 v1, 0x0
goto :goto_0
:cond_0
iget-object v1, p0, Lokio/SegmentedByteString;->directory:[I
add-int/lit8 v2, v0, -0x1
.line 148
aget v1, v1, v2
:goto_0
iget-object v2, p0, Lokio/SegmentedByteString;->directory:[I
iget-object v3, p0, Lokio/SegmentedByteString;->segments:[[B
.line 149
array-length v4, v3
add-int/2addr v4, v0
aget v2, v2, v4
.line 150
aget-object v0, v3, v0
sub-int/2addr p1, v1
add-int/2addr p1, v2
aget-byte p1, v0, p1
return p1
.end method
.method public hashCode()I
.locals 8
iget v0, p0, Lokio/ByteString;->hashCode:I
if-eqz v0, :cond_0
return v0
:cond_0
iget-object v0, p0, Lokio/SegmentedByteString;->segments:[[B
.line 278
array-length v0, v0
const/4 v1, 0x0
const/4 v2, 0x1
move v3, v2
move v2, v1
:goto_0
if-ge v1, v0, :cond_2
iget-object v4, p0, Lokio/SegmentedByteString;->segments:[[B
.line 279
aget-object v4, v4, v1
iget-object v5, p0, Lokio/SegmentedByteString;->directory:[I
add-int v6, v0, v1
.line 280
aget v6, v5, v6
.line 281
aget v5, v5, v1
sub-int v2, v5, v2
add-int/2addr v2, v6
:goto_1
if-ge v6, v2, :cond_1
mul-int/lit8 v3, v3, 0x1f
.line 284
aget-byte v7, v4, v6
add-int/2addr v3, v7
add-int/lit8 v6, v6, 0x1
goto :goto_1
:cond_1
add-int/lit8 v1, v1, 0x1
move v2, v5
goto :goto_0
:cond_2
iput v3, p0, Lokio/ByteString;->hashCode:I
return v3
.end method
.method public hex()Ljava/lang/String;
.locals 1
.line 102
invoke-virtual {p0}, Lokio/SegmentedByteString;->toByteString()Lokio/ByteString;
move-result-object v0
invoke-virtual {v0}, Lokio/ByteString;->hex()Ljava/lang/String;
move-result-object v0
return-object v0
.end method
.method public md5()Lokio/ByteString;
.locals 1
.line 114
invoke-virtual {p0}, Lokio/SegmentedByteString;->toByteString()Lokio/ByteString;
move-result-object v0
invoke-virtual {v0}, Lokio/ByteString;->md5()Lokio/ByteString;
move-result-object v0
return-object v0
.end method
.method public rangeEquals(ILokio/ByteString;II)Z
.locals 7
const/4 v0, 0x0
if-ltz p1, :cond_4
.line 211
invoke-virtual {p0}, Lokio/SegmentedByteString;->size()I
move-result v1
sub-int/2addr v1, p4
if-le p1, v1, :cond_0
goto :goto_2
.line 213
:cond_0
invoke-virtual {p0, p1}, Lokio/SegmentedByteString;->segment(I)I
move-result v1
:goto_0
if-lez p4, :cond_3
if-nez v1, :cond_1
move v2, v0
goto :goto_1
:cond_1
iget-object v2, p0, Lokio/SegmentedByteString;->directory:[I
add-int/lit8 v3, v1, -0x1
.line 214
aget v2, v2, v3
:goto_1
iget-object v3, p0, Lokio/SegmentedByteString;->directory:[I
.line 215
aget v3, v3, v1
sub-int/2addr v3, v2
add-int/2addr v3, v2
sub-int/2addr v3, p1
.line 216
invoke-static {p4, v3}, Ljava/lang/Math;->min(II)I
move-result v3
iget-object v4, p0, Lokio/SegmentedByteString;->directory:[I
iget-object v5, p0, Lokio/SegmentedByteString;->segments:[[B
.line 217
array-length v6, v5
add-int/2addr v6, v1
aget v4, v4, v6
sub-int v2, p1, v2
add-int/2addr v2, v4
.line 219
aget-object v4, v5, v1
invoke-virtual {p2, p3, v4, v2, v3}, Lokio/ByteString;->rangeEquals(I[BII)Z
move-result v2
if-nez v2, :cond_2
return v0
:cond_2
add-int/2addr p1, v3
add-int/2addr p3, v3
sub-int/2addr p4, v3
add-int/lit8 v1, v1, 0x1
goto :goto_0
:cond_3
const/4 p1, 0x1
return p1
:cond_4
:goto_2
return v0
.end method
.method public rangeEquals(I[BII)Z
.locals 7
const/4 v0, 0x0
if-ltz p1, :cond_4
.line 228
invoke-virtual {p0}, Lokio/SegmentedByteString;->size()I
move-result v1
sub-int/2addr v1, p4
if-gt p1, v1, :cond_4
if-ltz p3, :cond_4
array-length v1, p2
sub-int/2addr v1, p4
if-le p3, v1, :cond_0
goto :goto_2
.line 233
:cond_0
invoke-virtual {p0, p1}, Lokio/SegmentedByteString;->segment(I)I
move-result v1
:goto_0
if-lez p4, :cond_3
if-nez v1, :cond_1
move v2, v0
goto :goto_1
:cond_1
iget-object v2, p0, Lokio/SegmentedByteString;->directory:[I
add-int/lit8 v3, v1, -0x1
.line 234
aget v2, v2, v3
:goto_1
iget-object v3, p0, Lokio/SegmentedByteString;->directory:[I
.line 235
aget v3, v3, v1
sub-int/2addr v3, v2
add-int/2addr v3, v2
sub-int/2addr v3, p1
.line 236
invoke-static {p4, v3}, Ljava/lang/Math;->min(II)I
move-result v3
iget-object v4, p0, Lokio/SegmentedByteString;->directory:[I
iget-object v5, p0, Lokio/SegmentedByteString;->segments:[[B
.line 237
array-length v6, v5
add-int/2addr v6, v1
aget v4, v4, v6
sub-int v2, p1, v2
add-int/2addr v2, v4
.line 239
aget-object v4, v5, v1
invoke-static {v4, v2, p2, p3, v3}, Lokio/Util;->arrayRangeEquals([BI[BII)Z
move-result v2
if-nez v2, :cond_2
return v0
:cond_2
add-int/2addr p1, v3
add-int/2addr p3, v3
sub-int/2addr p4, v3
add-int/lit8 v1, v1, 0x1
goto :goto_0
:cond_3
const/4 p1, 0x1
return p1
:cond_4
:goto_2
return v0
.end method
.method public final segment(I)I
.locals 3
iget-object v0, p0, Lokio/SegmentedByteString;->directory:[I
iget-object v1, p0, Lokio/SegmentedByteString;->segments:[[B
.line 156
array-length v1, v1
add-int/lit8 p1, p1, 0x1
const/4 v2, 0x0
invoke-static {v0, v2, v1, p1}, Ljava/util/Arrays;->binarySearch([IIII)I
move-result p1
if-ltz p1, :cond_0
goto :goto_0
:cond_0
not-int p1, p1
:goto_0
return p1
.end method
.method public sha256()Lokio/ByteString;
.locals 1
.line 122
invoke-virtual {p0}, Lokio/SegmentedByteString;->toByteString()Lokio/ByteString;
move-result-object v0
invoke-virtual {v0}, Lokio/ByteString;->sha256()Lokio/ByteString;
move-result-object v0
return-object v0
.end method
.method public size()I
.locals 2
iget-object v0, p0, Lokio/SegmentedByteString;->directory:[I
iget-object v1, p0, Lokio/SegmentedByteString;->segments:[[B
.line 161
array-length v1, v1
add-int/lit8 v1, v1, -0x1
aget v0, v0, v1
return v0
.end method
.method public substring(II)Lokio/ByteString;
.locals 1
.line 142
invoke-virtual {p0}, Lokio/SegmentedByteString;->toByteString()Lokio/ByteString;
move-result-object v0
invoke-virtual {v0, p1, p2}, Lokio/ByteString;->substring(II)Lokio/ByteString;
move-result-object p1
return-object p1
.end method
.method public toAsciiLowercase()Lokio/ByteString;
.locals 1
.line 106
invoke-virtual {p0}, Lokio/SegmentedByteString;->toByteString()Lokio/ByteString;
move-result-object v0
invoke-virtual {v0}, Lokio/ByteString;->toAsciiLowercase()Lokio/ByteString;
move-result-object v0
return-object v0
.end method
.method public toByteArray()[B
.locals 8
iget-object v0, p0, Lokio/SegmentedByteString;->directory:[I
iget-object v1, p0, Lokio/SegmentedByteString;->segments:[[B
.line 165
array-length v2, v1
add-int/lit8 v2, v2, -0x1
aget v0, v0, v2
new-array v0, v0, [B
.line 167
array-length v1, v1
const/4 v2, 0x0
move v3, v2
:goto_0
if-ge v2, v1, :cond_0
iget-object v4, p0, Lokio/SegmentedByteString;->directory:[I
add-int v5, v1, v2
.line 168
aget v5, v4, v5
.line 169
aget v4, v4, v2
iget-object v6, p0, Lokio/SegmentedByteString;->segments:[[B
.line 170
aget-object v6, v6, v2
sub-int v7, v4, v3
invoke-static {v6, v5, v0, v3, v7}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
add-int/lit8 v2, v2, 0x1
move v3, v4
goto :goto_0
:cond_0
return-object v0
.end method
.method public final toByteString()Lokio/ByteString;
.locals 2
.line 257
new-instance v0, Lokio/ByteString;
invoke-virtual {p0}, Lokio/SegmentedByteString;->toByteArray()[B
move-result-object v1
invoke-direct {v0, v1}, Lokio/ByteString;-><init>([B)V
return-object v0
.end method
.method public toString()Ljava/lang/String;
.locals 1
.line 292
invoke-virtual {p0}, Lokio/SegmentedByteString;->toByteString()Lokio/ByteString;
move-result-object v0
invoke-virtual {v0}, Lokio/ByteString;->toString()Ljava/lang/String;
move-result-object v0
return-object v0
.end method
.method public utf8()Ljava/lang/String;
.locals 1
.line 90
invoke-virtual {p0}, Lokio/SegmentedByteString;->toByteString()Lokio/ByteString;
move-result-object v0
invoke-virtual {v0}, Lokio/ByteString;->utf8()Ljava/lang/String;
move-result-object v0
return-object v0
.end method
.method public write(Lokio/Buffer;)V
.locals 11
iget-object v0, p0, Lokio/SegmentedByteString;->segments:[[B
.line 194
array-length v0, v0
const/4 v1, 0x0
move v2, v1
:goto_0
if-ge v1, v0, :cond_1
iget-object v3, p0, Lokio/SegmentedByteString;->directory:[I
add-int v4, v0, v1
.line 195
aget v7, v3, v4
.line 196
aget v3, v3, v1
.line 197
new-instance v4, Lokio/Segment;
iget-object v5, p0, Lokio/SegmentedByteString;->segments:[[B
aget-object v6, v5, v1
add-int v5, v7, v3
sub-int v8, v5, v2
const/4 v9, 0x1
const/4 v10, 0x0
move-object v5, v4
invoke-direct/range {v5 .. v10}, Lokio/Segment;-><init>([BIIZZ)V
.line 199
iget-object v2, p1, Lokio/Buffer;->head:Lokio/Segment;
if-nez v2, :cond_0
iput-object v4, v4, Lokio/Segment;->prev:Lokio/Segment;
iput-object v4, v4, Lokio/Segment;->next:Lokio/Segment;
.line 200
iput-object v4, p1, Lokio/Buffer;->head:Lokio/Segment;
goto :goto_1
.line 202
:cond_0
iget-object v2, v2, Lokio/Segment;->prev:Lokio/Segment;
invoke-virtual {v2, v4}, Lokio/Segment;->push(Lokio/Segment;)Lokio/Segment;
:goto_1
add-int/lit8 v1, v1, 0x1
move v2, v3
goto :goto_0
.line 206
:cond_1
iget-wide v0, p1, Lokio/Buffer;->size:J
int-to-long v2, v2
add-long/2addr v0, v2
iput-wide v0, p1, Lokio/Buffer;->size:J
return-void
.end method

View File

@@ -0,0 +1,21 @@
.class public interface abstract Lokio/Sink;
.super Ljava/lang/Object;
.source "SourceFile"
# interfaces
.implements Ljava/io/Closeable;
.implements Ljava/io/Flushable;
# virtual methods
.method public abstract close()V
.end method
.method public abstract flush()V
.end method
.method public abstract timeout()Lokio/Timeout;
.end method
.method public abstract write(Lokio/Buffer;J)V
.end method

View File

@@ -0,0 +1,17 @@
.class public interface abstract Lokio/Source;
.super Ljava/lang/Object;
.source "SourceFile"
# interfaces
.implements Ljava/io/Closeable;
# virtual methods
.method public abstract close()V
.end method
.method public abstract read(Lokio/Buffer;J)J
.end method
.method public abstract timeout()Lokio/Timeout;
.end method

View File

@@ -0,0 +1,45 @@
.class public final Lokio/Timeout$1;
.super Lokio/Timeout;
.source "SourceFile"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lokio/Timeout;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x1
name = null
.end annotation
# direct methods
.method public constructor <init>()V
.locals 0
.line 48
invoke-direct {p0}, Lokio/Timeout;-><init>()V
return-void
.end method
# virtual methods
.method public deadlineNanoTime(J)Lokio/Timeout;
.locals 0
return-object p0
.end method
.method public throwIfReached()V
.locals 0
return-void
.end method
.method public timeout(JLjava/util/concurrent/TimeUnit;)Lokio/Timeout;
.locals 0
return-object p0
.end method

View File

@@ -0,0 +1,228 @@
.class public Lokio/Timeout;
.super Ljava/lang/Object;
.source "SourceFile"
# static fields
.field public static final NONE:Lokio/Timeout;
# instance fields
.field public deadlineNanoTime:J
.field public hasDeadline:Z
.field public timeoutNanos:J
# direct methods
.method static constructor <clinit>()V
.locals 1
.line 48
new-instance v0, Lokio/Timeout$1;
invoke-direct {v0}, Lokio/Timeout$1;-><init>()V
sput-object v0, Lokio/Timeout;->NONE:Lokio/Timeout;
return-void
.end method
.method public constructor <init>()V
.locals 0
.line 69
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
# virtual methods
.method public clearDeadline()Lokio/Timeout;
.locals 1
const/4 v0, 0x0
iput-boolean v0, p0, Lokio/Timeout;->hasDeadline:Z
return-object p0
.end method
.method public clearTimeout()Lokio/Timeout;
.locals 2
const-wide/16 v0, 0x0
iput-wide v0, p0, Lokio/Timeout;->timeoutNanos:J
return-object p0
.end method
.method public deadlineNanoTime()J
.locals 2
iget-boolean v0, p0, Lokio/Timeout;->hasDeadline:Z
if-eqz v0, :cond_0
iget-wide v0, p0, Lokio/Timeout;->deadlineNanoTime:J
return-wide v0
.line 104
:cond_0
new-instance v0, Ljava/lang/IllegalStateException;
const-string v1, "No deadline"
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw v0
.end method
.method public deadlineNanoTime(J)Lokio/Timeout;
.locals 1
.line 0
const/4 v0, 0x1
iput-boolean v0, p0, Lokio/Timeout;->hasDeadline:Z
iput-wide p1, p0, Lokio/Timeout;->deadlineNanoTime:J
return-object p0
.end method
.method public hasDeadline()Z
.locals 1
iget-boolean v0, p0, Lokio/Timeout;->hasDeadline:Z
return v0
.end method
.method public throwIfReached()V
.locals 4
.line 144
invoke-static {}, Ljava/lang/Thread;->interrupted()Z
move-result v0
if-nez v0, :cond_2
iget-boolean v0, p0, Lokio/Timeout;->hasDeadline:Z
if-eqz v0, :cond_1
iget-wide v0, p0, Lokio/Timeout;->deadlineNanoTime:J
.line 149
invoke-static {}, Ljava/lang/System;->nanoTime()J
move-result-wide v2
sub-long/2addr v0, v2
const-wide/16 v2, 0x0
cmp-long v0, v0, v2
if-lez v0, :cond_0
goto :goto_0
.line 150
:cond_0
new-instance v0, Ljava/io/InterruptedIOException;
const-string v1, "deadline reached"
invoke-direct {v0, v1}, Ljava/io/InterruptedIOException;-><init>(Ljava/lang/String;)V
throw v0
:cond_1
:goto_0
return-void
.line 145
:cond_2
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/Thread;->interrupt()V
.line 146
new-instance v0, Ljava/io/InterruptedIOException;
const-string v1, "interrupted"
invoke-direct {v0, v1}, Ljava/io/InterruptedIOException;-><init>(Ljava/lang/String;)V
throw v0
.end method
.method public timeout(JLjava/util/concurrent/TimeUnit;)Lokio/Timeout;
.locals 2
const-wide/16 v0, 0x0
cmp-long v0, p1, v0
if-ltz v0, :cond_1
if-eqz p3, :cond_0
.line 83
invoke-virtual {p3, p1, p2}, Ljava/util/concurrent/TimeUnit;->toNanos(J)J
move-result-wide p1
iput-wide p1, p0, Lokio/Timeout;->timeoutNanos:J
return-object p0
.line 82
:cond_0
new-instance p1, Ljava/lang/IllegalArgumentException;
const-string p2, "unit == null"
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p1
.line 81
:cond_1
new-instance p3, Ljava/lang/IllegalArgumentException;
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
const-string v1, "timeout < 0: "
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0, p1, p2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p1
invoke-direct {p3, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p3
.end method
.method public timeoutNanos()J
.locals 2
iget-wide v0, p0, Lokio/Timeout;->timeoutNanos:J
return-wide v0
.end method

View File

@@ -0,0 +1,183 @@
.class public abstract Lokio/Util;
.super Ljava/lang/Object;
.source "SourceFile"
# static fields
.field public static final UTF_8:Ljava/nio/charset/Charset;
# direct methods
.method static constructor <clinit>()V
.locals 1
const-string v0, "UTF-8"
.line 22
invoke-static {v0}, Ljava/nio/charset/Charset;->forName(Ljava/lang/String;)Ljava/nio/charset/Charset;
move-result-object v0
sput-object v0, Lokio/Util;->UTF_8:Ljava/nio/charset/Charset;
return-void
.end method
.method public static arrayRangeEquals([BI[BII)Z
.locals 4
const/4 v0, 0x0
move v1, v0
:goto_0
if-ge v1, p4, :cond_1
add-int v2, v1, p1
.line 76
aget-byte v2, p0, v2
add-int v3, v1, p3
aget-byte v3, p2, v3
if-eq v2, v3, :cond_0
return v0
:cond_0
add-int/lit8 v1, v1, 0x1
goto :goto_0
:cond_1
const/4 p0, 0x1
return p0
.end method
.method public static checkOffsetAndCount(JJJ)V
.locals 4
or-long v0, p2, p4
const-wide/16 v2, 0x0
cmp-long v0, v0, v2
if-ltz v0, :cond_0
cmp-long v0, p2, p0
if-gtz v0, :cond_0
sub-long v0, p0, p2
cmp-long v0, v0, p4
if-ltz v0, :cond_0
return-void
.line 29
:cond_0
new-instance v0, Ljava/lang/ArrayIndexOutOfBoundsException;
.line 30
invoke-static {p0, p1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
move-result-object p0
invoke-static {p2, p3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
move-result-object p1
invoke-static {p4, p5}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
move-result-object p2
filled-new-array {p0, p1, p2}, [Ljava/lang/Object;
move-result-object p0
const-string p1, "size=%s offset=%s byteCount=%s"
invoke-static {p1, p0}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
move-result-object p0
invoke-direct {v0, p0}, Ljava/lang/ArrayIndexOutOfBoundsException;-><init>(Ljava/lang/String;)V
throw v0
.end method
.method public static reverseBytesInt(I)I
.locals 2
const/high16 v0, -0x1000000
and-int/2addr v0, p0
ushr-int/lit8 v0, v0, 0x18
const/high16 v1, 0xff0000
and-int/2addr v1, p0
ushr-int/lit8 v1, v1, 0x8
or-int/2addr v0, v1
const v1, 0xff00
and-int/2addr v1, p0
shl-int/lit8 v1, v1, 0x8
or-int/2addr v0, v1
and-int/lit16 p0, p0, 0xff
shl-int/lit8 p0, p0, 0x18
or-int/2addr p0, v0
return p0
.end method
.method public static reverseBytesShort(S)S
.locals 1
const v0, 0xff00
and-int/2addr v0, p0
ushr-int/lit8 v0, v0, 0x8
and-int/lit16 p0, p0, 0xff
shl-int/lit8 p0, p0, 0x8
or-int/2addr p0, v0
int-to-short p0, p0
return p0
.end method
.method public static sneakyRethrow(Ljava/lang/Throwable;)V
.locals 0
.line 65
invoke-static {p0}, Lokio/Util;->sneakyThrow2(Ljava/lang/Throwable;)V
return-void
.end method
.method public static sneakyThrow2(Ljava/lang/Throwable;)V
.locals 0
.line 70
throw p0
.end method