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

237 lines
4.7 KiB

.class public final Lcom/google/common/io/CountingInputStream;
.super Ljava/io/FilterInputStream;
.source "CountingInputStream.java"
# annotations
.annotation build Lcom/google/common/annotations/Beta;
.end annotation
# instance fields
.field private count:J
.field private mark:J
# direct methods
.method public constructor <init>(Ljava/io/InputStream;)V
.locals 2
.param p1 # Ljava/io/InputStream;
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
.end param
.prologue
.line 45
invoke-direct {p0, p1}, Ljava/io/FilterInputStream;-><init>(Ljava/io/InputStream;)V
.line 37
const-wide/16 v0, -0x1
iput-wide v0, p0, Lcom/google/common/io/CountingInputStream;->mark:J
.line 46
return-void
.end method
# virtual methods
.method public getCount()J
.locals 2
.prologue
.line 50
iget-wide v0, p0, Lcom/google/common/io/CountingInputStream;->count:J
return-wide v0
.end method
.method public declared-synchronized mark(I)V
.locals 2
.prologue
.line 76
monitor-enter p0
:try_start_0
iget-object v0, p0, Lcom/google/common/io/CountingInputStream;->in:Ljava/io/InputStream;
invoke-virtual {v0, p1}, Ljava/io/InputStream;->mark(I)V
.line 77
iget-wide v0, p0, Lcom/google/common/io/CountingInputStream;->count:J
iput-wide v0, p0, Lcom/google/common/io/CountingInputStream;->mark:J
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
.line 79
monitor-exit p0
return-void
.line 76
:catchall_0
move-exception v0
monitor-exit p0
throw v0
.end method
.method public read()I
.locals 6
.prologue
.line 54
iget-object v0, p0, Lcom/google/common/io/CountingInputStream;->in:Ljava/io/InputStream;
invoke-virtual {v0}, Ljava/io/InputStream;->read()I
move-result v0
.line 55
const/4 v1, -0x1
if-eq v0, v1, :cond_0
.line 56
iget-wide v2, p0, Lcom/google/common/io/CountingInputStream;->count:J
const-wide/16 v4, 0x1
add-long/2addr v2, v4
iput-wide v2, p0, Lcom/google/common/io/CountingInputStream;->count:J
.line 58
:cond_0
return v0
.end method
.method public read([BII)I
.locals 6
.prologue
.line 62
iget-object v0, p0, Lcom/google/common/io/CountingInputStream;->in:Ljava/io/InputStream;
invoke-virtual {v0, p1, p2, p3}, Ljava/io/InputStream;->read([BII)I
move-result v0
.line 63
const/4 v1, -0x1
if-eq v0, v1, :cond_0
.line 64
iget-wide v2, p0, Lcom/google/common/io/CountingInputStream;->count:J
int-to-long v4, v0
add-long/2addr v2, v4
iput-wide v2, p0, Lcom/google/common/io/CountingInputStream;->count:J
.line 66
:cond_0
return v0
.end method
.method public declared-synchronized reset()V
.locals 4
.prologue
.line 82
monitor-enter p0
:try_start_0
iget-object v0, p0, Lcom/google/common/io/CountingInputStream;->in:Ljava/io/InputStream;
invoke-virtual {v0}, Ljava/io/InputStream;->markSupported()Z
move-result v0
if-nez v0, :cond_0
.line 83
new-instance v0, Ljava/io/IOException;
const-string v1, "Mark not supported"
invoke-direct {v0, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
throw v0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
.line 82
:catchall_0
move-exception v0
monitor-exit p0
throw v0
.line 85
:cond_0
:try_start_1
iget-wide v0, p0, Lcom/google/common/io/CountingInputStream;->mark:J
const-wide/16 v2, -0x1
cmp-long v0, v0, v2
if-nez v0, :cond_1
.line 86
new-instance v0, Ljava/io/IOException;
const-string v1, "Mark not set"
invoke-direct {v0, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
throw v0
.line 89
:cond_1
iget-object v0, p0, Lcom/google/common/io/CountingInputStream;->in:Ljava/io/InputStream;
invoke-virtual {v0}, Ljava/io/InputStream;->reset()V
.line 90
iget-wide v0, p0, Lcom/google/common/io/CountingInputStream;->mark:J
iput-wide v0, p0, Lcom/google/common/io/CountingInputStream;->count:J
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
.line 91
monitor-exit p0
return-void
.end method
.method public skip(J)J
.locals 5
.prologue
.line 70
iget-object v0, p0, Lcom/google/common/io/CountingInputStream;->in:Ljava/io/InputStream;
invoke-virtual {v0, p1, p2}, Ljava/io/InputStream;->skip(J)J
move-result-wide v0
.line 71
iget-wide v2, p0, Lcom/google/common/io/CountingInputStream;->count:J
add-long/2addr v2, v0
iput-wide v2, p0, Lcom/google/common/io/CountingInputStream;->count:J
.line 72
return-wide v0
.end method