110 lines
2.1 KiB
Smali
110 lines
2.1 KiB
Smali
.class public final Lcom/facebook/common/internal/ByteStreams;
|
|
.super Ljava/lang/Object;
|
|
.source "ByteStreams.java"
|
|
|
|
|
|
# direct methods
|
|
.method public static a(Ljava/io/InputStream;[BII)I
|
|
.locals 3
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
.line 95
|
|
invoke-static {p0}, Lcom/facebook/common/internal/Preconditions;->a(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
.line 96
|
|
invoke-static {p1}, Lcom/facebook/common/internal/Preconditions;->a(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
if-gez p3, :cond_0
|
|
|
|
.line 98
|
|
new-instance p0, Ljava/lang/IndexOutOfBoundsException;
|
|
|
|
const-string p1, "len is negative"
|
|
|
|
invoke-direct {p0, p1}, Ljava/lang/IndexOutOfBoundsException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
if-ge v0, p3, :cond_2
|
|
|
|
add-int v1, p2, v0
|
|
|
|
sub-int v2, p3, v0
|
|
|
|
.line 102
|
|
invoke-virtual {p0, p1, v1, v2}, Ljava/io/InputStream;->read([BII)I
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, -0x1
|
|
|
|
if-ne v1, v2, :cond_1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
add-int/2addr v0, v1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
:goto_1
|
|
return v0
|
|
.end method
|
|
|
|
.method public static a(Ljava/io/InputStream;Ljava/io/OutputStream;)J
|
|
.locals 7
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
.line 54
|
|
invoke-static {p0}, Lcom/facebook/common/internal/Preconditions;->a(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
.line 55
|
|
invoke-static {p1}, Lcom/facebook/common/internal/Preconditions;->a(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
const/16 v0, 0x1000
|
|
|
|
.line 56
|
|
new-array v0, v0, [B
|
|
|
|
const-wide/16 v1, 0x0
|
|
|
|
.line 59
|
|
:goto_0
|
|
invoke-virtual {p0, v0}, Ljava/io/InputStream;->read([B)I
|
|
|
|
move-result v3
|
|
|
|
const/4 v4, -0x1
|
|
|
|
if-ne v3, v4, :cond_0
|
|
|
|
return-wide v1
|
|
|
|
:cond_0
|
|
const/4 v4, 0x0
|
|
|
|
.line 63
|
|
invoke-virtual {p1, v0, v4, v3}, Ljava/io/OutputStream;->write([BII)V
|
|
|
|
int-to-long v3, v3
|
|
|
|
add-long v5, v1, v3
|
|
|
|
move-wide v1, v5
|
|
|
|
goto :goto_0
|
|
.end method
|