.class public final Lha/o;
.super Ljava/lang/Object;
.source ""

# interfaces
.implements Lha/z;


# instance fields
.field public final r:Ljava/io/InputStream;

.field public final s:Lha/a0;


# direct methods
.method public constructor <init>(Ljava/io/InputStream;Lha/a0;)V
    .registers 3

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

    iput-object p1, p0, Lha/o;->r:Ljava/io/InputStream;

    iput-object p2, p0, Lha/o;->s:Lha/a0;

    return-void
.end method


# virtual methods
.method public close()V
    .registers 2

    iget-object v0, p0, Lha/o;->r:Ljava/io/InputStream;

    invoke-virtual {v0}, Ljava/io/InputStream;->close()V

    return-void
.end method

.method public d()Lha/a0;
    .registers 2

    iget-object v0, p0, Lha/o;->s:Lha/a0;

    return-object v0
.end method

.method public toString()Ljava/lang/String;
    .registers 3

    const-string v0, "source("

    invoke-static {v0}, Landroidx/activity/c;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-object v1, p0, Lha/o;->r:Ljava/io/InputStream;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    const/16 v1, 0x29

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public x(Lha/e;J)J
    .registers 7

    const-string v0, "sink"

    invoke-static {p1, v0}, Lx/e;->f(Ljava/lang/Object;Ljava/lang/String;)V

    const-wide/16 v0, 0x0

    cmp-long v2, p2, v0

    if-nez v2, :cond_c

    return-wide v0

    :cond_c
    const/4 v0, 0x1

    if-ltz v2, :cond_11

    move v1, v0

    goto :goto_12

    :cond_11
    const/4 v1, 0x0

    :goto_12
    if-eqz v1, :cond_60

    :try_start_14
    iget-object v1, p0, Lha/o;->s:Lha/a0;

    invoke-virtual {v1}, Lha/a0;->f()V

    invoke-virtual {p1, v0}, Lha/e;->Z(I)Lha/u;

    move-result-object v0

    iget v1, v0, Lha/u;->c:I

    rsub-int v1, v1, 0x2000

    int-to-long v1, v1

    invoke-static {p2, p3, v1, v2}, Ljava/lang/Math;->min(JJ)J

    move-result-wide p2

    long-to-int p2, p2

    iget-object p3, p0, Lha/o;->r:Ljava/io/InputStream;

    iget-object v1, v0, Lha/u;->a:[B

    iget v2, v0, Lha/u;->c:I

    invoke-virtual {p3, v1, v2, p2}, Ljava/io/InputStream;->read([BII)I

    move-result p2

    const/4 p3, -0x1

    if-ne p2, p3, :cond_46

    iget p2, v0, Lha/u;->b:I

    iget p3, v0, Lha/u;->c:I

    if-ne p2, p3, :cond_43

    invoke-virtual {v0}, Lha/u;->a()Lha/u;

    move-result-object p2

    iput-object p2, p1, Lha/e;->r:Lha/u;

    invoke-static {v0}, Lha/v;->b(Lha/u;)V

    :cond_43
    const-wide/16 p1, -0x1

    return-wide p1

    :cond_46
    iget p3, v0, Lha/u;->c:I

    add-int/2addr p3, p2

    iput p3, v0, Lha/u;->c:I

    .line 1
    iget-wide v0, p1, Lha/e;->s:J

    int-to-long p2, p2

    add-long/2addr v0, p2

    .line 2
    iput-wide v0, p1, Lha/e;->s:J
    :try_end_51
    .catch Ljava/lang/AssertionError; {:try_start_14 .. :try_end_51} :catch_52

    return-wide p2

    :catch_52
    move-exception p1

    .line 3
    invoke-static {p1}, Le/h;->e(Ljava/lang/AssertionError;)Z

    move-result p2

    if-eqz p2, :cond_5f

    new-instance p2, Ljava/io/IOException;

    invoke-direct {p2, p1}, Ljava/io/IOException;-><init>(Ljava/lang/Throwable;)V

    throw p2

    :cond_5f
    throw p1

    :cond_60
    const-string p1, "byteCount < 0: "

    invoke-static {p1, p2, p3}, Lv0/a;->a(Ljava/lang/String;J)Ljava/lang/String;

    move-result-object p1

    new-instance p2, Ljava/lang/IllegalArgumentException;

    invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object p1

    invoke-direct {p2, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw p2
.end method
