ProtoLiteUtils$1.smali

.class final Lio/grpc/protobuf/lite/ProtoLiteUtils$1;
.super Ljava/lang/Object;
.source "ProtoLiteUtils.java"

# interfaces
.implements Lio/grpc/MethodDescriptor$Marshaller;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lio/grpc/protobuf/lite/ProtoLiteUtils;->marshaller(Lcom/google/protobuf/x;)Lio/grpc/MethodDescriptor$Marshaller;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x8
    name = null
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Ljava/lang/Object;",
        "Lio/grpc/MethodDescriptor$Marshaller<",
        "TT;>;"
    }
.end annotation


# instance fields
.field final synthetic val$parser:Lcom/google/protobuf/A;


# direct methods
.method constructor <init>(Lcom/google/protobuf/A;)V
    .registers 2

    .line 1
    iput-object p1, p0, Lio/grpc/protobuf/lite/ProtoLiteUtils$1;->val$parser:Lcom/google/protobuf/A;

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

    return-void
.end method

.method private parseFrom(Ljava/io/InputStream;)Lcom/google/protobuf/x;
    .registers 4
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/io/InputStream;",
            ")TT;"
        }
    .end annotation

    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/google/protobuf/InvalidProtocolBufferException;
        }
    .end annotation

    .line 1
    invoke-static {p1}, Lcom/google/protobuf/g;->a(Ljava/io/InputStream;)Lcom/google/protobuf/g;

    move-result-object p1

    const v0, 0x7fffffff

    .line 2
    invoke-virtual {p1, v0}, Lcom/google/protobuf/g;->d(I)I

    .line 3
    iget-object v0, p0, Lio/grpc/protobuf/lite/ProtoLiteUtils$1;->val$parser:Lcom/google/protobuf/A;

    # getter for: Lio/grpc/protobuf/lite/ProtoLiteUtils;->globalRegistry:Lcom/google/protobuf/l;
    invoke-static {}, Lio/grpc/protobuf/lite/ProtoLiteUtils;->access$000()Lcom/google/protobuf/l;

    move-result-object v1

    invoke-interface {v0, p1, v1}, Lcom/google/protobuf/A;->a(Lcom/google/protobuf/g;Lcom/google/protobuf/l;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/google/protobuf/x;

    const/4 v1, 0x0

    .line 4
    :try_start_17
    invoke-virtual {p1, v1}, Lcom/google/protobuf/g;->a(I)V
    :try_end_1a
    .catch Lcom/google/protobuf/InvalidProtocolBufferException; {:try_start_17 .. :try_end_1a} :catch_1b

    return-object v0

    :catch_1b
    move-exception p1

    .line 5
    invoke-virtual {p1, v0}, Lcom/google/protobuf/InvalidProtocolBufferException;->setUnfinishedMessage(Lcom/google/protobuf/x;)Lcom/google/protobuf/InvalidProtocolBufferException;

    .line 6
    throw p1
.end method


# virtual methods
.method public parse(Ljava/io/InputStream;)Lcom/google/protobuf/x;
    .registers 4
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/io/InputStream;",
            ")TT;"
        }
    .end annotation

    .line 2
    instance-of v0, p1, Lio/grpc/protobuf/lite/ProtoInputStream;

    if-eqz v0, :cond_17

    .line 3
    move-object v0, p1

    check-cast v0, Lio/grpc/protobuf/lite/ProtoInputStream;

    .line 4
    invoke-virtual {v0}, Lio/grpc/protobuf/lite/ProtoInputStream;->parser()Lcom/google/protobuf/A;

    move-result-object v0

    iget-object v1, p0, Lio/grpc/protobuf/lite/ProtoLiteUtils$1;->val$parser:Lcom/google/protobuf/A;

    if-ne v0, v1, :cond_17

    .line 5
    :try_start_f
    move-object v0, p1

    check-cast v0, Lio/grpc/protobuf/lite/ProtoInputStream;

    invoke-virtual {v0}, Lio/grpc/protobuf/lite/ProtoInputStream;->message()Lcom/google/protobuf/x;

    move-result-object p1
    :try_end_16
    .catch Ljava/lang/IllegalStateException; {:try_start_f .. :try_end_16} :catch_17

    return-object p1

    .line 6
    :catch_17
    :cond_17
    :try_start_17
    invoke-direct {p0, p1}, Lio/grpc/protobuf/lite/ProtoLiteUtils$1;->parseFrom(Ljava/io/InputStream;)Lcom/google/protobuf/x;

    move-result-object p1
    :try_end_1b
    .catch Lcom/google/protobuf/InvalidProtocolBufferException; {:try_start_17 .. :try_end_1b} :catch_1c

    return-object p1

    :catch_1c
    move-exception p1

    .line 7
    sget-object v0, Lio/grpc/Status;->INTERNAL:Lio/grpc/Status;

    const-string v1, "Invalid protobuf byte sequence"

    invoke-virtual {v0, v1}, Lio/grpc/Status;->withDescription(Ljava/lang/String;)Lio/grpc/Status;

    move-result-object v0

    .line 8
    invoke-virtual {v0, p1}, Lio/grpc/Status;->withCause(Ljava/lang/Throwable;)Lio/grpc/Status;

    move-result-object p1

    invoke-virtual {p1}, Lio/grpc/Status;->asRuntimeException()Lio/grpc/StatusRuntimeException;

    move-result-object p1

    throw p1
.end method

.method public bridge synthetic parse(Ljava/io/InputStream;)Ljava/lang/Object;
    .registers 2

    .line 1
    invoke-virtual {p0, p1}, Lio/grpc/protobuf/lite/ProtoLiteUtils$1;->parse(Ljava/io/InputStream;)Lcom/google/protobuf/x;

    move-result-object p1

    return-object p1
.end method

.method public stream(Lcom/google/protobuf/x;)Ljava/io/InputStream;
    .registers 4
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(TT;)",
            "Ljava/io/InputStream;"
        }
    .end annotation

    .line 2
    new-instance v0, Lio/grpc/protobuf/lite/ProtoInputStream;

    iget-object v1, p0, Lio/grpc/protobuf/lite/ProtoLiteUtils$1;->val$parser:Lcom/google/protobuf/A;

    invoke-direct {v0, p1, v1}, Lio/grpc/protobuf/lite/ProtoInputStream;-><init>(Lcom/google/protobuf/x;Lcom/google/protobuf/A;)V

    return-object v0
.end method

.method public bridge synthetic stream(Ljava/lang/Object;)Ljava/io/InputStream;
    .registers 2

    .line 1
    check-cast p1, Lcom/google/protobuf/x;

    invoke-virtual {p0, p1}, Lio/grpc/protobuf/lite/ProtoLiteUtils$1;->stream(Lcom/google/protobuf/x;)Ljava/io/InputStream;

    move-result-object p1

    return-object p1
.end method