123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276 |
- .class public final Lokhttp3/FormBody;
- .super Lokhttp3/RequestBody;
- .source ""
- # annotations
- .annotation system Ldalvik/annotation/MemberClasses;
- value = {
- Lokhttp3/FormBody$Builder;
- }
- .end annotation
- # static fields
- .field private static final CONTENT_TYPE:Lokhttp3/MediaType;
- # instance fields
- .field private final encodedNames:Ljava/util/List;
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "Ljava/util/List<",
- "Ljava/lang/String;",
- ">;"
- }
- .end annotation
- .end field
- .field private final encodedValues:Ljava/util/List;
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "Ljava/util/List<",
- "Ljava/lang/String;",
- ">;"
- }
- .end annotation
- .end field
- # direct methods
- .method static constructor <clinit>()V
- .locals 1
- const-string v0, "application/x-www-form-urlencoded"
- invoke-static {v0}, Lokhttp3/MediaType;->parse(Ljava/lang/String;)Lokhttp3/MediaType;
- move-result-object v0
- sput-object v0, Lokhttp3/FormBody;->CONTENT_TYPE:Lokhttp3/MediaType;
- return-void
- .end method
- .method constructor <init>(Ljava/util/List;Ljava/util/List;)V
- .locals 0
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "(",
- "Ljava/util/List<",
- "Ljava/lang/String;",
- ">;",
- "Ljava/util/List<",
- "Ljava/lang/String;",
- ">;)V"
- }
- .end annotation
- invoke-direct {p0}, Lokhttp3/RequestBody;-><init>()V
- invoke-static {p1}, Lokhttp3/internal/Util;->immutableList(Ljava/util/List;)Ljava/util/List;
- move-result-object p1
- iput-object p1, p0, Lokhttp3/FormBody;->encodedNames:Ljava/util/List;
- invoke-static {p2}, Lokhttp3/internal/Util;->immutableList(Ljava/util/List;)Ljava/util/List;
- move-result-object p1
- iput-object p1, p0, Lokhttp3/FormBody;->encodedValues:Ljava/util/List;
- return-void
- .end method
- .method private writeOrCountBytes(Lokio/BufferedSink;Z)J
- .locals 3
- if-eqz p2, :cond_0
- new-instance p1, Lokio/Buffer;
- invoke-direct {p1}, Lokio/Buffer;-><init>()V
- goto :goto_0
- :cond_0
- invoke-interface {p1}, Lokio/BufferedSink;->buffer()Lokio/Buffer;
- move-result-object p1
- :goto_0
- const/4 v0, 0x0
- iget-object v1, p0, Lokhttp3/FormBody;->encodedNames:Ljava/util/List;
- invoke-interface {v1}, Ljava/util/List;->size()I
- move-result v1
- :goto_1
- if-ge v0, v1, :cond_2
- if-lez v0, :cond_1
- const/16 v2, 0x26
- invoke-virtual {p1, v2}, Lokio/Buffer;->writeByte(I)Lokio/Buffer;
- :cond_1
- iget-object v2, p0, Lokhttp3/FormBody;->encodedNames:Ljava/util/List;
- invoke-interface {v2, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;
- move-result-object v2
- check-cast v2, Ljava/lang/String;
- invoke-virtual {p1, v2}, Lokio/Buffer;->writeUtf8(Ljava/lang/String;)Lokio/Buffer;
- const/16 v2, 0x3d
- invoke-virtual {p1, v2}, Lokio/Buffer;->writeByte(I)Lokio/Buffer;
- iget-object v2, p0, Lokhttp3/FormBody;->encodedValues:Ljava/util/List;
- invoke-interface {v2, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;
- move-result-object v2
- check-cast v2, Ljava/lang/String;
- invoke-virtual {p1, v2}, Lokio/Buffer;->writeUtf8(Ljava/lang/String;)Lokio/Buffer;
- add-int/lit8 v0, v0, 0x1
- goto :goto_1
- :cond_2
- if-eqz p2, :cond_3
- invoke-virtual {p1}, Lokio/Buffer;->size()J
- move-result-wide v0
- invoke-virtual {p1}, Lokio/Buffer;->clear()V
- goto :goto_2
- :cond_3
- const-wide/16 v0, 0x0
- :goto_2
- return-wide v0
- .end method
- # virtual methods
- .method public contentLength()J
- .locals 2
- const/4 v0, 0x0
- const/4 v1, 0x1
- invoke-direct {p0, v0, v1}, Lokhttp3/FormBody;->writeOrCountBytes(Lokio/BufferedSink;Z)J
- move-result-wide v0
- return-wide v0
- .end method
- .method public contentType()Lokhttp3/MediaType;
- .locals 1
- sget-object v0, Lokhttp3/FormBody;->CONTENT_TYPE:Lokhttp3/MediaType;
- return-object v0
- .end method
- .method public encodedName(I)Ljava/lang/String;
- .locals 1
- iget-object v0, p0, Lokhttp3/FormBody;->encodedNames:Ljava/util/List;
- invoke-interface {v0, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;
- move-result-object p1
- check-cast p1, Ljava/lang/String;
- return-object p1
- .end method
- .method public encodedValue(I)Ljava/lang/String;
- .locals 1
- iget-object v0, p0, Lokhttp3/FormBody;->encodedValues:Ljava/util/List;
- invoke-interface {v0, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;
- move-result-object p1
- check-cast p1, Ljava/lang/String;
- return-object p1
- .end method
- .method public name(I)Ljava/lang/String;
- .locals 1
- invoke-virtual {p0, p1}, Lokhttp3/FormBody;->encodedName(I)Ljava/lang/String;
- move-result-object p1
- const/4 v0, 0x1
- invoke-static {p1, v0}, Lokhttp3/HttpUrl;->percentDecode(Ljava/lang/String;Z)Ljava/lang/String;
- move-result-object p1
- return-object p1
- .end method
- .method public size()I
- .locals 1
- iget-object v0, p0, Lokhttp3/FormBody;->encodedNames:Ljava/util/List;
- invoke-interface {v0}, Ljava/util/List;->size()I
- move-result v0
- return v0
- .end method
- .method public value(I)Ljava/lang/String;
- .locals 1
- invoke-virtual {p0, p1}, Lokhttp3/FormBody;->encodedValue(I)Ljava/lang/String;
- move-result-object p1
- const/4 v0, 0x1
- invoke-static {p1, v0}, Lokhttp3/HttpUrl;->percentDecode(Ljava/lang/String;Z)Ljava/lang/String;
- move-result-object p1
- return-object p1
- .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/FormBody;->writeOrCountBytes(Lokio/BufferedSink;Z)J
- return-void
- .end method
|