n.smali

.class final Lokhttp3/internal/http2/n;
.super Ljava/lang/Object;
.source "Http2Reader.java"

# interfaces
.implements Lokio/s;


# instance fields
.field private final byt:Lokio/f;

.field bzj:B

.field bzk:I

.field bzl:S

.field left:I

.field length:I


# direct methods
.method constructor <init>(Lokio/f;)V
    .registers 2

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

    .line 360
    iput-object p1, p0, Lokhttp3/internal/http2/n;->byt:Lokio/f;

    .line 361
    return-void
.end method


# virtual methods
.method public final close()V
    .registers 1

    .prologue
    .line 383
    return-void
.end method

.method public final read(Lokio/d;J)J
    .registers 14

    .prologue
    const/4 v9, 0x1

    const-wide/16 v0, -0x1

    const/4 v8, 0x0

    .line 364
    :cond_4
    iget v2, p0, Lokhttp3/internal/http2/n;->left:I

    if-nez v2, :cond_7a

    .line 365
    iget-object v2, p0, Lokhttp3/internal/http2/n;->byt:Lokio/f;

    iget-short v3, p0, Lokhttp3/internal/http2/n;->bzl:S

    int-to-long v4, v3

    invoke-interface {v2, v4, v5}, Lokio/f;->Y(J)V

    .line 366
    iput-short v8, p0, Lokhttp3/internal/http2/n;->bzl:S

    .line 367
    iget-byte v2, p0, Lokhttp3/internal/http2/n;->bzj:B

    and-int/lit8 v2, v2, 0x4

    if-eqz v2, :cond_19

    .line 375
    :cond_18
    :goto_18
    return-wide v0

    .line 1386
    :cond_19
    iget v2, p0, Lokhttp3/internal/http2/n;->bzk:I

    .line 1388
    iget-object v3, p0, Lokhttp3/internal/http2/n;->byt:Lokio/f;

    invoke-static {v3}, Lokhttp3/internal/http2/m;->b(Lokio/f;)I

    move-result v3

    iput v3, p0, Lokhttp3/internal/http2/n;->left:I

    iput v3, p0, Lokhttp3/internal/http2/n;->length:I

    .line 1389
    iget-object v3, p0, Lokhttp3/internal/http2/n;->byt:Lokio/f;

    invoke-interface {v3}, Lokio/f;->readByte()B

    move-result v3

    int-to-byte v3, v3

    .line 1390
    iget-object v4, p0, Lokhttp3/internal/http2/n;->byt:Lokio/f;

    invoke-interface {v4}, Lokio/f;->readByte()B

    move-result v4

    int-to-byte v4, v4

    iput-byte v4, p0, Lokhttp3/internal/http2/n;->bzj:B

    .line 1391
    sget-object v4, Lokhttp3/internal/http2/m;->logger:Ljava/util/logging/Logger;

    sget-object v5, Ljava/util/logging/Level;->FINE:Ljava/util/logging/Level;

    invoke-virtual {v4, v5}, Ljava/util/logging/Logger;->isLoggable(Ljava/util/logging/Level;)Z

    move-result v4

    if-eqz v4, :cond_4e

    sget-object v4, Lokhttp3/internal/http2/m;->logger:Ljava/util/logging/Logger;

    iget v5, p0, Lokhttp3/internal/http2/n;->bzk:I

    iget v6, p0, Lokhttp3/internal/http2/n;->length:I

    iget-byte v7, p0, Lokhttp3/internal/http2/n;->bzj:B

    invoke-static {v9, v5, v6, v3, v7}, Lokhttp3/internal/http2/e;->b(ZIIBB)Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v4, v5}, Ljava/util/logging/Logger;->fine(Ljava/lang/String;)V

    .line 1392
    :cond_4e
    iget-object v4, p0, Lokhttp3/internal/http2/n;->byt:Lokio/f;

    invoke-interface {v4}, Lokio/f;->readInt()I

    move-result v4

    const v5, 0x7fffffff

    and-int/2addr v4, v5

    iput v4, p0, Lokhttp3/internal/http2/n;->bzk:I

    .line 1393
    const/16 v4, 0x9

    if-eq v3, v4, :cond_6d

    const-string v0, "%s != TYPE_CONTINUATION"

    new-array v1, v9, [Ljava/lang/Object;

    invoke-static {v3}, Ljava/lang/Byte;->valueOf(B)Ljava/lang/Byte;

    move-result-object v2

    aput-object v2, v1, v8

    invoke-static {v0, v1}, Lokhttp3/internal/http2/e;->a(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/IOException;

    move-result-object v0

    throw v0

    .line 1394
    :cond_6d
    iget v3, p0, Lokhttp3/internal/http2/n;->bzk:I

    if-eq v3, v2, :cond_4

    const-string v0, "TYPE_CONTINUATION streamId changed"

    new-array v1, v8, [Ljava/lang/Object;

    invoke-static {v0, v1}, Lokhttp3/internal/http2/e;->a(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/IOException;

    move-result-object v0

    throw v0

    .line 372
    :cond_7a
    iget-object v2, p0, Lokhttp3/internal/http2/n;->byt:Lokio/f;

    iget v3, p0, Lokhttp3/internal/http2/n;->left:I

    int-to-long v4, v3

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

    move-result-wide v4

    invoke-interface {v2, p1, v4, v5}, Lokio/f;->read(Lokio/d;J)J

    move-result-wide v2

    .line 373
    cmp-long v4, v2, v0

    if-eqz v4, :cond_18

    .line 374
    iget v0, p0, Lokhttp3/internal/http2/n;->left:I

    int-to-long v0, v0

    sub-long/2addr v0, v2

    long-to-int v0, v0

    iput v0, p0, Lokhttp3/internal/http2/n;->left:I

    move-wide v0, v2

    .line 375
    goto :goto_18
.end method

.method public final timeout()Lokio/t;
    .registers 2

    .prologue
    .line 379
    iget-object v0, p0, Lokhttp3/internal/http2/n;->byt:Lokio/f;

    invoke-interface {v0}, Lokio/f;->timeout()Lokio/t;

    move-result-object v0

    return-object v0
.end method