.class public final Lz5/jl1;
.super Ljava/io/InputStream;
.source ""


# instance fields
.field public r:Ljava/util/Iterator;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Iterator<",
            "Ljava/nio/ByteBuffer;",
            ">;"
        }
    .end annotation
.end field

.field public s:Ljava/nio/ByteBuffer;

.field public t:I

.field public u:I

.field public v:I

.field public w:Z

.field public x:[B

.field public y:I

.field public z:J


# direct methods
.method public constructor <init>(Ljava/lang/Iterable;)V
    .registers 4
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/Iterable<",
            "Ljava/nio/ByteBuffer;",
            ">;)V"
        }
    .end annotation

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

    invoke-interface {p1}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;

    move-result-object v0

    iput-object v0, p0, Lz5/jl1;->r:Ljava/util/Iterator;

    const/4 v0, 0x0

    iput v0, p0, Lz5/jl1;->t:I

    invoke-interface {p1}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;

    move-result-object p1

    :goto_10
    invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-eqz v1, :cond_23

    invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/nio/ByteBuffer;

    iget v1, p0, Lz5/jl1;->t:I

    add-int/lit8 v1, v1, 0x1

    iput v1, p0, Lz5/jl1;->t:I

    goto :goto_10

    :cond_23
    const/4 p1, -0x1

    iput p1, p0, Lz5/jl1;->u:I

    invoke-virtual {p0}, Lz5/jl1;->b()Z

    move-result p1

    if-nez p1, :cond_38

    sget-object p1, Lz5/gl1;->c:Ljava/nio/ByteBuffer;

    iput-object p1, p0, Lz5/jl1;->s:Ljava/nio/ByteBuffer;

    iput v0, p0, Lz5/jl1;->u:I

    iput v0, p0, Lz5/jl1;->v:I

    const-wide/16 v0, 0x0

    iput-wide v0, p0, Lz5/jl1;->z:J

    :cond_38
    return-void
.end method


# virtual methods
.method public final b()Z
    .registers 6

    iget v0, p0, Lz5/jl1;->u:I

    const/4 v1, 0x1

    add-int/2addr v0, v1

    iput v0, p0, Lz5/jl1;->u:I

    iget-object v0, p0, Lz5/jl1;->r:Ljava/util/Iterator;

    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    const/4 v2, 0x0

    if-nez v0, :cond_10

    return v2

    :cond_10
    iget-object v0, p0, Lz5/jl1;->r:Ljava/util/Iterator;

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/nio/ByteBuffer;

    iput-object v0, p0, Lz5/jl1;->s:Ljava/nio/ByteBuffer;

    invoke-virtual {v0}, Ljava/nio/ByteBuffer;->position()I

    move-result v0

    iput v0, p0, Lz5/jl1;->v:I

    iget-object v0, p0, Lz5/jl1;->s:Ljava/nio/ByteBuffer;

    invoke-virtual {v0}, Ljava/nio/ByteBuffer;->hasArray()Z

    move-result v0

    if-eqz v0, :cond_3b

    iput-boolean v1, p0, Lz5/jl1;->w:Z

    iget-object v0, p0, Lz5/jl1;->s:Ljava/nio/ByteBuffer;

    invoke-virtual {v0}, Ljava/nio/ByteBuffer;->array()[B

    move-result-object v0

    iput-object v0, p0, Lz5/jl1;->x:[B

    iget-object v0, p0, Lz5/jl1;->s:Ljava/nio/ByteBuffer;

    invoke-virtual {v0}, Ljava/nio/ByteBuffer;->arrayOffset()I

    move-result v0

    iput v0, p0, Lz5/jl1;->y:I

    goto :goto_4c

    :cond_3b
    iput-boolean v2, p0, Lz5/jl1;->w:Z

    iget-object v0, p0, Lz5/jl1;->s:Ljava/nio/ByteBuffer;

    .line 1
    sget-object v2, Lcom/google/android/gms/internal/ads/z8;->c:Lcom/google/android/gms/internal/ads/a;

    sget-wide v3, Lcom/google/android/gms/internal/ads/z8;->g:J

    invoke-virtual {v2, v0, v3, v4}, Lcom/google/android/gms/internal/ads/a;->F(Ljava/lang/Object;J)J

    move-result-wide v2

    .line 2
    iput-wide v2, p0, Lz5/jl1;->z:J

    const/4 v0, 0x0

    iput-object v0, p0, Lz5/jl1;->x:[B

    :goto_4c
    return v1
.end method

.method public final e(I)V
    .registers 3

    iget v0, p0, Lz5/jl1;->v:I

    add-int/2addr v0, p1

    iput v0, p0, Lz5/jl1;->v:I

    iget-object p1, p0, Lz5/jl1;->s:Ljava/nio/ByteBuffer;

    invoke-virtual {p1}, Ljava/nio/ByteBuffer;->limit()I

    move-result p1

    if-ne v0, p1, :cond_10

    invoke-virtual {p0}, Lz5/jl1;->b()Z

    :cond_10
    return-void
.end method

.method public final read()I
    .registers 7

    iget v0, p0, Lz5/jl1;->u:I

    iget v1, p0, Lz5/jl1;->t:I

    if-ne v0, v1, :cond_8

    const/4 v0, -0x1

    return v0

    :cond_8
    iget-boolean v0, p0, Lz5/jl1;->w:Z

    const/4 v1, 0x1

    if-eqz v0, :cond_1c

    iget-object v0, p0, Lz5/jl1;->x:[B

    iget v2, p0, Lz5/jl1;->v:I

    iget v3, p0, Lz5/jl1;->y:I

    add-int/2addr v2, v3

    aget-byte v0, v0, v2

    :goto_16
    invoke-virtual {p0, v1}, Lz5/jl1;->e(I)V

    and-int/lit16 v0, v0, 0xff

    return v0

    :cond_1c
    iget v0, p0, Lz5/jl1;->v:I

    iget-wide v2, p0, Lz5/jl1;->z:J

    int-to-long v4, v0

    add-long/2addr v4, v2

    invoke-static {v4, v5}, Lcom/google/android/gms/internal/ads/z8;->q(J)B

    move-result v0

    goto :goto_16
.end method

.method public final read([BII)I
    .registers 7

    iget v0, p0, Lz5/jl1;->u:I

    iget v1, p0, Lz5/jl1;->t:I

    if-ne v0, v1, :cond_8

    const/4 p1, -0x1

    return p1

    :cond_8
    iget-object v0, p0, Lz5/jl1;->s:Ljava/nio/ByteBuffer;

    invoke-virtual {v0}, Ljava/nio/ByteBuffer;->limit()I

    move-result v0

    iget v1, p0, Lz5/jl1;->v:I

    sub-int/2addr v0, v1

    if-le p3, v0, :cond_14

    move p3, v0

    :cond_14
    iget-boolean v0, p0, Lz5/jl1;->w:Z

    if-eqz v0, :cond_21

    iget-object v0, p0, Lz5/jl1;->x:[B

    iget v2, p0, Lz5/jl1;->y:I

    add-int/2addr v1, v2

    invoke-static {v0, v1, p1, p2, p3}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V

    goto :goto_3e

    :cond_21
    iget-object v0, p0, Lz5/jl1;->s:Ljava/nio/ByteBuffer;

    invoke-virtual {v0}, Ljava/nio/ByteBuffer;->position()I

    move-result v0

    iget-object v1, p0, Lz5/jl1;->s:Ljava/nio/ByteBuffer;

    iget v2, p0, Lz5/jl1;->v:I

    invoke-virtual {v1, v2}, Ljava/nio/ByteBuffer;->position(I)Ljava/nio/Buffer;

    move-result-object v1

    check-cast v1, Ljava/nio/ByteBuffer;

    iget-object v1, p0, Lz5/jl1;->s:Ljava/nio/ByteBuffer;

    invoke-virtual {v1, p1, p2, p3}, Ljava/nio/ByteBuffer;->get([BII)Ljava/nio/ByteBuffer;

    iget-object p1, p0, Lz5/jl1;->s:Ljava/nio/ByteBuffer;

    invoke-virtual {p1, v0}, Ljava/nio/ByteBuffer;->position(I)Ljava/nio/Buffer;

    move-result-object p1

    check-cast p1, Ljava/nio/ByteBuffer;

    :goto_3e
    invoke-virtual {p0, p3}, Lz5/jl1;->e(I)V

    return p3
.end method
