Rabbit-R1/android (non root)/smali/smali_classes3/com/google/common/io/CountingInputStream.smali
2024-05-21 17:08:36 -04:00

236 lines
5 KiB
Smali

.class public final Lcom/google/common/io/CountingInputStream;
.super Ljava/io/FilterInputStream;
.source "CountingInputStream.java"
# annotations
.annotation runtime Lcom/google/common/io/ElementTypesAreNonnullByDefault;
.end annotation
# instance fields
.field private count:J
.field private mark:J
# direct methods
.method public constructor <init>(Ljava/io/InputStream;)V
.locals 2
.line 45
invoke-static {p1}, Lcom/google/common/base/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object p1
check-cast p1, Ljava/io/InputStream;
invoke-direct {p0, p1}, Ljava/io/FilterInputStream;-><init>(Ljava/io/InputStream;)V
const-wide/16 v0, -0x1
iput-wide v0, p0, Lcom/google/common/io/CountingInputStream;->mark:J
return-void
.end method
# virtual methods
.method public getCount()J
.locals 2
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
monitor-enter p0
.line 80
: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
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 83
monitor-exit p0
return-void
:catchall_0
move-exception p1
monitor-exit p0
throw p1
.end method
.method public read()I
.locals 5
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 55
iget-object v0, p0, Lcom/google/common/io/CountingInputStream;->in:Ljava/io/InputStream;
invoke-virtual {v0}, Ljava/io/InputStream;->read()I
move-result v0
const/4 v1, -0x1
if-eq v0, v1, :cond_0
iget-wide v1, p0, Lcom/google/common/io/CountingInputStream;->count:J
const-wide/16 v3, 0x1
add-long/2addr v1, v3
iput-wide v1, p0, Lcom/google/common/io/CountingInputStream;->count:J
:cond_0
return v0
.end method
.method public read([BII)I
.locals 2
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 64
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 p1
const/4 p2, -0x1
if-eq p1, p2, :cond_0
iget-wide p2, p0, Lcom/google/common/io/CountingInputStream;->count:J
int-to-long v0, p1
add-long/2addr p2, v0
iput-wide p2, p0, Lcom/google/common/io/CountingInputStream;->count:J
:cond_0
return p1
.end method
.method public declared-synchronized reset()V
.locals 4
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
monitor-enter p0
.line 87
: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-eqz v0, :cond_1
iget-wide v0, p0, Lcom/google/common/io/CountingInputStream;->mark:J
const-wide/16 v2, -0x1
cmp-long v0, v0, v2
if-eqz v0, :cond_0
.line 94
iget-object v0, p0, Lcom/google/common/io/CountingInputStream;->in:Ljava/io/InputStream;
invoke-virtual {v0}, Ljava/io/InputStream;->reset()V
iget-wide v0, p0, Lcom/google/common/io/CountingInputStream;->mark:J
iput-wide v0, p0, Lcom/google/common/io/CountingInputStream;->count:J
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
.line 96
monitor-exit p0
return-void
.line 91
:cond_0
:try_start_1
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 88
:cond_1
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_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
:catchall_0
move-exception v0
monitor-exit p0
throw v0
.end method
.method public skip(J)J
.locals 2
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 73
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 p1
iget-wide v0, p0, Lcom/google/common/io/CountingInputStream;->count:J
add-long/2addr v0, p1
iput-wide v0, p0, Lcom/google/common/io/CountingInputStream;->count:J
return-wide p1
.end method