eh.smali

.class final Lcom/google/protobuf/eh;
.super Ljava/io/InputStream;
.source "RopeByteString.java"


# instance fields
.field private bnm:Lcom/google/protobuf/eg;

.field private bnn:Lcom/google/protobuf/ByteString$LeafByteString;

.field private bno:I

.field private bnp:I

.field private bnq:I

.field private synthetic bnr:Lcom/google/protobuf/RopeByteString;

.field private mark:I


# direct methods
.method public constructor <init>(Lcom/google/protobuf/RopeByteString;)V
    .registers 2

    .prologue
    .line 772
    iput-object p1, p0, Lcom/google/protobuf/eh;->bnr:Lcom/google/protobuf/RopeByteString;

    invoke-direct {p0}, Ljava/io/InputStream;-><init>()V

    .line 773
    invoke-direct {p0}, Lcom/google/protobuf/eh;->initialize()V

    .line 774
    return-void
.end method

.method private EV()V
    .registers 4

    .prologue
    const/4 v2, 0x0

    .line 881
    iget-object v0, p0, Lcom/google/protobuf/eh;->bnn:Lcom/google/protobuf/ByteString$LeafByteString;

    if-eqz v0, :cond_2c

    iget v0, p0, Lcom/google/protobuf/eh;->bnp:I

    iget v1, p0, Lcom/google/protobuf/eh;->bno:I

    if-ne v0, v1, :cond_2c

    .line 884
    iget v0, p0, Lcom/google/protobuf/eh;->bnq:I

    iget v1, p0, Lcom/google/protobuf/eh;->bno:I

    add-int/2addr v0, v1

    iput v0, p0, Lcom/google/protobuf/eh;->bnq:I

    .line 885
    iput v2, p0, Lcom/google/protobuf/eh;->bnp:I

    .line 886
    iget-object v0, p0, Lcom/google/protobuf/eh;->bnm:Lcom/google/protobuf/eg;

    invoke-virtual {v0}, Lcom/google/protobuf/eg;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_2d

    .line 887
    iget-object v0, p0, Lcom/google/protobuf/eh;->bnm:Lcom/google/protobuf/eg;

    invoke-virtual {v0}, Lcom/google/protobuf/eg;->EU()Lcom/google/protobuf/ByteString$LeafByteString;

    move-result-object v0

    iput-object v0, p0, Lcom/google/protobuf/eh;->bnn:Lcom/google/protobuf/ByteString$LeafByteString;

    .line 888
    iget-object v0, p0, Lcom/google/protobuf/eh;->bnn:Lcom/google/protobuf/ByteString$LeafByteString;

    invoke-virtual {v0}, Lcom/google/protobuf/ByteString$LeafByteString;->size()I

    move-result v0

    iput v0, p0, Lcom/google/protobuf/eh;->bno:I

    .line 894
    :cond_2c
    :goto_2c
    return-void

    .line 890
    :cond_2d
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/google/protobuf/eh;->bnn:Lcom/google/protobuf/ByteString$LeafByteString;

    .line 891
    iput v2, p0, Lcom/google/protobuf/eh;->bno:I

    goto :goto_2c
.end method

.method private h([BII)I
    .registers 9

    .prologue
    .line 807
    move v1, p3

    move v0, p2

    .line 808
    :goto_2
    if-lez v1, :cond_29

    .line 809
    invoke-direct {p0}, Lcom/google/protobuf/eh;->EV()V

    .line 810
    iget-object v2, p0, Lcom/google/protobuf/eh;->bnn:Lcom/google/protobuf/ByteString$LeafByteString;

    if-nez v2, :cond_f

    .line 811
    if-ne v1, p3, :cond_29

    .line 813
    const/4 v0, -0x1

    .line 829
    :goto_e
    return v0

    .line 818
    :cond_f
    iget v2, p0, Lcom/google/protobuf/eh;->bno:I

    iget v3, p0, Lcom/google/protobuf/eh;->bnp:I

    sub-int/2addr v2, v3

    .line 819
    invoke-static {v2, v1}, Ljava/lang/Math;->min(II)I

    move-result v2

    .line 820
    if-eqz p1, :cond_22

    .line 821
    iget-object v3, p0, Lcom/google/protobuf/eh;->bnn:Lcom/google/protobuf/ByteString$LeafByteString;

    iget v4, p0, Lcom/google/protobuf/eh;->bnp:I

    invoke-virtual {v3, p1, v4, v0, v2}, Lcom/google/protobuf/ByteString$LeafByteString;->copyTo([BIII)V

    .line 822
    add-int/2addr v0, v2

    .line 824
    :cond_22
    iget v3, p0, Lcom/google/protobuf/eh;->bnp:I

    add-int/2addr v3, v2

    iput v3, p0, Lcom/google/protobuf/eh;->bnp:I

    .line 825
    sub-int/2addr v1, v2

    .line 826
    goto :goto_2

    .line 829
    :cond_29
    sub-int v0, p3, v1

    goto :goto_e
.end method

.method private initialize()V
    .registers 4

    .prologue
    const/4 v2, 0x0

    .line 868
    new-instance v0, Lcom/google/protobuf/eg;

    iget-object v1, p0, Lcom/google/protobuf/eh;->bnr:Lcom/google/protobuf/RopeByteString;

    invoke-direct {v0, v1, v2}, Lcom/google/protobuf/eg;-><init>(Lcom/google/protobuf/ByteString;B)V

    iput-object v0, p0, Lcom/google/protobuf/eh;->bnm:Lcom/google/protobuf/eg;

    .line 869
    iget-object v0, p0, Lcom/google/protobuf/eh;->bnm:Lcom/google/protobuf/eg;

    invoke-virtual {v0}, Lcom/google/protobuf/eg;->EU()Lcom/google/protobuf/ByteString$LeafByteString;

    move-result-object v0

    iput-object v0, p0, Lcom/google/protobuf/eh;->bnn:Lcom/google/protobuf/ByteString$LeafByteString;

    .line 870
    iget-object v0, p0, Lcom/google/protobuf/eh;->bnn:Lcom/google/protobuf/ByteString$LeafByteString;

    invoke-virtual {v0}, Lcom/google/protobuf/ByteString$LeafByteString;->size()I

    move-result v0

    iput v0, p0, Lcom/google/protobuf/eh;->bno:I

    .line 871
    iput v2, p0, Lcom/google/protobuf/eh;->bnp:I

    .line 872
    iput v2, p0, Lcom/google/protobuf/eh;->bnq:I

    .line 873
    return-void
.end method


# virtual methods
.method public final available()I
    .registers 3

    .prologue
    .line 844
    iget v0, p0, Lcom/google/protobuf/eh;->bnq:I

    iget v1, p0, Lcom/google/protobuf/eh;->bnp:I

    add-int/2addr v0, v1

    .line 845
    iget-object v1, p0, Lcom/google/protobuf/eh;->bnr: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 final mark(I)V
    .registers 4

    .prologue
    .line 856
    iget v0, p0, Lcom/google/protobuf/eh;->bnq:I

    iget v1, p0, Lcom/google/protobuf/eh;->bnp:I

    add-int/2addr v0, v1

    iput v0, p0, Lcom/google/protobuf/eh;->mark:I

    .line 857
    return-void
.end method

.method public final markSupported()Z
    .registers 2

    .prologue
    .line 850
    const/4 v0, 0x1

    return v0
.end method

.method public final read()I
    .registers 4

    .prologue
    .line 834
    invoke-direct {p0}, Lcom/google/protobuf/eh;->EV()V

    .line 835
    iget-object v0, p0, Lcom/google/protobuf/eh;->bnn:Lcom/google/protobuf/ByteString$LeafByteString;

    if-nez v0, :cond_9

    .line 836
    const/4 v0, -0x1

    .line 838
    :goto_8
    return v0

    :cond_9
    iget-object v0, p0, Lcom/google/protobuf/eh;->bnn:Lcom/google/protobuf/ByteString$LeafByteString;

    iget v1, p0, Lcom/google/protobuf/eh;->bnp:I

    add-int/lit8 v2, v1, 0x1

    iput v2, p0, Lcom/google/protobuf/eh;->bnp: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 final read([BII)I
    .registers 5

    .prologue
    .line 778
    if-nez p1, :cond_8

    .line 779
    new-instance v0, Ljava/lang/NullPointerException;

    invoke-direct {v0}, Ljava/lang/NullPointerException;-><init>()V

    throw v0

    .line 780
    :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 781
    :cond_10
    new-instance v0, Ljava/lang/IndexOutOfBoundsException;

    invoke-direct {v0}, Ljava/lang/IndexOutOfBoundsException;-><init>()V

    throw v0

    .line 783
    :cond_16
    invoke-direct {p0, p1, p2, p3}, Lcom/google/protobuf/eh;->h([BII)I

    move-result v0

    return v0
.end method

.method public final declared-synchronized reset()V
    .registers 4

    .prologue
    .line 862
    monitor-enter p0

    :try_start_1
    invoke-direct {p0}, Lcom/google/protobuf/eh;->initialize()V

    .line 863
    const/4 v0, 0x0

    const/4 v1, 0x0

    iget v2, p0, Lcom/google/protobuf/eh;->mark:I

    invoke-direct {p0, v0, v1, v2}, Lcom/google/protobuf/eh;->h([BII)I
    :try_end_b
    .catchall {:try_start_1 .. :try_end_b} :catchall_d

    .line 864
    monitor-exit p0

    return-void

    .line 862
    :catchall_d
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public final skip(J)J
    .registers 8

    .prologue
    const-wide/32 v0, 0x7fffffff

    .line 788
    const-wide/16 v2, 0x0

    cmp-long v2, p1, v2

    if-gez v2, :cond_f

    .line 789
    new-instance v0, Ljava/lang/IndexOutOfBoundsException;

    invoke-direct {v0}, Ljava/lang/IndexOutOfBoundsException;-><init>()V

    throw v0

    .line 790
    :cond_f
    cmp-long v2, p1, v0

    if-lez v2, :cond_14

    move-wide p1, v0

    .line 793
    :cond_14
    const/4 v0, 0x0

    const/4 v1, 0x0

    long-to-int v2, p1

    invoke-direct {p0, v0, v1, v2}, Lcom/google/protobuf/eh;->h([BII)I

    move-result v0

    int-to-long v0, v0

    return-wide v0
.end method