今奥全景相机
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1337 lines
33 KiB

.class public final Lcom/google/common/io/ByteStreams;
.super Ljava/lang/Object;
.source "ByteStreams.java"
# annotations
.annotation build Lcom/google/common/annotations/Beta;
.end annotation
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/google/common/io/ByteStreams$LimitedInputStream;,
Lcom/google/common/io/ByteStreams$ByteArrayDataOutputStream;,
Lcom/google/common/io/ByteStreams$ByteArrayDataInputStream;,
Lcom/google/common/io/ByteStreams$FastByteArrayOutputStream;
}
.end annotation
# static fields
.field private static final BUF_SIZE:I = 0x1000
.field private static final NULL_OUTPUT_STREAM:Ljava/io/OutputStream;
# direct methods
.method static constructor <clinit>()V
.locals 1
.prologue
.line 626
new-instance v0, Lcom/google/common/io/ByteStreams$1;
invoke-direct {v0}, Lcom/google/common/io/ByteStreams$1;-><init>()V
sput-object v0, Lcom/google/common/io/ByteStreams;->NULL_OUTPUT_STREAM:Ljava/io/OutputStream;
return-void
.end method
.method private constructor <init>()V
.locals 0
.prologue
.line 56
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method public static asByteSink(Lcom/google/common/io/OutputSupplier;)Lcom/google/common/io/ByteSink;
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lcom/google/common/io/OutputSupplier",
"<+",
"Ljava/io/OutputStream;",
">;)",
"Lcom/google/common/io/ByteSink;"
}
.end annotation
.annotation runtime Ljava/lang/Deprecated;
.end annotation
.prologue
.line 1052
invoke-static {p0}, Lcom/google/common/base/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
.line 1053
new-instance v0, Lcom/google/common/io/ByteStreams$4;
invoke-direct {v0, p0}, Lcom/google/common/io/ByteStreams$4;-><init>(Lcom/google/common/io/OutputSupplier;)V
return-object v0
.end method
.method public static asByteSource(Lcom/google/common/io/InputSupplier;)Lcom/google/common/io/ByteSource;
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lcom/google/common/io/InputSupplier",
"<+",
"Ljava/io/InputStream;",
">;)",
"Lcom/google/common/io/ByteSource;"
}
.end annotation
.annotation runtime Ljava/lang/Deprecated;
.end annotation
.prologue
.line 1022
invoke-static {p0}, Lcom/google/common/base/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
.line 1023
new-instance v0, Lcom/google/common/io/ByteStreams$3;
invoke-direct {v0, p0}, Lcom/google/common/io/ByteStreams$3;-><init>(Lcom/google/common/io/InputSupplier;)V
return-object v0
.end method
.method static asInputSupplier(Lcom/google/common/io/ByteSource;)Lcom/google/common/io/InputSupplier;
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"<S:",
"Ljava/io/InputStream;",
">(",
"Lcom/google/common/io/ByteSource;",
")",
"Lcom/google/common/io/InputSupplier",
"<TS;>;"
}
.end annotation
.prologue
.line 1069
invoke-static {p0}, Lcom/google/common/base/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Lcom/google/common/io/InputSupplier;
return-object v0
.end method
.method static asOutputSupplier(Lcom/google/common/io/ByteSink;)Lcom/google/common/io/OutputSupplier;
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"<S:",
"Ljava/io/OutputStream;",
">(",
"Lcom/google/common/io/ByteSink;",
")",
"Lcom/google/common/io/OutputSupplier",
"<TS;>;"
}
.end annotation
.prologue
.line 1075
invoke-static {p0}, Lcom/google/common/base/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Lcom/google/common/io/OutputSupplier;
return-object v0
.end method
.method public static copy(Lcom/google/common/io/InputSupplier;Lcom/google/common/io/OutputSupplier;)J
.locals 2
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lcom/google/common/io/InputSupplier",
"<+",
"Ljava/io/InputStream;",
">;",
"Lcom/google/common/io/OutputSupplier",
"<+",
"Ljava/io/OutputStream;",
">;)J"
}
.end annotation
.annotation runtime Ljava/lang/Deprecated;
.end annotation
.prologue
.line 119
invoke-static {p0}, Lcom/google/common/io/ByteStreams;->asByteSource(Lcom/google/common/io/InputSupplier;)Lcom/google/common/io/ByteSource;
move-result-object v0
invoke-static {p1}, Lcom/google/common/io/ByteStreams;->asByteSink(Lcom/google/common/io/OutputSupplier;)Lcom/google/common/io/ByteSink;
move-result-object v1
invoke-virtual {v0, v1}, Lcom/google/common/io/ByteSource;->copyTo(Lcom/google/common/io/ByteSink;)J
move-result-wide v0
return-wide v0
.end method
.method public static copy(Lcom/google/common/io/InputSupplier;Ljava/io/OutputStream;)J
.locals 2
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lcom/google/common/io/InputSupplier",
"<+",
"Ljava/io/InputStream;",
">;",
"Ljava/io/OutputStream;",
")J"
}
.end annotation
.annotation runtime Ljava/lang/Deprecated;
.end annotation
.prologue
.line 137
invoke-static {p0}, Lcom/google/common/io/ByteStreams;->asByteSource(Lcom/google/common/io/InputSupplier;)Lcom/google/common/io/ByteSource;
move-result-object v0
invoke-virtual {v0, p1}, Lcom/google/common/io/ByteSource;->copyTo(Ljava/io/OutputStream;)J
move-result-wide v0
return-wide v0
.end method
.method public static copy(Ljava/io/InputStream;Lcom/google/common/io/OutputSupplier;)J
.locals 2
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/io/InputStream;",
"Lcom/google/common/io/OutputSupplier",
"<+",
"Ljava/io/OutputStream;",
">;)J"
}
.end annotation
.annotation runtime Ljava/lang/Deprecated;
.end annotation
.prologue
.line 156
invoke-static {p1}, Lcom/google/common/io/ByteStreams;->asByteSink(Lcom/google/common/io/OutputSupplier;)Lcom/google/common/io/ByteSink;
move-result-object v0
invoke-virtual {v0, p0}, Lcom/google/common/io/ByteSink;->writeFrom(Ljava/io/InputStream;)J
move-result-wide v0
return-wide v0
.end method
.method public static copy(Ljava/io/InputStream;Ljava/io/OutputStream;)J
.locals 6
.prologue
.line 170
invoke-static {p0}, Lcom/google/common/base/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
.line 171
invoke-static {p1}, Lcom/google/common/base/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
.line 172
const/16 v0, 0x1000
new-array v2, v0, [B
.line 173
const-wide/16 v0, 0x0
.line 175
:goto_0
invoke-virtual {p0, v2}, Ljava/io/InputStream;->read([B)I
move-result v3
.line 176
const/4 v4, -0x1
if-ne v3, v4, :cond_0
.line 182
return-wide v0
.line 179
:cond_0
const/4 v4, 0x0
invoke-virtual {p1, v2, v4, v3}, Ljava/io/OutputStream;->write([BII)V
.line 180
int-to-long v4, v3
add-long/2addr v0, v4
.line 181
goto :goto_0
.end method
.method public static copy(Ljava/nio/channels/ReadableByteChannel;Ljava/nio/channels/WritableByteChannel;)J
.locals 6
.prologue
.line 196
invoke-static {p0}, Lcom/google/common/base/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
.line 197
invoke-static {p1}, Lcom/google/common/base/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
.line 198
const/16 v0, 0x1000
invoke-static {v0}, Ljava/nio/ByteBuffer;->allocate(I)Ljava/nio/ByteBuffer;
move-result-object v2
.line 199
const-wide/16 v0, 0x0
.line 200
:goto_0
invoke-interface {p0, v2}, Ljava/nio/channels/ReadableByteChannel;->read(Ljava/nio/ByteBuffer;)I
move-result v3
const/4 v4, -0x1
if-eq v3, v4, :cond_1
.line 201
invoke-virtual {v2}, Ljava/nio/ByteBuffer;->flip()Ljava/nio/Buffer;
.line 202
:goto_1
invoke-virtual {v2}, Ljava/nio/ByteBuffer;->hasRemaining()Z
move-result v3
if-eqz v3, :cond_0
.line 203
invoke-interface {p1, v2}, Ljava/nio/channels/WritableByteChannel;->write(Ljava/nio/ByteBuffer;)I
move-result v3
int-to-long v4, v3
add-long/2addr v0, v4
goto :goto_1
.line 205
:cond_0
invoke-virtual {v2}, Ljava/nio/ByteBuffer;->clear()Ljava/nio/Buffer;
goto :goto_0
.line 207
:cond_1
return-wide v0
.end method
.method private static copyOf([BI)[B
.locals 2
.prologue
const/4 v1, 0x0
.line 264
new-array v0, p1, [B
.line 265
invoke-static {p0, v1, v0, v1, p1}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
.line 266
return-object v0
.end method
.method public static equal(Lcom/google/common/io/InputSupplier;Lcom/google/common/io/InputSupplier;)Z
.locals 2
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lcom/google/common/io/InputSupplier",
"<+",
"Ljava/io/InputStream;",
">;",
"Lcom/google/common/io/InputSupplier",
"<+",
"Ljava/io/InputStream;",
">;)Z"
}
.end annotation
.annotation runtime Ljava/lang/Deprecated;
.end annotation
.prologue
.line 757
invoke-static {p0}, Lcom/google/common/io/ByteStreams;->asByteSource(Lcom/google/common/io/InputSupplier;)Lcom/google/common/io/ByteSource;
move-result-object v0
invoke-static {p1}, Lcom/google/common/io/ByteStreams;->asByteSource(Lcom/google/common/io/InputSupplier;)Lcom/google/common/io/ByteSource;
move-result-object v1
invoke-virtual {v0, v1}, Lcom/google/common/io/ByteSource;->contentEquals(Lcom/google/common/io/ByteSource;)Z
move-result v0
return v0
.end method
.method public static hash(Lcom/google/common/io/InputSupplier;Lcom/google/common/hash/HashFunction;)Lcom/google/common/hash/HashCode;
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lcom/google/common/io/InputSupplier",
"<+",
"Ljava/io/InputStream;",
">;",
"Lcom/google/common/hash/HashFunction;",
")",
"Lcom/google/common/hash/HashCode;"
}
.end annotation
.annotation runtime Ljava/lang/Deprecated;
.end annotation
.prologue
.line 894
invoke-static {p0}, Lcom/google/common/io/ByteStreams;->asByteSource(Lcom/google/common/io/InputSupplier;)Lcom/google/common/io/ByteSource;
move-result-object v0
invoke-virtual {v0, p1}, Lcom/google/common/io/ByteSource;->hash(Lcom/google/common/hash/HashFunction;)Lcom/google/common/hash/HashCode;
move-result-object v0
return-object v0
.end method
.method public static join(Ljava/lang/Iterable;)Lcom/google/common/io/InputSupplier;
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/lang/Iterable",
"<+",
"Lcom/google/common/io/InputSupplier",
"<+",
"Ljava/io/InputStream;",
">;>;)",
"Lcom/google/common/io/InputSupplier",
"<",
"Ljava/io/InputStream;",
">;"
}
.end annotation
.annotation runtime Ljava/lang/Deprecated;
.end annotation
.prologue
.line 980
invoke-static {p0}, Lcom/google/common/base/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
.line 981
new-instance v0, Lcom/google/common/io/ByteStreams$2;
invoke-direct {v0}, Lcom/google/common/io/ByteStreams$2;-><init>()V
invoke-static {p0, v0}, Lcom/google/common/collect/Iterables;->transform(Ljava/lang/Iterable;Lcom/google/common/base/Function;)Ljava/lang/Iterable;
move-result-object v0
.line 988
invoke-static {v0}, Lcom/google/common/io/ByteSource;->concat(Ljava/lang/Iterable;)Lcom/google/common/io/ByteSource;
move-result-object v0
invoke-static {v0}, Lcom/google/common/io/ByteStreams;->asInputSupplier(Lcom/google/common/io/ByteSource;)Lcom/google/common/io/InputSupplier;
move-result-object v0
return-object v0
.end method
.method public static varargs join([Lcom/google/common/io/InputSupplier;)Lcom/google/common/io/InputSupplier;
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"([",
"Lcom/google/common/io/InputSupplier",
"<+",
"Ljava/io/InputStream;",
">;)",
"Lcom/google/common/io/InputSupplier",
"<",
"Ljava/io/InputStream;",
">;"
}
.end annotation
.annotation runtime Ljava/lang/Deprecated;
.end annotation
.prologue
.line 1001
invoke-static {p0}, Ljava/util/Arrays;->asList([Ljava/lang/Object;)Ljava/util/List;
move-result-object v0
invoke-static {v0}, Lcom/google/common/io/ByteStreams;->join(Ljava/lang/Iterable;)Lcom/google/common/io/InputSupplier;
move-result-object v0
return-object v0
.end method
.method public static length(Lcom/google/common/io/InputSupplier;)J
.locals 2
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lcom/google/common/io/InputSupplier",
"<+",
"Ljava/io/InputStream;",
">;)J"
}
.end annotation
.annotation runtime Ljava/lang/Deprecated;
.end annotation
.prologue
.line 744
invoke-static {p0}, Lcom/google/common/io/ByteStreams;->asByteSource(Lcom/google/common/io/InputSupplier;)Lcom/google/common/io/ByteSource;
move-result-object v0
invoke-virtual {v0}, Lcom/google/common/io/ByteSource;->size()J
move-result-wide v0
return-wide v0
.end method
.method public static limit(Ljava/io/InputStream;J)Ljava/io/InputStream;
.locals 1
.prologue
.line 665
new-instance v0, Lcom/google/common/io/ByteStreams$LimitedInputStream;
invoke-direct {v0, p0, p1, p2}, Lcom/google/common/io/ByteStreams$LimitedInputStream;-><init>(Ljava/io/InputStream;J)V
return-object v0
.end method
.method public static newDataInput(Ljava/io/ByteArrayInputStream;)Lcom/google/common/io/ByteArrayDataInput;
.locals 2
.prologue
.line 327
new-instance v1, Lcom/google/common/io/ByteStreams$ByteArrayDataInputStream;
invoke-static {p0}, Lcom/google/common/base/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/io/ByteArrayInputStream;
invoke-direct {v1, v0}, Lcom/google/common/io/ByteStreams$ByteArrayDataInputStream;-><init>(Ljava/io/ByteArrayInputStream;)V
return-object v1
.end method
.method public static newDataInput([B)Lcom/google/common/io/ByteArrayDataInput;
.locals 1
.prologue
.line 302
new-instance v0, Ljava/io/ByteArrayInputStream;
invoke-direct {v0, p0}, Ljava/io/ByteArrayInputStream;-><init>([B)V
invoke-static {v0}, Lcom/google/common/io/ByteStreams;->newDataInput(Ljava/io/ByteArrayInputStream;)Lcom/google/common/io/ByteArrayDataInput;
move-result-object v0
return-object v0
.end method
.method public static newDataInput([BI)Lcom/google/common/io/ByteArrayDataInput;
.locals 2
.prologue
.line 313
array-length v0, p0
invoke-static {p1, v0}, Lcom/google/common/base/Preconditions;->checkPositionIndex(II)I
.line 314
new-instance v0, Ljava/io/ByteArrayInputStream;
array-length v1, p0
sub-int/2addr v1, p1
invoke-direct {v0, p0, p1, v1}, Ljava/io/ByteArrayInputStream;-><init>([BII)V
invoke-static {v0}, Lcom/google/common/io/ByteStreams;->newDataInput(Ljava/io/ByteArrayInputStream;)Lcom/google/common/io/ByteArrayDataInput;
move-result-object v0
return-object v0
.end method
.method public static newDataOutput()Lcom/google/common/io/ByteArrayDataOutput;
.locals 1
.prologue
.line 464
new-instance v0, Ljava/io/ByteArrayOutputStream;
invoke-direct {v0}, Ljava/io/ByteArrayOutputStream;-><init>()V
invoke-static {v0}, Lcom/google/common/io/ByteStreams;->newDataOutput(Ljava/io/ByteArrayOutputStream;)Lcom/google/common/io/ByteArrayDataOutput;
move-result-object v0
return-object v0
.end method
.method public static newDataOutput(I)Lcom/google/common/io/ByteArrayDataOutput;
.locals 5
.prologue
const/4 v1, 0x1
const/4 v2, 0x0
.line 474
if-ltz p0, :cond_0
move v0, v1
:goto_0
const-string v3, "Invalid size: %s"
new-array v1, v1, [Ljava/lang/Object;
invoke-static {p0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v4
aput-object v4, v1, v2
invoke-static {v0, v3, v1}, Lcom/google/common/base/Preconditions;->checkArgument(ZLjava/lang/String;[Ljava/lang/Object;)V
.line 475
new-instance v0, Ljava/io/ByteArrayOutputStream;
invoke-direct {v0, p0}, Ljava/io/ByteArrayOutputStream;-><init>(I)V
invoke-static {v0}, Lcom/google/common/io/ByteStreams;->newDataOutput(Ljava/io/ByteArrayOutputStream;)Lcom/google/common/io/ByteArrayDataOutput;
move-result-object v0
return-object v0
:cond_0
move v0, v2
.line 474
goto :goto_0
.end method
.method public static newDataOutput(Ljava/io/ByteArrayOutputStream;)Lcom/google/common/io/ByteArrayDataOutput;
.locals 2
.prologue
.line 494
new-instance v1, Lcom/google/common/io/ByteStreams$ByteArrayDataOutputStream;
invoke-static {p0}, Lcom/google/common/base/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/io/ByteArrayOutputStream;
invoke-direct {v1, v0}, Lcom/google/common/io/ByteStreams$ByteArrayDataOutputStream;-><init>(Ljava/io/ByteArrayOutputStream;)V
return-object v1
.end method
.method public static newInputStreamSupplier([B)Lcom/google/common/io/InputSupplier;
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"([B)",
"Lcom/google/common/io/InputSupplier",
"<",
"Ljava/io/ByteArrayInputStream;",
">;"
}
.end annotation
.annotation runtime Ljava/lang/Deprecated;
.end annotation
.prologue
.line 70
invoke-static {p0}, Lcom/google/common/io/ByteSource;->wrap([B)Lcom/google/common/io/ByteSource;
move-result-object v0
invoke-static {v0}, Lcom/google/common/io/ByteStreams;->asInputSupplier(Lcom/google/common/io/ByteSource;)Lcom/google/common/io/InputSupplier;
move-result-object v0
return-object v0
.end method
.method public static newInputStreamSupplier([BII)Lcom/google/common/io/InputSupplier;
.locals 6
.annotation system Ldalvik/annotation/Signature;
value = {
"([BII)",
"Lcom/google/common/io/InputSupplier",
"<",
"Ljava/io/ByteArrayInputStream;",
">;"
}
.end annotation
.annotation runtime Ljava/lang/Deprecated;
.end annotation
.prologue
.line 87
invoke-static {p0}, Lcom/google/common/io/ByteSource;->wrap([B)Lcom/google/common/io/ByteSource;
move-result-object v0
int-to-long v2, p1
int-to-long v4, p2
invoke-virtual {v0, v2, v3, v4, v5}, Lcom/google/common/io/ByteSource;->slice(JJ)Lcom/google/common/io/ByteSource;
move-result-object v0
invoke-static {v0}, Lcom/google/common/io/ByteStreams;->asInputSupplier(Lcom/google/common/io/ByteSource;)Lcom/google/common/io/InputSupplier;
move-result-object v0
return-object v0
.end method
.method public static nullOutputStream()Ljava/io/OutputStream;
.locals 1
.prologue
.line 652
sget-object v0, Lcom/google/common/io/ByteStreams;->NULL_OUTPUT_STREAM:Ljava/io/OutputStream;
return-object v0
.end method
.method public static read(Ljava/io/InputStream;[BII)I
.locals 3
.prologue
.line 923
invoke-static {p0}, Lcom/google/common/base/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
.line 924
invoke-static {p1}, Lcom/google/common/base/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
.line 925
if-gez p3, :cond_0
.line 926
new-instance v0, Ljava/lang/IndexOutOfBoundsException;
const-string v1, "len is negative"
invoke-direct {v0, v1}, Ljava/lang/IndexOutOfBoundsException;-><init>(Ljava/lang/String;)V
throw v0
.line 928
:cond_0
const/4 v0, 0x0
.line 929
:goto_0
if-ge v0, p3, :cond_1
.line 930
add-int v1, p2, v0
sub-int v2, p3, v0
invoke-virtual {p0, p1, v1, v2}, Ljava/io/InputStream;->read([BII)I
move-result v1
.line 931
const/4 v2, -0x1
if-ne v1, v2, :cond_2
.line 936
:cond_1
return v0
.line 934
:cond_2
add-int/2addr v0, v1
.line 935
goto :goto_0
.end method
.method public static readBytes(Lcom/google/common/io/InputSupplier;Lcom/google/common/io/ByteProcessor;)Ljava/lang/Object;
.locals 2
.annotation system Ldalvik/annotation/Signature;
value = {
"<T:",
"Ljava/lang/Object;",
">(",
"Lcom/google/common/io/InputSupplier",
"<+",
"Ljava/io/InputStream;",
">;",
"Lcom/google/common/io/ByteProcessor",
"<TT;>;)TT;"
}
.end annotation
.annotation runtime Ljava/lang/Deprecated;
.end annotation
.prologue
.line 842
invoke-static {p0}, Lcom/google/common/base/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
.line 843
invoke-static {p1}, Lcom/google/common/base/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
.line 845
invoke-static {}, Lcom/google/common/io/Closer;->create()Lcom/google/common/io/Closer;
move-result-object v1
.line 847
:try_start_0
invoke-interface {p0}, Lcom/google/common/io/InputSupplier;->getInput()Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/io/Closeable;
invoke-virtual {v1, v0}, Lcom/google/common/io/Closer;->register(Ljava/io/Closeable;)Ljava/io/Closeable;
move-result-object v0
check-cast v0, Ljava/io/InputStream;
.line 848
invoke-static {v0, p1}, Lcom/google/common/io/ByteStreams;->readBytes(Ljava/io/InputStream;Lcom/google/common/io/ByteProcessor;)Ljava/lang/Object;
:try_end_0
.catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
move-result-object v0
.line 852
invoke-virtual {v1}, Lcom/google/common/io/Closer;->close()V
return-object v0
.line 849
:catch_0
move-exception v0
.line 850
:try_start_1
invoke-virtual {v1, v0}, Lcom/google/common/io/Closer;->rethrow(Ljava/lang/Throwable;)Ljava/lang/RuntimeException;
move-result-object v0
throw v0
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
.line 852
:catchall_0
move-exception v0
invoke-virtual {v1}, Lcom/google/common/io/Closer;->close()V
throw v0
.end method
.method public static readBytes(Ljava/io/InputStream;Lcom/google/common/io/ByteProcessor;)Ljava/lang/Object;
.locals 3
.annotation system Ldalvik/annotation/Signature;
value = {
"<T:",
"Ljava/lang/Object;",
">(",
"Ljava/io/InputStream;",
"Lcom/google/common/io/ByteProcessor",
"<TT;>;)TT;"
}
.end annotation
.prologue
.line 867
invoke-static {p0}, Lcom/google/common/base/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
.line 868
invoke-static {p1}, Lcom/google/common/base/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
.line 870
const/16 v0, 0x1000
new-array v0, v0, [B
.line 873
:cond_0
invoke-virtual {p0, v0}, Ljava/io/InputStream;->read([B)I
move-result v1
.line 874
const/4 v2, -0x1
if-eq v1, v2, :cond_1
const/4 v2, 0x0
invoke-interface {p1, v0, v2, v1}, Lcom/google/common/io/ByteProcessor;->processBytes([BII)Z
move-result v1
if-nez v1, :cond_0
.line 875
:cond_1
invoke-interface {p1}, Lcom/google/common/io/ByteProcessor;->getResult()Ljava/lang/Object;
move-result-object v0
return-object v0
.end method
.method public static readFully(Ljava/io/InputStream;[B)V
.locals 2
.prologue
.line 772
const/4 v0, 0x0
array-length v1, p1
invoke-static {p0, p1, v0, v1}, Lcom/google/common/io/ByteStreams;->readFully(Ljava/io/InputStream;[BII)V
.line 773
return-void
.end method
.method public static readFully(Ljava/io/InputStream;[BII)V
.locals 4
.prologue
.line 791
invoke-static {p0, p1, p2, p3}, Lcom/google/common/io/ByteStreams;->read(Ljava/io/InputStream;[BII)I
move-result v0
.line 792
if-eq v0, p3, :cond_0
.line 793
new-instance v1, Ljava/io/EOFException;
new-instance v2, Ljava/lang/StringBuilder;
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
const-string v3, "reached end of stream after reading "
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v2
invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v0
const-string v2, " bytes; "
invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0, p3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v0
const-string v2, " bytes expected"
invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
invoke-direct {v1, v0}, Ljava/io/EOFException;-><init>(Ljava/lang/String;)V
throw v1
.line 796
:cond_0
return-void
.end method
.method public static skipFully(Ljava/io/InputStream;J)V
.locals 9
.prologue
const-wide/16 v6, 0x0
.line 811
move-wide v0, p1
.line 812
:goto_0
cmp-long v2, v0, v6
if-lez v2, :cond_2
.line 813
invoke-virtual {p0, v0, v1}, Ljava/io/InputStream;->skip(J)J
move-result-wide v2
.line 814
cmp-long v4, v2, v6
if-nez v4, :cond_1
.line 816
invoke-virtual {p0}, Ljava/io/InputStream;->read()I
move-result v2
const/4 v3, -0x1
if-ne v2, v3, :cond_0
.line 817
sub-long v0, p1, v0
.line 818
new-instance v2, Ljava/io/EOFException;
new-instance v3, Ljava/lang/StringBuilder;
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
const-string v4, "reached end of stream after skipping "
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v3, v0, v1}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
move-result-object v0
const-string v1, " bytes; "
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0, p1, p2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
move-result-object v0
const-string v1, " bytes expected"
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
invoke-direct {v2, v0}, Ljava/io/EOFException;-><init>(Ljava/lang/String;)V
throw v2
.line 821
:cond_0
const-wide/16 v2, 0x1
sub-long/2addr v0, v2
goto :goto_0
.line 823
:cond_1
sub-long/2addr v0, v2
goto :goto_0
.line 826
:cond_2
return-void
.end method
.method public static slice(Lcom/google/common/io/InputSupplier;JJ)Lcom/google/common/io/InputSupplier;
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lcom/google/common/io/InputSupplier",
"<+",
"Ljava/io/InputStream;",
">;JJ)",
"Lcom/google/common/io/InputSupplier",
"<",
"Ljava/io/InputStream;",
">;"
}
.end annotation
.annotation runtime Ljava/lang/Deprecated;
.end annotation
.prologue
.line 957
invoke-static {p0}, Lcom/google/common/io/ByteStreams;->asByteSource(Lcom/google/common/io/InputSupplier;)Lcom/google/common/io/ByteSource;
move-result-object v0
invoke-virtual {v0, p1, p2, p3, p4}, Lcom/google/common/io/ByteSource;->slice(JJ)Lcom/google/common/io/ByteSource;
move-result-object v0
invoke-static {v0}, Lcom/google/common/io/ByteStreams;->asInputSupplier(Lcom/google/common/io/ByteSource;)Lcom/google/common/io/InputSupplier;
move-result-object v0
return-object v0
.end method
.method public static toByteArray(Lcom/google/common/io/InputSupplier;)[B
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lcom/google/common/io/InputSupplier",
"<+",
"Ljava/io/InputStream;",
">;)[B"
}
.end annotation
.annotation runtime Ljava/lang/Deprecated;
.end annotation
.prologue
.line 294
invoke-static {p0}, Lcom/google/common/io/ByteStreams;->asByteSource(Lcom/google/common/io/InputSupplier;)Lcom/google/common/io/ByteSource;
move-result-object v0
invoke-virtual {v0}, Lcom/google/common/io/ByteSource;->read()[B
move-result-object v0
return-object v0
.end method
.method public static toByteArray(Ljava/io/InputStream;)[B
.locals 1
.prologue
.line 219
new-instance v0, Ljava/io/ByteArrayOutputStream;
invoke-direct {v0}, Ljava/io/ByteArrayOutputStream;-><init>()V
.line 220
invoke-static {p0, v0}, Lcom/google/common/io/ByteStreams;->copy(Ljava/io/InputStream;Ljava/io/OutputStream;)J
.line 221
invoke-virtual {v0}, Ljava/io/ByteArrayOutputStream;->toByteArray()[B
move-result-object v0
return-object v0
.end method
.method static toByteArray(Ljava/io/InputStream;I)[B
.locals 6
.prologue
const/4 v5, 0x0
const/4 v4, -0x1
.line 232
new-array v0, p1, [B
move v1, p1
.line 235
:goto_0
if-lez v1, :cond_2
.line 236
sub-int v2, p1, v1
.line 237
invoke-virtual {p0, v0, v2, v1}, Ljava/io/InputStream;->read([BII)I
move-result v3
.line 238
if-ne v3, v4, :cond_1
.line 241
invoke-static {v0, v2}, Lcom/google/common/io/ByteStreams;->copyOf([BI)[B
move-result-object v0
.line 260
:cond_0
:goto_1
return-object v0
.line 243
:cond_1
sub-int/2addr v1, v3
.line 244
goto :goto_0
.line 247
:cond_2
invoke-virtual {p0}, Ljava/io/InputStream;->read()I
move-result v1
.line 248
if-eq v1, v4, :cond_0
.line 253
new-instance v2, Lcom/google/common/io/ByteStreams$FastByteArrayOutputStream;
const/4 v3, 0x0
invoke-direct {v2, v3}, Lcom/google/common/io/ByteStreams$FastByteArrayOutputStream;-><init>(Lcom/google/common/io/ByteStreams$1;)V
.line 254
invoke-virtual {v2, v1}, Lcom/google/common/io/ByteStreams$FastByteArrayOutputStream;->write(I)V
.line 255
invoke-static {p0, v2}, Lcom/google/common/io/ByteStreams;->copy(Ljava/io/InputStream;Ljava/io/OutputStream;)J
.line 257
array-length v1, v0
invoke-virtual {v2}, Lcom/google/common/io/ByteStreams$FastByteArrayOutputStream;->size()I
move-result v3
add-int/2addr v1, v3
new-array v1, v1, [B
.line 258
array-length v3, v0
invoke-static {v0, v5, v1, v5, v3}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
.line 259
array-length v0, v0
invoke-virtual {v2, v1, v0}, Lcom/google/common/io/ByteStreams$FastByteArrayOutputStream;->writeTo([BI)V
move-object v0, v1
.line 260
goto :goto_1
.end method
.method public static write([BLcom/google/common/io/OutputSupplier;)V
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"([B",
"Lcom/google/common/io/OutputSupplier",
"<+",
"Ljava/io/OutputStream;",
">;)V"
}
.end annotation
.annotation runtime Ljava/lang/Deprecated;
.end annotation
.prologue
.line 102
invoke-static {p1}, Lcom/google/common/io/ByteStreams;->asByteSink(Lcom/google/common/io/OutputSupplier;)Lcom/google/common/io/ByteSink;
move-result-object v0
invoke-virtual {v0, p0}, Lcom/google/common/io/ByteSink;->write([B)V
.line 103
return-void
.end method