155 lines
3.6 KiB
Smali
155 lines
3.6 KiB
Smali
.class final Lokhttp3/internal/huc/BufferedRequestBody;
|
|
.super Lokhttp3/internal/huc/OutputStreamRequestBody;
|
|
.source "BufferedRequestBody.java"
|
|
|
|
|
|
# instance fields
|
|
.field final a:Lokio/Buffer;
|
|
|
|
.field b:J
|
|
|
|
|
|
# direct methods
|
|
.method constructor <init>(J)V
|
|
.locals 2
|
|
|
|
.line 35
|
|
invoke-direct {p0}, Lokhttp3/internal/huc/OutputStreamRequestBody;-><init>()V
|
|
|
|
.line 32
|
|
new-instance v0, Lokio/Buffer;
|
|
|
|
invoke-direct {v0}, Lokio/Buffer;-><init>()V
|
|
|
|
iput-object v0, p0, Lokhttp3/internal/huc/BufferedRequestBody;->a:Lokio/Buffer;
|
|
|
|
const-wide/16 v0, -0x1
|
|
|
|
.line 33
|
|
iput-wide v0, p0, Lokhttp3/internal/huc/BufferedRequestBody;->b:J
|
|
|
|
.line 36
|
|
iget-object v0, p0, Lokhttp3/internal/huc/BufferedRequestBody;->a:Lokio/Buffer;
|
|
|
|
invoke-virtual {p0, v0, p1, p2}, Lokhttp3/internal/huc/BufferedRequestBody;->a(Lokio/BufferedSink;J)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public a(Lokhttp3/Request;)Lokhttp3/Request;
|
|
.locals 3
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
const-string v0, "Content-Length"
|
|
|
|
.line 49
|
|
invoke-virtual {p1, v0}, Lokhttp3/Request;->a(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
return-object p1
|
|
|
|
.line 51
|
|
:cond_0
|
|
invoke-virtual {p0}, Lokhttp3/internal/huc/BufferedRequestBody;->c()Ljava/io/OutputStream;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Ljava/io/OutputStream;->close()V
|
|
|
|
.line 52
|
|
iget-object v0, p0, Lokhttp3/internal/huc/BufferedRequestBody;->a:Lokio/Buffer;
|
|
|
|
invoke-virtual {v0}, Lokio/Buffer;->size()J
|
|
|
|
move-result-wide v0
|
|
|
|
iput-wide v0, p0, Lokhttp3/internal/huc/BufferedRequestBody;->b:J
|
|
|
|
.line 53
|
|
invoke-virtual {p1}, Lokhttp3/Request;->e()Lokhttp3/Request$Builder;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v0, "Transfer-Encoding"
|
|
|
|
.line 54
|
|
invoke-virtual {p1, v0}, Lokhttp3/Request$Builder;->b(Ljava/lang/String;)Lokhttp3/Request$Builder;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v0, "Content-Length"
|
|
|
|
iget-object v1, p0, Lokhttp3/internal/huc/BufferedRequestBody;->a:Lokio/Buffer;
|
|
|
|
.line 55
|
|
invoke-virtual {v1}, Lokio/Buffer;->size()J
|
|
|
|
move-result-wide v1
|
|
|
|
invoke-static {v1, v2}, Ljava/lang/Long;->toString(J)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {p1, v0, v1}, Lokhttp3/Request$Builder;->a(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Request$Builder;
|
|
|
|
move-result-object p1
|
|
|
|
.line 56
|
|
invoke-virtual {p1}, Lokhttp3/Request$Builder;->b()Lokhttp3/Request;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public a(Lokio/BufferedSink;)V
|
|
.locals 6
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
.line 60
|
|
iget-object v0, p0, Lokhttp3/internal/huc/BufferedRequestBody;->a:Lokio/Buffer;
|
|
|
|
invoke-interface {p1}, Lokio/BufferedSink;->buffer()Lokio/Buffer;
|
|
|
|
move-result-object v1
|
|
|
|
iget-object p1, p0, Lokhttp3/internal/huc/BufferedRequestBody;->a:Lokio/Buffer;
|
|
|
|
invoke-virtual {p1}, Lokio/Buffer;->size()J
|
|
|
|
move-result-wide v4
|
|
|
|
const-wide/16 v2, 0x0
|
|
|
|
invoke-virtual/range {v0 .. v5}, Lokio/Buffer;->copyTo(Lokio/Buffer;JJ)Lokio/Buffer;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public b()J
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
.line 40
|
|
iget-wide v0, p0, Lokhttp3/internal/huc/BufferedRequestBody;->b:J
|
|
|
|
return-wide v0
|
|
.end method
|