RopeByteString$RopeInputStream.smali
.class Lcom/google/protobuf/RopeByteString$RopeInputStream;
.super Ljava/io/InputStream;
.source "RopeByteString.java"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/google/protobuf/RopeByteString;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x2
name = "RopeInputStream"
.end annotation
# instance fields
.field private currentPiece:Lcom/google/protobuf/ByteString$LeafByteString;
.field private currentPieceIndex:I
.field private currentPieceOffsetInRope:I
.field private currentPieceSize:I
.field private mark:I
.field private pieceIterator:Lcom/google/protobuf/RopeByteString$PieceIterator;
.field final synthetic this$0:Lcom/google/protobuf/RopeByteString;
# direct methods
.method public constructor <init>(Lcom/google/protobuf/RopeByteString;)V
.registers 2
.prologue
.line 773
iput-object p1, p0, Lcom/google/protobuf/RopeByteString$RopeInputStream;->this$0:Lcom/google/protobuf/RopeByteString;
invoke-direct {p0}, Ljava/io/InputStream;-><init>()V
.line 774
invoke-direct {p0}, Lcom/google/protobuf/RopeByteString$RopeInputStream;->initialize()V
.line 775
return-void
.end method
.method private advanceIfCurrentPieceFullyRead()V
.registers 4
.prologue
const/4 v2, 0x0
.line 882
iget-object v0, p0, Lcom/google/protobuf/RopeByteString$RopeInputStream;->currentPiece:Lcom/google/protobuf/ByteString$LeafByteString;
if-eqz v0, :cond_2c
iget v0, p0, Lcom/google/protobuf/RopeByteString$RopeInputStream;->currentPieceIndex:I
iget v1, p0, Lcom/google/protobuf/RopeByteString$RopeInputStream;->currentPieceSize:I
if-ne v0, v1, :cond_2c
.line 885
iget v0, p0, Lcom/google/protobuf/RopeByteString$RopeInputStream;->currentPieceOffsetInRope:I
iget v1, p0, Lcom/google/protobuf/RopeByteString$RopeInputStream;->currentPieceSize:I
add-int/2addr v0, v1
iput v0, p0, Lcom/google/protobuf/RopeByteString$RopeInputStream;->currentPieceOffsetInRope:I
.line 886
iput v2, p0, Lcom/google/protobuf/RopeByteString$RopeInputStream;->currentPieceIndex:I
.line 887
iget-object v0, p0, Lcom/google/protobuf/RopeByteString$RopeInputStream;->pieceIterator:Lcom/google/protobuf/RopeByteString$PieceIterator;
invoke-virtual {v0}, Lcom/google/protobuf/RopeByteString$PieceIterator;->hasNext()Z
move-result v0
if-eqz v0, :cond_2d
.line 888
iget-object v0, p0, Lcom/google/protobuf/RopeByteString$RopeInputStream;->pieceIterator:Lcom/google/protobuf/RopeByteString$PieceIterator;
invoke-virtual {v0}, Lcom/google/protobuf/RopeByteString$PieceIterator;->next()Lcom/google/protobuf/ByteString$LeafByteString;
move-result-object v0
iput-object v0, p0, Lcom/google/protobuf/RopeByteString$RopeInputStream;->currentPiece:Lcom/google/protobuf/ByteString$LeafByteString;
.line 889
iget-object v0, p0, Lcom/google/protobuf/RopeByteString$RopeInputStream;->currentPiece:Lcom/google/protobuf/ByteString$LeafByteString;
invoke-virtual {v0}, Lcom/google/protobuf/ByteString$LeafByteString;->size()I
move-result v0
iput v0, p0, Lcom/google/protobuf/RopeByteString$RopeInputStream;->currentPieceSize:I
.line 895
:cond_2c
:goto_2c
return-void
.line 891
:cond_2d
const/4 v0, 0x0
iput-object v0, p0, Lcom/google/protobuf/RopeByteString$RopeInputStream;->currentPiece:Lcom/google/protobuf/ByteString$LeafByteString;
.line 892
iput v2, p0, Lcom/google/protobuf/RopeByteString$RopeInputStream;->currentPieceSize:I
goto :goto_2c
.end method
.method private initialize()V
.registers 5
.prologue
const/4 v3, 0x0
.line 869
new-instance v0, Lcom/google/protobuf/RopeByteString$PieceIterator;
iget-object v1, p0, Lcom/google/protobuf/RopeByteString$RopeInputStream;->this$0:Lcom/google/protobuf/RopeByteString;
const/4 v2, 0x0
invoke-direct {v0, v1, v2}, Lcom/google/protobuf/RopeByteString$PieceIterator;-><init>(Lcom/google/protobuf/ByteString;Lcom/google/protobuf/RopeByteString$1;)V
iput-object v0, p0, Lcom/google/protobuf/RopeByteString$RopeInputStream;->pieceIterator:Lcom/google/protobuf/RopeByteString$PieceIterator;
.line 870
iget-object v0, p0, Lcom/google/protobuf/RopeByteString$RopeInputStream;->pieceIterator:Lcom/google/protobuf/RopeByteString$PieceIterator;
invoke-virtual {v0}, Lcom/google/protobuf/RopeByteString$PieceIterator;->next()Lcom/google/protobuf/ByteString$LeafByteString;
move-result-object v0
iput-object v0, p0, Lcom/google/protobuf/RopeByteString$RopeInputStream;->currentPiece:Lcom/google/protobuf/ByteString$LeafByteString;
.line 871
iget-object v0, p0, Lcom/google/protobuf/RopeByteString$RopeInputStream;->currentPiece:Lcom/google/protobuf/ByteString$LeafByteString;
invoke-virtual {v0}, Lcom/google/protobuf/ByteString$LeafByteString;->size()I
move-result v0
iput v0, p0, Lcom/google/protobuf/RopeByteString$RopeInputStream;->currentPieceSize:I
.line 872
iput v3, p0, Lcom/google/protobuf/RopeByteString$RopeInputStream;->currentPieceIndex:I
.line 873
iput v3, p0, Lcom/google/protobuf/RopeByteString$RopeInputStream;->currentPieceOffsetInRope:I
.line 874
return-void
.end method
.method private readSkipInternal([BII)I
.registers 9
.prologue
.line 808
move v1, p3
move v0, p2
.line 809
:goto_2
if-lez v1, :cond_29
.line 810
invoke-direct {p0}, Lcom/google/protobuf/RopeByteString$RopeInputStream;->advanceIfCurrentPieceFullyRead()V
.line 811
iget-object v2, p0, Lcom/google/protobuf/RopeByteString$RopeInputStream;->currentPiece:Lcom/google/protobuf/ByteString$LeafByteString;
if-nez v2, :cond_f
.line 812
if-ne v1, p3, :cond_29
.line 814
const/4 v0, -0x1
.line 830
:goto_e
return v0
.line 819
:cond_f
iget v2, p0, Lcom/google/protobuf/RopeByteString$RopeInputStream;->currentPieceSize:I
iget v3, p0, Lcom/google/protobuf/RopeByteString$RopeInputStream;->currentPieceIndex:I
sub-int/2addr v2, v3
.line 820
invoke-static {v2, v1}, Ljava/lang/Math;->min(II)I
move-result v2
.line 821
if-eqz p1, :cond_22
.line 822
iget-object v3, p0, Lcom/google/protobuf/RopeByteString$RopeInputStream;->currentPiece:Lcom/google/protobuf/ByteString$LeafByteString;
iget v4, p0, Lcom/google/protobuf/RopeByteString$RopeInputStream;->currentPieceIndex:I
invoke-virtual {v3, p1, v4, v0, v2}, Lcom/google/protobuf/ByteString$LeafByteString;->copyTo([BIII)V
.line 823
add-int/2addr v0, v2
.line 825
:cond_22
iget v3, p0, Lcom/google/protobuf/RopeByteString$RopeInputStream;->currentPieceIndex:I
add-int/2addr v3, v2
iput v3, p0, Lcom/google/protobuf/RopeByteString$RopeInputStream;->currentPieceIndex:I
.line 826
sub-int/2addr v1, v2
.line 827
goto :goto_2
.line 830
:cond_29
sub-int v0, p3, v1
goto :goto_e
.end method
# virtual methods
.method public available()I
.registers 3
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.prologue
.line 845
iget v0, p0, Lcom/google/protobuf/RopeByteString$RopeInputStream;->currentPieceOffsetInRope:I
iget v1, p0, Lcom/google/protobuf/RopeByteString$RopeInputStream;->currentPieceIndex:I
add-int/2addr v0, v1
.line 846
iget-object v1, p0, Lcom/google/protobuf/RopeByteString$RopeInputStream;->this$0:Lcom/google/protobuf/RopeByteString;
invoke-virtual {v1}, Lcom/google/protobuf/RopeByteString;->size()I
move-result v1
sub-int v0, v1, v0
return v0
.end method
.method public mark(I)V
.registers 4
.prologue
.line 857
iget v0, p0, Lcom/google/protobuf/RopeByteString$RopeInputStream;->currentPieceOffsetInRope:I
iget v1, p0, Lcom/google/protobuf/RopeByteString$RopeInputStream;->currentPieceIndex:I
add-int/2addr v0, v1
iput v0, p0, Lcom/google/protobuf/RopeByteString$RopeInputStream;->mark:I
.line 858
return-void
.end method
.method public markSupported()Z
.registers 2
.prologue
.line 851
const/4 v0, 0x1
return v0
.end method
.method public read()I
.registers 4
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.prologue
.line 835
invoke-direct {p0}, Lcom/google/protobuf/RopeByteString$RopeInputStream;->advanceIfCurrentPieceFullyRead()V
.line 836
iget-object v0, p0, Lcom/google/protobuf/RopeByteString$RopeInputStream;->currentPiece:Lcom/google/protobuf/ByteString$LeafByteString;
if-nez v0, :cond_9
.line 837
const/4 v0, -0x1
.line 839
:goto_8
return v0
:cond_9
iget-object v0, p0, Lcom/google/protobuf/RopeByteString$RopeInputStream;->currentPiece:Lcom/google/protobuf/ByteString$LeafByteString;
iget v1, p0, Lcom/google/protobuf/RopeByteString$RopeInputStream;->currentPieceIndex:I
add-int/lit8 v2, v1, 0x1
iput v2, p0, Lcom/google/protobuf/RopeByteString$RopeInputStream;->currentPieceIndex:I
invoke-virtual {v0, v1}, Lcom/google/protobuf/ByteString$LeafByteString;->byteAt(I)B
move-result v0
and-int/lit16 v0, v0, 0xff
goto :goto_8
.end method
.method public read([BII)I
.registers 5
.prologue
.line 779
if-nez p1, :cond_8
.line 780
new-instance v0, Ljava/lang/NullPointerException;
invoke-direct {v0}, Ljava/lang/NullPointerException;-><init>()V
throw v0
.line 781
:cond_8
if-ltz p2, :cond_10
if-ltz p3, :cond_10
array-length v0, p1
sub-int/2addr v0, p2
if-le p3, v0, :cond_16
.line 782
:cond_10
new-instance v0, Ljava/lang/IndexOutOfBoundsException;
invoke-direct {v0}, Ljava/lang/IndexOutOfBoundsException;-><init>()V
throw v0
.line 784
:cond_16
invoke-direct {p0, p1, p2, p3}, Lcom/google/protobuf/RopeByteString$RopeInputStream;->readSkipInternal([BII)I
move-result v0
return v0
.end method
.method public declared-synchronized reset()V
.registers 4
.prologue
.line 863
monitor-enter p0
:try_start_1
invoke-direct {p0}, Lcom/google/protobuf/RopeByteString$RopeInputStream;->initialize()V
.line 864
const/4 v0, 0x0
const/4 v1, 0x0
iget v2, p0, Lcom/google/protobuf/RopeByteString$RopeInputStream;->mark:I
invoke-direct {p0, v0, v1, v2}, Lcom/google/protobuf/RopeByteString$RopeInputStream;->readSkipInternal([BII)I
:try_end_b
.catchall {:try_start_1 .. :try_end_b} :catchall_d
.line 865
monitor-exit p0
return-void
.line 863
:catchall_d
move-exception v0
monitor-exit p0
throw v0
.end method
.method public skip(J)J
.registers 8
.prologue
const-wide/32 v0, 0x7fffffff
.line 789
const-wide/16 v2, 0x0
cmp-long v2, p1, v2
if-gez v2, :cond_f
.line 790
new-instance v0, Ljava/lang/IndexOutOfBoundsException;
invoke-direct {v0}, Ljava/lang/IndexOutOfBoundsException;-><init>()V
throw v0
.line 791
:cond_f
cmp-long v2, p1, v0
if-lez v2, :cond_14
move-wide p1, v0
.line 794
:cond_14
const/4 v0, 0x0
const/4 v1, 0x0
long-to-int v2, p1
invoke-direct {p0, v0, v1, v2}, Lcom/google/protobuf/RopeByteString$RopeInputStream;->readSkipInternal([BII)I
move-result v0
int-to-long v0, v0
return-wide v0
.end method