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.
395 lines
9.1 KiB
395 lines
9.1 KiB
.class final Lcom/google/common/io/ByteSource$SlicedByteSource; |
|
.super Lcom/google/common/io/ByteSource; |
|
.source "ByteSource.java" |
|
|
|
|
|
# annotations |
|
.annotation system Ldalvik/annotation/EnclosingClass; |
|
value = Lcom/google/common/io/ByteSource; |
|
.end annotation |
|
|
|
.annotation system Ldalvik/annotation/InnerClass; |
|
accessFlags = 0x12 |
|
name = "SlicedByteSource" |
|
.end annotation |
|
|
|
|
|
# instance fields |
|
.field private final length:J |
|
|
|
.field private final offset:J |
|
|
|
.field final synthetic this$0:Lcom/google/common/io/ByteSource; |
|
|
|
|
|
# direct methods |
|
.method private constructor <init>(Lcom/google/common/io/ByteSource;JJ)V |
|
.locals 8 |
|
|
|
.prologue |
|
const-wide/16 v6, 0x0 |
|
|
|
const/4 v1, 0x1 |
|
|
|
const/4 v2, 0x0 |
|
|
|
.line 452 |
|
iput-object p1, p0, Lcom/google/common/io/ByteSource$SlicedByteSource;->this$0:Lcom/google/common/io/ByteSource; |
|
|
|
invoke-direct {p0}, Lcom/google/common/io/ByteSource;-><init>()V |
|
|
|
.line 453 |
|
cmp-long v0, p2, v6 |
|
|
|
if-ltz v0, :cond_0 |
|
|
|
move v0, v1 |
|
|
|
:goto_0 |
|
const-string v3, "offset (%s) may not be negative" |
|
|
|
new-array v4, v1, [Ljava/lang/Object; |
|
|
|
invoke-static {p2, p3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long; |
|
|
|
move-result-object v5 |
|
|
|
aput-object v5, v4, v2 |
|
|
|
invoke-static {v0, v3, v4}, Lcom/google/common/base/Preconditions;->checkArgument(ZLjava/lang/String;[Ljava/lang/Object;)V |
|
|
|
.line 454 |
|
cmp-long v0, p4, v6 |
|
|
|
if-ltz v0, :cond_1 |
|
|
|
move v0, v1 |
|
|
|
:goto_1 |
|
const-string v3, "length (%s) may not be negative" |
|
|
|
new-array v1, v1, [Ljava/lang/Object; |
|
|
|
invoke-static {p4, p5}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long; |
|
|
|
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 455 |
|
iput-wide p2, p0, Lcom/google/common/io/ByteSource$SlicedByteSource;->offset:J |
|
|
|
.line 456 |
|
iput-wide p4, p0, Lcom/google/common/io/ByteSource$SlicedByteSource;->length:J |
|
|
|
.line 457 |
|
return-void |
|
|
|
:cond_0 |
|
move v0, v2 |
|
|
|
.line 453 |
|
goto :goto_0 |
|
|
|
:cond_1 |
|
move v0, v2 |
|
|
|
.line 454 |
|
goto :goto_1 |
|
.end method |
|
|
|
.method synthetic constructor <init>(Lcom/google/common/io/ByteSource;JJLcom/google/common/io/ByteSource$1;)V |
|
.locals 0 |
|
|
|
.prologue |
|
.line 447 |
|
invoke-direct/range {p0 .. p5}, Lcom/google/common/io/ByteSource$SlicedByteSource;-><init>(Lcom/google/common/io/ByteSource;JJ)V |
|
|
|
return-void |
|
.end method |
|
|
|
.method private sliceStream(Ljava/io/InputStream;)Ljava/io/InputStream; |
|
.locals 4 |
|
|
|
.prologue |
|
.line 470 |
|
iget-wide v0, p0, Lcom/google/common/io/ByteSource$SlicedByteSource;->offset:J |
|
|
|
const-wide/16 v2, 0x0 |
|
|
|
cmp-long v0, v0, v2 |
|
|
|
if-lez v0, :cond_0 |
|
|
|
.line 472 |
|
:try_start_0 |
|
iget-wide v0, p0, Lcom/google/common/io/ByteSource$SlicedByteSource;->offset:J |
|
|
|
invoke-static {p1, v0, v1}, Lcom/google/common/io/ByteStreams;->skipFully(Ljava/io/InputStream;J)V |
|
:try_end_0 |
|
.catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0 |
|
|
|
.line 483 |
|
:cond_0 |
|
iget-wide v0, p0, Lcom/google/common/io/ByteSource$SlicedByteSource;->length:J |
|
|
|
invoke-static {p1, v0, v1}, Lcom/google/common/io/ByteStreams;->limit(Ljava/io/InputStream;J)Ljava/io/InputStream; |
|
|
|
move-result-object v0 |
|
|
|
return-object v0 |
|
|
|
.line 473 |
|
:catch_0 |
|
move-exception v0 |
|
|
|
.line 474 |
|
invoke-static {}, Lcom/google/common/io/Closer;->create()Lcom/google/common/io/Closer; |
|
|
|
move-result-object v1 |
|
|
|
.line 475 |
|
invoke-virtual {v1, p1}, Lcom/google/common/io/Closer;->register(Ljava/io/Closeable;)Ljava/io/Closeable; |
|
|
|
.line 477 |
|
: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 479 |
|
:catchall_0 |
|
move-exception v0 |
|
|
|
invoke-virtual {v1}, Lcom/google/common/io/Closer;->close()V |
|
|
|
throw v0 |
|
.end method |
|
|
|
|
|
# virtual methods |
|
.method public bridge synthetic getInput()Ljava/lang/Object; |
|
.locals 1 |
|
|
|
.prologue |
|
.line 447 |
|
invoke-super {p0}, Lcom/google/common/io/ByteSource;->getInput()Ljava/io/InputStream; |
|
|
|
move-result-object v0 |
|
|
|
return-object v0 |
|
.end method |
|
|
|
.method public isEmpty()Z |
|
.locals 4 |
|
|
|
.prologue |
|
.line 496 |
|
iget-wide v0, p0, Lcom/google/common/io/ByteSource$SlicedByteSource;->length:J |
|
|
|
const-wide/16 v2, 0x0 |
|
|
|
cmp-long v0, v0, v2 |
|
|
|
if-eqz v0, :cond_0 |
|
|
|
invoke-super {p0}, Lcom/google/common/io/ByteSource;->isEmpty()Z |
|
|
|
move-result v0 |
|
|
|
if-eqz v0, :cond_1 |
|
|
|
:cond_0 |
|
const/4 v0, 0x1 |
|
|
|
:goto_0 |
|
return v0 |
|
|
|
:cond_1 |
|
const/4 v0, 0x0 |
|
|
|
goto :goto_0 |
|
.end method |
|
|
|
.method public openBufferedStream()Ljava/io/InputStream; |
|
.locals 1 |
|
|
|
.prologue |
|
.line 466 |
|
iget-object v0, p0, Lcom/google/common/io/ByteSource$SlicedByteSource;->this$0:Lcom/google/common/io/ByteSource; |
|
|
|
invoke-virtual {v0}, Lcom/google/common/io/ByteSource;->openBufferedStream()Ljava/io/InputStream; |
|
|
|
move-result-object v0 |
|
|
|
invoke-direct {p0, v0}, Lcom/google/common/io/ByteSource$SlicedByteSource;->sliceStream(Ljava/io/InputStream;)Ljava/io/InputStream; |
|
|
|
move-result-object v0 |
|
|
|
return-object v0 |
|
.end method |
|
|
|
.method public openStream()Ljava/io/InputStream; |
|
.locals 1 |
|
|
|
.prologue |
|
.line 461 |
|
iget-object v0, p0, Lcom/google/common/io/ByteSource$SlicedByteSource;->this$0:Lcom/google/common/io/ByteSource; |
|
|
|
invoke-virtual {v0}, Lcom/google/common/io/ByteSource;->openStream()Ljava/io/InputStream; |
|
|
|
move-result-object v0 |
|
|
|
invoke-direct {p0, v0}, Lcom/google/common/io/ByteSource$SlicedByteSource;->sliceStream(Ljava/io/InputStream;)Ljava/io/InputStream; |
|
|
|
move-result-object v0 |
|
|
|
return-object v0 |
|
.end method |
|
|
|
.method public slice(JJ)Lcom/google/common/io/ByteSource; |
|
.locals 9 |
|
|
|
.prologue |
|
const-wide/16 v6, 0x0 |
|
|
|
const/4 v1, 0x1 |
|
|
|
const/4 v2, 0x0 |
|
|
|
.line 488 |
|
cmp-long v0, p1, v6 |
|
|
|
if-ltz v0, :cond_0 |
|
|
|
move v0, v1 |
|
|
|
:goto_0 |
|
const-string v3, "offset (%s) may not be negative" |
|
|
|
new-array v4, v1, [Ljava/lang/Object; |
|
|
|
invoke-static {p1, p2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long; |
|
|
|
move-result-object v5 |
|
|
|
aput-object v5, v4, v2 |
|
|
|
invoke-static {v0, v3, v4}, Lcom/google/common/base/Preconditions;->checkArgument(ZLjava/lang/String;[Ljava/lang/Object;)V |
|
|
|
.line 489 |
|
cmp-long v0, p3, v6 |
|
|
|
if-ltz v0, :cond_1 |
|
|
|
move v0, v1 |
|
|
|
:goto_1 |
|
const-string v3, "length (%s) may not be negative" |
|
|
|
new-array v1, v1, [Ljava/lang/Object; |
|
|
|
invoke-static {p3, p4}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long; |
|
|
|
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 490 |
|
iget-wide v0, p0, Lcom/google/common/io/ByteSource$SlicedByteSource;->length:J |
|
|
|
sub-long/2addr v0, p1 |
|
|
|
.line 491 |
|
iget-object v2, p0, Lcom/google/common/io/ByteSource$SlicedByteSource;->this$0:Lcom/google/common/io/ByteSource; |
|
|
|
iget-wide v4, p0, Lcom/google/common/io/ByteSource$SlicedByteSource;->offset:J |
|
|
|
add-long/2addr v4, p1 |
|
|
|
invoke-static {p3, p4, v0, v1}, Ljava/lang/Math;->min(JJ)J |
|
|
|
move-result-wide v0 |
|
|
|
invoke-virtual {v2, v4, v5, v0, v1}, Lcom/google/common/io/ByteSource;->slice(JJ)Lcom/google/common/io/ByteSource; |
|
|
|
move-result-object v0 |
|
|
|
return-object v0 |
|
|
|
:cond_0 |
|
move v0, v2 |
|
|
|
.line 488 |
|
goto :goto_0 |
|
|
|
:cond_1 |
|
move v0, v2 |
|
|
|
.line 489 |
|
goto :goto_1 |
|
.end method |
|
|
|
.method public toString()Ljava/lang/String; |
|
.locals 4 |
|
|
|
.prologue |
|
.line 501 |
|
new-instance v0, Ljava/lang/StringBuilder; |
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V |
|
|
|
iget-object v1, p0, Lcom/google/common/io/ByteSource$SlicedByteSource;->this$0:Lcom/google/common/io/ByteSource; |
|
|
|
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; |
|
|
|
move-result-object v0 |
|
|
|
const-string v1, ".slice(" |
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v0 |
|
|
|
iget-wide v2, p0, Lcom/google/common/io/ByteSource$SlicedByteSource;->offset:J |
|
|
|
invoke-virtual {v0, v2, v3}, Ljava/lang/StringBuilder;->append(J)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 |
|
|
|
iget-wide v2, p0, Lcom/google/common/io/ByteSource$SlicedByteSource;->length:J |
|
|
|
invoke-virtual {v0, v2, v3}, Ljava/lang/StringBuilder;->append(J)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
|
|
|