FileOperator.smali
.class public final Lokhttp3/internal/cache2/FileOperator;
.super Ljava/lang/Object;
.source "FileOperator.kt"
# annotations
.annotation runtime Lkotlin/Metadata;
bv = {
0x1,
0x0,
0x3
}
d1 = {
"\u0000&\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0002\u0008\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\t\n\u0000\n\u0002\u0018\u0002\n\u0002\u0008\u0004\u0008\u0000\u0018\u00002\u00020\u0001B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u00a2\u0006\u0002\u0010\u0004J\u001e\u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\u00082\u0006\u0010\t\u001a\u00020\n2\u0006\u0010\u000b\u001a\u00020\u0008J\u001e\u0010\u000c\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\u00082\u0006\u0010\r\u001a\u00020\n2\u0006\u0010\u000b\u001a\u00020\u0008R\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004\u00a2\u0006\u0002\n\u0000\u00a8\u0006\u000e"
}
d2 = {
"Lokhttp3/internal/cache2/FileOperator;",
"",
"fileChannel",
"Ljava/nio/channels/FileChannel;",
"(Ljava/nio/channels/FileChannel;)V",
"read",
"",
"pos",
"",
"sink",
"Lokio/Buffer;",
"byteCount",
"write",
"source",
"okhttp"
}
k = 0x1
mv = {
0x1,
0x1,
0x10
}
.end annotation
# instance fields
.field private final fileChannel:Ljava/nio/channels/FileChannel;
# direct methods
.method public constructor <init>(Ljava/nio/channels/FileChannel;)V
.registers 3
const-string v0, "fileChannel"
invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
.line 32
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
iput-object p1, p0, Lokhttp3/internal/cache2/FileOperator;->fileChannel:Ljava/nio/channels/FileChannel;
return-void
.end method
# virtual methods
.method public final read(JLokio/Buffer;J)V
.registers 15
const-string v0, "sink"
invoke-static {p3, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
const-wide/16 v0, 0x0
cmp-long v2, p4, v0
if-ltz v2, :cond_1e
:goto_b
cmp-long v2, p4, v0
if-lez v2, :cond_1d
.line 65
iget-object v3, p0, Lokhttp3/internal/cache2/FileOperator;->fileChannel:Ljava/nio/channels/FileChannel;
move-object v8, p3
check-cast v8, Ljava/nio/channels/WritableByteChannel;
move-wide v4, p1
move-wide v6, p4
invoke-virtual/range {v3 .. v8}, Ljava/nio/channels/FileChannel;->transferTo(JJLjava/nio/channels/WritableByteChannel;)J
move-result-wide v2
add-long/2addr p1, v2
sub-long/2addr p4, v2
goto :goto_b
:cond_1d
return-void
.line 59
:cond_1e
new-instance p1, Ljava/lang/IndexOutOfBoundsException;
invoke-direct {p1}, Ljava/lang/IndexOutOfBoundsException;-><init>()V
check-cast p1, Ljava/lang/Throwable;
throw p1
.end method
.method public final write(JLokio/Buffer;J)V
.registers 20
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
move-object/from16 v0, p3
const-string v1, "source"
invoke-static {v0, v1}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
const-wide/16 v1, 0x0
cmp-long v3, p4, v1
if-ltz v3, :cond_2d
.line 39
invoke-virtual/range {p3 .. p3}, Lokio/Buffer;->size()J
move-result-wide v3
cmp-long v5, p4, v3
if-gtz v5, :cond_2d
move-wide v3, p1
move-wide/from16 v12, p4
:goto_18
cmp-long v5, v12, v1
if-lez v5, :cond_2b
move-object v5, p0
.line 46
iget-object v6, v5, Lokhttp3/internal/cache2/FileOperator;->fileChannel:Ljava/nio/channels/FileChannel;
move-object v7, v0
check-cast v7, Ljava/nio/channels/ReadableByteChannel;
move-wide v8, v3
move-wide v10, v12
invoke-virtual/range {v6 .. v11}, Ljava/nio/channels/FileChannel;->transferFrom(Ljava/nio/channels/ReadableByteChannel;JJ)J
move-result-wide v6
add-long/2addr v3, v6
sub-long/2addr v12, v6
goto :goto_18
:cond_2b
move-object v5, p0
return-void
:cond_2d
move-object v5, p0
.line 40
new-instance v0, Ljava/lang/IndexOutOfBoundsException;
invoke-direct {v0}, Ljava/lang/IndexOutOfBoundsException;-><init>()V
check-cast v0, Ljava/lang/Throwable;
throw v0
.end method