今奥全景相机
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.

214 lines
5.0 KiB

.class final Lcom/google/common/io/Files$FileByteSource;
.super Lcom/google/common/io/ByteSource;
.source "Files.java"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/google/common/io/Files;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x1a
name = "FileByteSource"
.end annotation
# instance fields
.field private final file:Ljava/io/File;
# direct methods
.method private constructor <init>(Ljava/io/File;)V
.locals 1
.prologue
.line 120
invoke-direct {p0}, Lcom/google/common/io/ByteSource;-><init>()V
.line 121
invoke-static {p1}, Lcom/google/common/base/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/io/File;
iput-object v0, p0, Lcom/google/common/io/Files$FileByteSource;->file:Ljava/io/File;
.line 122
return-void
.end method
.method synthetic constructor <init>(Ljava/io/File;Lcom/google/common/io/Files$1;)V
.locals 0
.prologue
.line 116
invoke-direct {p0, p1}, Lcom/google/common/io/Files$FileByteSource;-><init>(Ljava/io/File;)V
return-void
.end method
# virtual methods
.method public openStream()Ljava/io/FileInputStream;
.locals 2
.prologue
.line 126
new-instance v0, Ljava/io/FileInputStream;
iget-object v1, p0, Lcom/google/common/io/Files$FileByteSource;->file:Ljava/io/File;
invoke-direct {v0, v1}, Ljava/io/FileInputStream;-><init>(Ljava/io/File;)V
return-object v0
.end method
.method public bridge synthetic openStream()Ljava/io/InputStream;
.locals 1
.prologue
.line 116
invoke-virtual {p0}, Lcom/google/common/io/Files$FileByteSource;->openStream()Ljava/io/FileInputStream;
move-result-object v0
return-object v0
.end method
.method public read()[B
.locals 4
.prologue
.line 139
invoke-static {}, Lcom/google/common/io/Closer;->create()Lcom/google/common/io/Closer;
move-result-object v1
.line 141
:try_start_0
invoke-virtual {p0}, Lcom/google/common/io/Files$FileByteSource;->openStream()Ljava/io/FileInputStream;
move-result-object v0
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/FileInputStream;
.line 142
invoke-virtual {v0}, Ljava/io/FileInputStream;->getChannel()Ljava/nio/channels/FileChannel;
move-result-object v2
invoke-virtual {v2}, Ljava/nio/channels/FileChannel;->size()J
move-result-wide v2
invoke-static {v0, v2, v3}, Lcom/google/common/io/Files;->readFile(Ljava/io/InputStream;J)[B
: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 146
invoke-virtual {v1}, Lcom/google/common/io/Closer;->close()V
return-object v0
.line 143
:catch_0
move-exception v0
.line 144
: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 146
:catchall_0
move-exception v0
invoke-virtual {v1}, Lcom/google/common/io/Closer;->close()V
throw v0
.end method
.method public size()J
.locals 2
.prologue
.line 131
iget-object v0, p0, Lcom/google/common/io/Files$FileByteSource;->file:Ljava/io/File;
invoke-virtual {v0}, Ljava/io/File;->isFile()Z
move-result v0
if-nez v0, :cond_0
.line 132
new-instance v0, Ljava/io/FileNotFoundException;
iget-object v1, p0, Lcom/google/common/io/Files$FileByteSource;->file:Ljava/io/File;
invoke-virtual {v1}, Ljava/io/File;->toString()Ljava/lang/String;
move-result-object v1
invoke-direct {v0, v1}, Ljava/io/FileNotFoundException;-><init>(Ljava/lang/String;)V
throw v0
.line 134
:cond_0
iget-object v0, p0, Lcom/google/common/io/Files$FileByteSource;->file:Ljava/io/File;
invoke-virtual {v0}, Ljava/io/File;->length()J
move-result-wide v0
return-wide v0
.end method
.method public toString()Ljava/lang/String;
.locals 2
.prologue
.line 152
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
const-string v1, "Files.asByteSource("
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
iget-object v1, p0, Lcom/google/common/io/Files$FileByteSource;->file:Ljava/io/File;
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
move-result-object v0
const-string v1, ")"
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
return-object v0
.end method