RequestBody$3.smali 3.1 KB
.class Lcom/brplug/okhttp3/RequestBody$3;
.super Lcom/brplug/okhttp3/RequestBody;
.source "RequestBody.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/brplug/okhttp3/RequestBody;->create(Lcom/brplug/okhttp3/MediaType;Ljava/io/File;)Lcom/brplug/okhttp3/RequestBody;
.end annotation

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


# instance fields
.field final synthetic val$contentType:Lcom/brplug/okhttp3/MediaType;

.field final synthetic val$file:Ljava/io/File;


# direct methods
.method constructor <init>(Lcom/brplug/okhttp3/MediaType;Ljava/io/File;)V
    .locals 0

    .line 160
    iput-object p1, p0, Lcom/brplug/okhttp3/RequestBody$3;->val$contentType:Lcom/brplug/okhttp3/MediaType;

    iput-object p2, p0, Lcom/brplug/okhttp3/RequestBody$3;->val$file:Ljava/io/File;

    invoke-direct {p0}, Lcom/brplug/okhttp3/RequestBody;-><init>()V

    return-void
.end method


# virtual methods
.method public contentLength()J
    .locals 2

    .line 166
    iget-object v0, p0, Lcom/brplug/okhttp3/RequestBody$3;->val$file:Ljava/io/File;

    invoke-virtual {v0}, Ljava/io/File;->length()J

    move-result-wide v0

    return-wide v0
.end method

.method public contentType()Lcom/brplug/okhttp3/MediaType;
    .locals 1
    .annotation runtime Ljavax/annotation/Nullable;
    .end annotation

    .line 162
    iget-object v0, p0, Lcom/brplug/okhttp3/RequestBody$3;->val$contentType:Lcom/brplug/okhttp3/MediaType;

    return-object v0
.end method

.method public writeTo(Lcom/brplug/okio/BufferedSink;)V
    .locals 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 170
    iget-object v0, p0, Lcom/brplug/okhttp3/RequestBody$3;->val$file:Ljava/io/File;

    invoke-static {v0}, Lcom/brplug/okio/Okio;->source(Ljava/io/File;)Lcom/brplug/okio/Source;

    move-result-object v0

    .line 171
    :try_start_0
    invoke-interface {p1, v0}, Lcom/brplug/okio/BufferedSink;->writeAll(Lcom/brplug/okio/Source;)J
    :try_end_0
    .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    if-eqz v0, :cond_0

    .line 172
    invoke-interface {v0}, Lcom/brplug/okio/Source;->close()V

    :cond_0
    return-void

    :catchall_0
    move-exception p1

    const/4 v1, 0x0

    goto :goto_0

    :catch_0
    move-exception v1

    .line 170
    :try_start_1
    throw v1
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_1

    :catchall_1
    move-exception p1

    :goto_0
    if-eqz v0, :cond_2

    if-eqz v1, :cond_1

    .line 172
    :try_start_2
    invoke-interface {v0}, Lcom/brplug/okio/Source;->close()V
    :try_end_2
    .catch Ljava/lang/Throwable; {:try_start_2 .. :try_end_2} :catch_1

    goto :goto_1

    :catch_1
    move-exception v0

    invoke-virtual {v1, v0}, Ljava/lang/Throwable;->addSuppressed(Ljava/lang/Throwable;)V

    goto :goto_1

    :cond_1
    invoke-interface {v0}, Lcom/brplug/okio/Source;->close()V

    :cond_2
    :goto_1
    throw p1
.end method