g.smali

.class public final Lcom/beetalklib/network/tcp/g;
.super Ljava/lang/Object;
.source "SourceFile"


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


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

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

    .line 2
    iput-object p1, p0, Lcom/beetalklib/network/tcp/g;->a:Ljava/io/InputStream;

    return-void
.end method


# virtual methods
.method public final a(I)[B
    .registers 6
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/Exception;
        }
    .end annotation

    const/4 v0, 0x0

    if-nez p1, :cond_4

    return-object v0

    .line 1
    :cond_4
    new-array v1, p1, [B

    const/4 v2, 0x0

    .line 2
    :goto_7
    iget-object v3, p0, Lcom/beetalklib/network/tcp/g;->a:Ljava/io/InputStream;

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

    move-result v3

    if-lez v3, :cond_15

    if-ge v3, p1, :cond_14

    add-int/2addr v2, v3

    sub-int/2addr p1, v3

    goto :goto_7

    :cond_14
    return-object v1

    :cond_15
    return-object v0
.end method

.method public final b()Lcom/beetalklib/network/tcp/f;
    .registers 6
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/beetalklib/network/exception/c;
        }
    .end annotation

    const/4 v0, 0x4

    .line 1
    :try_start_1
    invoke-virtual {p0, v0}, Lcom/beetalklib/network/tcp/g;->a(I)[B

    move-result-object v0

    const/4 v1, 0x0

    .line 2
    aget-byte v2, v0, v1

    and-int/lit16 v2, v2, 0xff

    const/4 v3, 0x1

    aget-byte v4, v0, v3

    and-int/lit16 v4, v4, 0xff

    shl-int/lit8 v4, v4, 0x8

    or-int/2addr v2, v4

    const/4 v4, 0x2

    aget-byte v4, v0, v4

    and-int/lit16 v4, v4, 0xff

    shl-int/lit8 v4, v4, 0x10

    or-int/2addr v2, v4

    const/4 v4, 0x3

    aget-byte v0, v0, v4

    and-int/lit16 v0, v0, 0xff

    shl-int/lit8 v0, v0, 0x18

    or-int/2addr v0, v2

    .line 3
    invoke-virtual {p0, v3}, Lcom/beetalklib/network/tcp/g;->a(I)[B

    move-result-object v2

    .line 4
    aget-byte v4, v2, v1

    sub-int/2addr v0, v3

    .line 5
    invoke-virtual {p0, v0}, Lcom/beetalklib/network/tcp/g;->a(I)[B

    move-result-object v0

    .line 6
    new-instance v3, Lcom/beetalklib/network/tcp/f;

    aget-byte v1, v2, v1

    and-int/lit16 v1, v1, 0xff

    invoke-direct {v3, v1, v0}, Lcom/beetalklib/network/tcp/f;-><init>(I[B)V
    :try_end_36
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_36} :catch_37

    return-object v3

    :catch_37
    move-exception v0

    .line 7
    new-instance v1, Lcom/beetalklib/network/exception/c;

    invoke-direct {v1, v0}, Lcom/beetalklib/network/exception/c;-><init>(Ljava/lang/Exception;)V

    throw v1
.end method