123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598 |
- .class public final Lokhttp3/MultipartBody;
- .super Lokhttp3/RequestBody;
- .source ""
- # annotations
- .annotation system Ldalvik/annotation/MemberClasses;
- value = {
- Lokhttp3/MultipartBody$Builder;,
- Lokhttp3/MultipartBody$Part;
- }
- .end annotation
- # static fields
- .field public static final ALTERNATIVE:Lokhttp3/MediaType;
- .field private static final COLONSPACE:[B
- .field private static final CRLF:[B
- .field private static final DASHDASH:[B
- .field public static final DIGEST:Lokhttp3/MediaType;
- .field public static final FORM:Lokhttp3/MediaType;
- .field public static final MIXED:Lokhttp3/MediaType;
- .field public static final PARALLEL:Lokhttp3/MediaType;
- # instance fields
- .field private final boundary:Lokio/ByteString;
- .field private contentLength:J
- .field private final contentType:Lokhttp3/MediaType;
- .field private final originalType:Lokhttp3/MediaType;
- .field private final parts:Ljava/util/List;
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "Ljava/util/List<",
- "Lokhttp3/MultipartBody$Part;",
- ">;"
- }
- .end annotation
- .end field
- # direct methods
- .method static constructor <clinit>()V
- .locals 2
- const-string v0, "multipart/mixed"
- invoke-static {v0}, Lokhttp3/MediaType;->parse(Ljava/lang/String;)Lokhttp3/MediaType;
- move-result-object v0
- sput-object v0, Lokhttp3/MultipartBody;->MIXED:Lokhttp3/MediaType;
- const-string v0, "multipart/alternative"
- invoke-static {v0}, Lokhttp3/MediaType;->parse(Ljava/lang/String;)Lokhttp3/MediaType;
- move-result-object v0
- sput-object v0, Lokhttp3/MultipartBody;->ALTERNATIVE:Lokhttp3/MediaType;
- const-string v0, "multipart/digest"
- invoke-static {v0}, Lokhttp3/MediaType;->parse(Ljava/lang/String;)Lokhttp3/MediaType;
- move-result-object v0
- sput-object v0, Lokhttp3/MultipartBody;->DIGEST:Lokhttp3/MediaType;
- const-string v0, "multipart/parallel"
- invoke-static {v0}, Lokhttp3/MediaType;->parse(Ljava/lang/String;)Lokhttp3/MediaType;
- move-result-object v0
- sput-object v0, Lokhttp3/MultipartBody;->PARALLEL:Lokhttp3/MediaType;
- const-string v0, "multipart/form-data"
- invoke-static {v0}, Lokhttp3/MediaType;->parse(Ljava/lang/String;)Lokhttp3/MediaType;
- move-result-object v0
- sput-object v0, Lokhttp3/MultipartBody;->FORM:Lokhttp3/MediaType;
- const/4 v0, 0x2
- new-array v1, v0, [B
- fill-array-data v1, :array_0
- sput-object v1, Lokhttp3/MultipartBody;->COLONSPACE:[B
- new-array v1, v0, [B
- fill-array-data v1, :array_1
- sput-object v1, Lokhttp3/MultipartBody;->CRLF:[B
- new-array v0, v0, [B
- fill-array-data v0, :array_2
- sput-object v0, Lokhttp3/MultipartBody;->DASHDASH:[B
- return-void
- nop
- :array_0
- .array-data 1
- 0x3at
- 0x20t
- .end array-data
- nop
- :array_1
- .array-data 1
- 0xdt
- 0xat
- .end array-data
- nop
- :array_2
- .array-data 1
- 0x2dt
- 0x2dt
- .end array-data
- .end method
- .method constructor <init>(Lokio/ByteString;Lokhttp3/MediaType;Ljava/util/List;)V
- .locals 2
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "(",
- "Lokio/ByteString;",
- "Lokhttp3/MediaType;",
- "Ljava/util/List<",
- "Lokhttp3/MultipartBody$Part;",
- ">;)V"
- }
- .end annotation
- invoke-direct {p0}, Lokhttp3/RequestBody;-><init>()V
- const-wide/16 v0, -0x1
- iput-wide v0, p0, Lokhttp3/MultipartBody;->contentLength:J
- iput-object p1, p0, Lokhttp3/MultipartBody;->boundary:Lokio/ByteString;
- iput-object p2, p0, Lokhttp3/MultipartBody;->originalType:Lokhttp3/MediaType;
- new-instance v0, Ljava/lang/StringBuilder;
- invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
- invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
- const-string p2, "; boundary="
- invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-virtual {p1}, Lokio/ByteString;->utf8()Ljava/lang/String;
- move-result-object p1
- invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
- move-result-object p1
- invoke-static {p1}, Lokhttp3/MediaType;->parse(Ljava/lang/String;)Lokhttp3/MediaType;
- move-result-object p1
- iput-object p1, p0, Lokhttp3/MultipartBody;->contentType:Lokhttp3/MediaType;
- invoke-static {p3}, Lokhttp3/internal/Util;->immutableList(Ljava/util/List;)Ljava/util/List;
- move-result-object p1
- iput-object p1, p0, Lokhttp3/MultipartBody;->parts:Ljava/util/List;
- return-void
- .end method
- .method static appendQuotedString(Ljava/lang/StringBuilder;Ljava/lang/String;)Ljava/lang/StringBuilder;
- .locals 5
- const/16 v0, 0x22
- invoke-virtual {p0, v0}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
- invoke-virtual {p1}, Ljava/lang/String;->length()I
- move-result v1
- const/4 v2, 0x0
- :goto_0
- if-ge v2, v1, :cond_3
- invoke-virtual {p1, v2}, Ljava/lang/String;->charAt(I)C
- move-result v3
- const/16 v4, 0xa
- if-eq v3, v4, :cond_2
- const/16 v4, 0xd
- if-eq v3, v4, :cond_1
- if-eq v3, v0, :cond_0
- invoke-virtual {p0, v3}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
- goto :goto_2
- :cond_0
- const-string v3, "%22"
- goto :goto_1
- :cond_1
- const-string v3, "%0D"
- goto :goto_1
- :cond_2
- const-string v3, "%0A"
- :goto_1
- invoke-virtual {p0, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- :goto_2
- add-int/lit8 v2, v2, 0x1
- goto :goto_0
- :cond_3
- invoke-virtual {p0, v0}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
- return-object p0
- .end method
- .method private writeOrCountBytes(Lokio/BufferedSink;Z)J
- .locals 12
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- if-eqz p2, :cond_0
- new-instance p1, Lokio/Buffer;
- invoke-direct {p1}, Lokio/Buffer;-><init>()V
- move-object v0, p1
- goto :goto_0
- :cond_0
- const/4 v0, 0x0
- :goto_0
- iget-object v1, p0, Lokhttp3/MultipartBody;->parts:Ljava/util/List;
- invoke-interface {v1}, Ljava/util/List;->size()I
- move-result v1
- const/4 v2, 0x0
- const-wide/16 v3, 0x0
- move-wide v4, v3
- const/4 v3, 0x0
- :goto_1
- if-ge v3, v1, :cond_6
- iget-object v6, p0, Lokhttp3/MultipartBody;->parts:Ljava/util/List;
- invoke-interface {v6, v3}, Ljava/util/List;->get(I)Ljava/lang/Object;
- move-result-object v6
- check-cast v6, Lokhttp3/MultipartBody$Part;
- iget-object v7, v6, Lokhttp3/MultipartBody$Part;->headers:Lokhttp3/Headers;
- iget-object v6, v6, Lokhttp3/MultipartBody$Part;->body:Lokhttp3/RequestBody;
- sget-object v8, Lokhttp3/MultipartBody;->DASHDASH:[B
- invoke-interface {p1, v8}, Lokio/BufferedSink;->write([B)Lokio/BufferedSink;
- iget-object v8, p0, Lokhttp3/MultipartBody;->boundary:Lokio/ByteString;
- invoke-interface {p1, v8}, Lokio/BufferedSink;->write(Lokio/ByteString;)Lokio/BufferedSink;
- sget-object v8, Lokhttp3/MultipartBody;->CRLF:[B
- invoke-interface {p1, v8}, Lokio/BufferedSink;->write([B)Lokio/BufferedSink;
- if-eqz v7, :cond_1
- invoke-virtual {v7}, Lokhttp3/Headers;->size()I
- move-result v8
- const/4 v9, 0x0
- :goto_2
- if-ge v9, v8, :cond_1
- invoke-virtual {v7, v9}, Lokhttp3/Headers;->name(I)Ljava/lang/String;
- move-result-object v10
- invoke-interface {p1, v10}, Lokio/BufferedSink;->writeUtf8(Ljava/lang/String;)Lokio/BufferedSink;
- move-result-object v10
- sget-object v11, Lokhttp3/MultipartBody;->COLONSPACE:[B
- invoke-interface {v10, v11}, Lokio/BufferedSink;->write([B)Lokio/BufferedSink;
- move-result-object v10
- invoke-virtual {v7, v9}, Lokhttp3/Headers;->value(I)Ljava/lang/String;
- move-result-object v11
- invoke-interface {v10, v11}, Lokio/BufferedSink;->writeUtf8(Ljava/lang/String;)Lokio/BufferedSink;
- move-result-object v10
- sget-object v11, Lokhttp3/MultipartBody;->CRLF:[B
- invoke-interface {v10, v11}, Lokio/BufferedSink;->write([B)Lokio/BufferedSink;
- add-int/lit8 v9, v9, 0x1
- goto :goto_2
- :cond_1
- invoke-virtual {v6}, Lokhttp3/RequestBody;->contentType()Lokhttp3/MediaType;
- move-result-object v7
- if-eqz v7, :cond_2
- const-string v8, "Content-Type: "
- invoke-interface {p1, v8}, Lokio/BufferedSink;->writeUtf8(Ljava/lang/String;)Lokio/BufferedSink;
- move-result-object v8
- invoke-virtual {v7}, Lokhttp3/MediaType;->toString()Ljava/lang/String;
- move-result-object v7
- invoke-interface {v8, v7}, Lokio/BufferedSink;->writeUtf8(Ljava/lang/String;)Lokio/BufferedSink;
- move-result-object v7
- sget-object v8, Lokhttp3/MultipartBody;->CRLF:[B
- invoke-interface {v7, v8}, Lokio/BufferedSink;->write([B)Lokio/BufferedSink;
- :cond_2
- invoke-virtual {v6}, Lokhttp3/RequestBody;->contentLength()J
- move-result-wide v7
- const-wide/16 v9, -0x1
- cmp-long v11, v7, v9
- if-eqz v11, :cond_3
- const-string v9, "Content-Length: "
- invoke-interface {p1, v9}, Lokio/BufferedSink;->writeUtf8(Ljava/lang/String;)Lokio/BufferedSink;
- move-result-object v9
- invoke-interface {v9, v7, v8}, Lokio/BufferedSink;->writeDecimalLong(J)Lokio/BufferedSink;
- move-result-object v9
- sget-object v10, Lokhttp3/MultipartBody;->CRLF:[B
- invoke-interface {v9, v10}, Lokio/BufferedSink;->write([B)Lokio/BufferedSink;
- goto :goto_3
- :cond_3
- if-eqz p2, :cond_4
- invoke-virtual {v0}, Lokio/Buffer;->clear()V
- return-wide v9
- :cond_4
- :goto_3
- sget-object v9, Lokhttp3/MultipartBody;->CRLF:[B
- invoke-interface {p1, v9}, Lokio/BufferedSink;->write([B)Lokio/BufferedSink;
- if-eqz p2, :cond_5
- add-long/2addr v4, v7
- goto :goto_4
- :cond_5
- invoke-virtual {v6, p1}, Lokhttp3/RequestBody;->writeTo(Lokio/BufferedSink;)V
- :goto_4
- sget-object v6, Lokhttp3/MultipartBody;->CRLF:[B
- invoke-interface {p1, v6}, Lokio/BufferedSink;->write([B)Lokio/BufferedSink;
- add-int/lit8 v3, v3, 0x1
- goto/16 :goto_1
- :cond_6
- sget-object v1, Lokhttp3/MultipartBody;->DASHDASH:[B
- invoke-interface {p1, v1}, Lokio/BufferedSink;->write([B)Lokio/BufferedSink;
- iget-object v1, p0, Lokhttp3/MultipartBody;->boundary:Lokio/ByteString;
- invoke-interface {p1, v1}, Lokio/BufferedSink;->write(Lokio/ByteString;)Lokio/BufferedSink;
- sget-object v1, Lokhttp3/MultipartBody;->DASHDASH:[B
- invoke-interface {p1, v1}, Lokio/BufferedSink;->write([B)Lokio/BufferedSink;
- sget-object v1, Lokhttp3/MultipartBody;->CRLF:[B
- invoke-interface {p1, v1}, Lokio/BufferedSink;->write([B)Lokio/BufferedSink;
- if-eqz p2, :cond_7
- invoke-virtual {v0}, Lokio/Buffer;->size()J
- move-result-wide p1
- add-long/2addr v4, p1
- invoke-virtual {v0}, Lokio/Buffer;->clear()V
- :cond_7
- return-wide v4
- .end method
- # virtual methods
- .method public boundary()Ljava/lang/String;
- .locals 1
- iget-object v0, p0, Lokhttp3/MultipartBody;->boundary:Lokio/ByteString;
- invoke-virtual {v0}, Lokio/ByteString;->utf8()Ljava/lang/String;
- move-result-object v0
- return-object v0
- .end method
- .method public contentLength()J
- .locals 5
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- iget-wide v0, p0, Lokhttp3/MultipartBody;->contentLength:J
- const-wide/16 v2, -0x1
- cmp-long v4, v0, v2
- if-eqz v4, :cond_0
- return-wide v0
- :cond_0
- const/4 v0, 0x0
- const/4 v1, 0x1
- invoke-direct {p0, v0, v1}, Lokhttp3/MultipartBody;->writeOrCountBytes(Lokio/BufferedSink;Z)J
- move-result-wide v0
- iput-wide v0, p0, Lokhttp3/MultipartBody;->contentLength:J
- return-wide v0
- .end method
- .method public contentType()Lokhttp3/MediaType;
- .locals 1
- iget-object v0, p0, Lokhttp3/MultipartBody;->contentType:Lokhttp3/MediaType;
- return-object v0
- .end method
- .method public part(I)Lokhttp3/MultipartBody$Part;
- .locals 1
- iget-object v0, p0, Lokhttp3/MultipartBody;->parts:Ljava/util/List;
- invoke-interface {v0, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;
- move-result-object p1
- check-cast p1, Lokhttp3/MultipartBody$Part;
- return-object p1
- .end method
- .method public parts()Ljava/util/List;
- .locals 1
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "()",
- "Ljava/util/List<",
- "Lokhttp3/MultipartBody$Part;",
- ">;"
- }
- .end annotation
- iget-object v0, p0, Lokhttp3/MultipartBody;->parts:Ljava/util/List;
- return-object v0
- .end method
- .method public size()I
- .locals 1
- iget-object v0, p0, Lokhttp3/MultipartBody;->parts:Ljava/util/List;
- invoke-interface {v0}, Ljava/util/List;->size()I
- move-result v0
- return v0
- .end method
- .method public type()Lokhttp3/MediaType;
- .locals 1
- iget-object v0, p0, Lokhttp3/MultipartBody;->originalType:Lokhttp3/MediaType;
- return-object v0
- .end method
- .method public writeTo(Lokio/BufferedSink;)V
- .locals 1
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- const/4 v0, 0x0
- invoke-direct {p0, p1, v0}, Lokhttp3/MultipartBody;->writeOrCountBytes(Lokio/BufferedSink;Z)J
- return-void
- .end method
|