.class final Lc/v;
.super Ljava/lang/Object;

# interfaces
.implements Lc/d;


# instance fields
.field a:Z

.field public final b:Lc/c;

.field public final c:Lc/m;


# direct methods
.method constructor <init>(Lc/m;)V
    .locals 2

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

    new-instance v0, Lc/c;

    invoke-direct {v0}, Lc/c;-><init>()V

    iput-object v0, p0, Lc/v;->b:Lc/c;

    if-nez p1, :cond_0

    new-instance v0, Ljava/lang/NullPointerException;

    const-string v1, "sink == null"

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

    throw v0

    :cond_0
    iput-object p1, p0, Lc/v;->c:Lc/m;

    return-void
.end method


# virtual methods
.method public final a(Lc/n;)J
    .locals 6

    if-nez p1, :cond_0

    new-instance v0, Ljava/lang/IllegalArgumentException;

    const-string v1, "source == null"

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

    throw v0

    :cond_0
    const-wide/16 v0, 0x0

    :goto_0
    iget-object v2, p0, Lc/v;->b:Lc/c;

    const-wide/16 v4, 0x2000

    invoke-interface {p1, v2, v4, v5}, Lc/n;->a(Lc/c;J)J

    move-result-wide v2

    const-wide/16 v4, -0x1

    cmp-long v4, v2, v4

    if-eqz v4, :cond_1

    add-long/2addr v0, v2

    invoke-virtual {p0}, Lc/v;->g()Lc/d;

    goto :goto_0

    :cond_1
    return-wide v0
.end method

.method public final a()Lc/o;
    .locals 1

    iget-object v0, p0, Lc/v;->c:Lc/m;

    invoke-interface {v0}, Lc/m;->a()Lc/o;

    move-result-object v0

    return-object v0
.end method

.method public final a_(Lc/c;J)V
    .locals 2

    iget-boolean v0, p0, Lc/v;->a:Z

    if-eqz v0, :cond_0

    new-instance v0, Ljava/lang/IllegalStateException;

    const-string v1, "closed"

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

    throw v0

    :cond_0
    iget-object v0, p0, Lc/v;->b:Lc/c;

    invoke-virtual {v0, p1, p2, p3}, Lc/c;->a_(Lc/c;J)V

    invoke-virtual {p0}, Lc/v;->g()Lc/d;

    return-void
.end method

.method public final b()Lc/c;
    .locals 1

    iget-object v0, p0, Lc/v;->b:Lc/c;

    return-object v0
.end method

.method public final b(Lc/f;)Lc/d;
    .locals 2

    iget-boolean v0, p0, Lc/v;->a:Z

    if-eqz v0, :cond_0

    new-instance v0, Ljava/lang/IllegalStateException;

    const-string v1, "closed"

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

    throw v0

    :cond_0
    iget-object v0, p0, Lc/v;->b:Lc/c;

    invoke-virtual {v0, p1}, Lc/c;->a(Lc/f;)Lc/c;

    invoke-virtual {p0}, Lc/v;->g()Lc/d;

    move-result-object v0

    return-object v0
.end method

.method public final b(Ljava/lang/String;)Lc/d;
    .locals 2

    iget-boolean v0, p0, Lc/v;->a:Z

    if-eqz v0, :cond_0

    new-instance v0, Ljava/lang/IllegalStateException;

    const-string v1, "closed"

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

    throw v0

    :cond_0
    iget-object v0, p0, Lc/v;->b:Lc/c;

    invoke-virtual {v0, p1}, Lc/c;->a(Ljava/lang/String;)Lc/c;

    invoke-virtual {p0}, Lc/v;->g()Lc/d;

    move-result-object v0

    return-object v0
.end method

.method public final c([B)Lc/d;
    .locals 2

    iget-boolean v0, p0, Lc/v;->a:Z

    if-eqz v0, :cond_0

    new-instance v0, Ljava/lang/IllegalStateException;

    const-string v1, "closed"

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

    throw v0

    :cond_0
    iget-object v0, p0, Lc/v;->b:Lc/c;

    invoke-virtual {v0, p1}, Lc/c;->b([B)Lc/c;

    invoke-virtual {p0}, Lc/v;->g()Lc/d;

    move-result-object v0

    return-object v0
.end method

.method public final close()V
    .locals 6

    iget-boolean v0, p0, Lc/v;->a:Z

    if-eqz v0, :cond_1

    :cond_0
    :goto_0
    return-void

    :cond_1
    const/4 v0, 0x0

    :try_start_0
    iget-object v1, p0, Lc/v;->b:Lc/c;

    iget-wide v2, v1, Lc/c;->b:J

    const-wide/16 v4, 0x0

    cmp-long v1, v2, v4

    if-lez v1, :cond_2

    iget-object v1, p0, Lc/v;->c:Lc/m;

    iget-object v2, p0, Lc/v;->b:Lc/c;

    iget-object v3, p0, Lc/v;->b:Lc/c;

    iget-wide v4, v3, Lc/c;->b:J

    invoke-interface {v1, v2, v4, v5}, Lc/m;->a_(Lc/c;J)V
    :try_end_0
    .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_1

    :cond_2
    :goto_1
    :try_start_1
    iget-object v1, p0, Lc/v;->c:Lc/m;

    invoke-interface {v1}, Lc/m;->close()V
    :try_end_1
    .catch Ljava/lang/Throwable; {:try_start_1 .. :try_end_1} :catch_0

    :cond_3
    :goto_2
    const/4 v1, 0x1

    iput-boolean v1, p0, Lc/v;->a:Z

    if-eqz v0, :cond_0

    invoke-static {v0}, Lc/ab;->a(Ljava/lang/Throwable;)V

    goto :goto_0

    :catch_0
    move-exception v1

    if-nez v0, :cond_3

    move-object v0, v1

    goto :goto_2

    :catch_1
    move-exception v0

    goto :goto_1
.end method

.method public final d(I)Lc/d;
    .locals 2

    iget-boolean v0, p0, Lc/v;->a:Z

    if-eqz v0, :cond_0

    new-instance v0, Ljava/lang/IllegalStateException;

    const-string v1, "closed"

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

    throw v0

    :cond_0
    iget-object v0, p0, Lc/v;->b:Lc/c;

    invoke-virtual {v0, p1}, Lc/c;->c(I)Lc/c;

    invoke-virtual {p0}, Lc/v;->g()Lc/d;

    move-result-object v0

    return-object v0
.end method

.method public final f(I)Lc/d;
    .locals 2

    iget-boolean v0, p0, Lc/v;->a:Z

    if-eqz v0, :cond_0

    new-instance v0, Ljava/lang/IllegalStateException;

    const-string v1, "closed"

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

    throw v0

    :cond_0
    iget-object v0, p0, Lc/v;->b:Lc/c;

    invoke-virtual {v0, p1}, Lc/c;->e(I)Lc/c;

    invoke-virtual {p0}, Lc/v;->g()Lc/d;

    move-result-object v0

    return-object v0
.end method

.method public final flush()V
    .locals 4

    iget-boolean v0, p0, Lc/v;->a:Z

    if-eqz v0, :cond_0

    new-instance v0, Ljava/lang/IllegalStateException;

    const-string v1, "closed"

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

    throw v0

    :cond_0
    iget-object v0, p0, Lc/v;->b:Lc/c;

    iget-wide v0, v0, Lc/c;->b:J

    const-wide/16 v2, 0x0

    cmp-long v0, v0, v2

    if-lez v0, :cond_1

    iget-object v0, p0, Lc/v;->c:Lc/m;

    iget-object v1, p0, Lc/v;->b:Lc/c;

    iget-object v2, p0, Lc/v;->b:Lc/c;

    iget-wide v2, v2, Lc/c;->b:J

    invoke-interface {v0, v1, v2, v3}, Lc/m;->a_(Lc/c;J)V

    :cond_1
    iget-object v0, p0, Lc/v;->c:Lc/m;

    invoke-interface {v0}, Lc/m;->flush()V

    return-void
.end method

.method public final g()Lc/d;
    .locals 4

    iget-boolean v0, p0, Lc/v;->a:Z

    if-eqz v0, :cond_0

    new-instance v0, Ljava/lang/IllegalStateException;

    const-string v1, "closed"

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

    throw v0

    :cond_0
    iget-object v0, p0, Lc/v;->b:Lc/c;

    invoke-virtual {v0}, Lc/c;->e()J

    move-result-wide v0

    const-wide/16 v2, 0x0

    cmp-long v2, v0, v2

    if-lez v2, :cond_1

    iget-object v2, p0, Lc/v;->c:Lc/m;

    iget-object v3, p0, Lc/v;->b:Lc/c;

    invoke-interface {v2, v3, v0, v1}, Lc/m;->a_(Lc/c;J)V

    :cond_1
    return-object p0
.end method

.method public final h(I)Lc/d;
    .locals 2

    iget-boolean v0, p0, Lc/v;->a:Z

    if-eqz v0, :cond_0

    new-instance v0, Ljava/lang/IllegalStateException;

    const-string v1, "closed"

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

    throw v0

    :cond_0
    iget-object v0, p0, Lc/v;->b:Lc/c;

    invoke-virtual {v0, p1}, Lc/c;->g(I)Lc/c;

    invoke-virtual {p0}, Lc/v;->g()Lc/d;

    move-result-object v0

    return-object v0
.end method

.method public final i(J)Lc/d;
    .locals 3

    iget-boolean v0, p0, Lc/v;->a:Z

    if-eqz v0, :cond_0

    new-instance v0, Ljava/lang/IllegalStateException;

    const-string v1, "closed"

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

    throw v0

    :cond_0
    iget-object v0, p0, Lc/v;->b:Lc/c;

    invoke-virtual {v0, p1, p2}, Lc/c;->h(J)Lc/c;

    invoke-virtual {p0}, Lc/v;->g()Lc/d;

    move-result-object v0

    return-object v0
.end method

.method public final k(J)Lc/d;
    .locals 3

    iget-boolean v0, p0, Lc/v;->a:Z

    if-eqz v0, :cond_0

    new-instance v0, Ljava/lang/IllegalStateException;

    const-string v1, "closed"

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

    throw v0

    :cond_0
    iget-object v0, p0, Lc/v;->b:Lc/c;

    invoke-virtual {v0, p1, p2}, Lc/c;->j(J)Lc/c;

    invoke-virtual {p0}, Lc/v;->g()Lc/d;

    move-result-object v0

    return-object v0
.end method

.method public final toString()Ljava/lang/String;
    .locals 2

    new-instance v0, Ljava/lang/StringBuilder;

    const-string v1, "buffer("

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

    iget-object v1, p0, Lc/v;->c:Lc/m;

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

    move-result-object v0

    const-string v1, ")"

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

    move-result-object v0

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

    move-result-object v0

    return-object v0
.end method
