224 lines
4.6 KiB
Smali
224 lines
4.6 KiB
Smali
.class public Lorg/apache/http/entity/BufferedHttpEntity;
|
|
.super Lorg/apache/http/entity/HttpEntityWrapper;
|
|
.source "BufferedHttpEntity.java"
|
|
|
|
|
|
# instance fields
|
|
.field private final buffer:[B
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Lorg/apache/http/HttpEntity;)V
|
|
.locals 4
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
.line 1
|
|
invoke-direct {p0, p1}, Lorg/apache/http/entity/HttpEntityWrapper;-><init>(Lorg/apache/http/HttpEntity;)V
|
|
|
|
.line 2
|
|
invoke-interface {p1}, Lorg/apache/http/HttpEntity;->isRepeatable()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
invoke-interface {p1}, Lorg/apache/http/HttpEntity;->getContentLength()J
|
|
|
|
move-result-wide v0
|
|
|
|
const-wide/16 v2, 0x0
|
|
|
|
cmp-long v0, v0, v2
|
|
|
|
if-gez v0, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 p1, 0x0
|
|
|
|
.line 3
|
|
iput-object p1, p0, Lorg/apache/http/entity/BufferedHttpEntity;->buffer:[B
|
|
|
|
goto :goto_1
|
|
|
|
.line 4
|
|
:cond_1
|
|
:goto_0
|
|
invoke-static {p1}, Lorg/apache/http/util/EntityUtils;->toByteArray(Lorg/apache/http/HttpEntity;)[B
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lorg/apache/http/entity/BufferedHttpEntity;->buffer:[B
|
|
|
|
:goto_1
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public getContent()Ljava/io/InputStream;
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lorg/apache/http/entity/BufferedHttpEntity;->buffer:[B
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 2
|
|
new-instance v0, Ljava/io/ByteArrayInputStream;
|
|
|
|
iget-object v1, p0, Lorg/apache/http/entity/BufferedHttpEntity;->buffer:[B
|
|
|
|
invoke-direct {v0, v1}, Ljava/io/ByteArrayInputStream;-><init>([B)V
|
|
|
|
return-object v0
|
|
|
|
.line 3
|
|
:cond_0
|
|
iget-object v0, p0, Lorg/apache/http/entity/HttpEntityWrapper;->wrappedEntity:Lorg/apache/http/HttpEntity;
|
|
|
|
invoke-interface {v0}, Lorg/apache/http/HttpEntity;->getContent()Ljava/io/InputStream;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public getContentLength()J
|
|
.locals 2
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lorg/apache/http/entity/BufferedHttpEntity;->buffer:[B
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 2
|
|
array-length v0, v0
|
|
|
|
int-to-long v0, v0
|
|
|
|
return-wide v0
|
|
|
|
.line 3
|
|
:cond_0
|
|
iget-object v0, p0, Lorg/apache/http/entity/HttpEntityWrapper;->wrappedEntity:Lorg/apache/http/HttpEntity;
|
|
|
|
invoke-interface {v0}, Lorg/apache/http/HttpEntity;->getContentLength()J
|
|
|
|
move-result-wide v0
|
|
|
|
return-wide v0
|
|
.end method
|
|
|
|
.method public isChunked()Z
|
|
.locals 1
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lorg/apache/http/entity/BufferedHttpEntity;->buffer:[B
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
iget-object v0, p0, Lorg/apache/http/entity/HttpEntityWrapper;->wrappedEntity:Lorg/apache/http/HttpEntity;
|
|
|
|
invoke-interface {v0}, Lorg/apache/http/HttpEntity;->isChunked()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
const/4 v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
return v0
|
|
.end method
|
|
|
|
.method public isRepeatable()Z
|
|
.locals 1
|
|
|
|
const/4 v0, 0x1
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public isStreaming()Z
|
|
.locals 1
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lorg/apache/http/entity/BufferedHttpEntity;->buffer:[B
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
iget-object v0, p0, Lorg/apache/http/entity/HttpEntityWrapper;->wrappedEntity:Lorg/apache/http/HttpEntity;
|
|
|
|
invoke-interface {v0}, Lorg/apache/http/HttpEntity;->isStreaming()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
const/4 v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
return v0
|
|
.end method
|
|
|
|
.method public writeTo(Ljava/io/OutputStream;)V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lorg/apache/http/entity/BufferedHttpEntity;->buffer:[B
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 2
|
|
invoke-virtual {p1, v0}, Ljava/io/OutputStream;->write([B)V
|
|
|
|
goto :goto_0
|
|
|
|
.line 3
|
|
:cond_0
|
|
iget-object v0, p0, Lorg/apache/http/entity/HttpEntityWrapper;->wrappedEntity:Lorg/apache/http/HttpEntity;
|
|
|
|
invoke-interface {v0, p1}, Lorg/apache/http/HttpEntity;->writeTo(Ljava/io/OutputStream;)V
|
|
|
|
:goto_0
|
|
return-void
|
|
|
|
.line 4
|
|
:cond_1
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string v0, "Output stream may not be null"
|
|
|
|
invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|