tmap/smali_classes5/org/apache/http/entity/BasicHttpEntity.smali
2022-06-10 21:38:30 +09:00

209 lines
4.1 KiB
Smali

.class public Lorg/apache/http/entity/BasicHttpEntity;
.super Lorg/apache/http/entity/AbstractHttpEntity;
.source "BasicHttpEntity.java"
# instance fields
.field private content:Ljava/io/InputStream;
.field private contentObtained:Z
.field private length:J
# direct methods
.method public constructor <init>()V
.locals 2
.line 1
invoke-direct {p0}, Lorg/apache/http/entity/AbstractHttpEntity;-><init>()V
const-wide/16 v0, -0x1
.line 2
iput-wide v0, p0, Lorg/apache/http/entity/BasicHttpEntity;->length:J
return-void
.end method
# virtual methods
.method public consumeContent()V
.locals 1
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 1
iget-object v0, p0, Lorg/apache/http/entity/BasicHttpEntity;->content:Ljava/io/InputStream;
if-eqz v0, :cond_0
.line 2
invoke-virtual {v0}, Ljava/io/InputStream;->close()V
:cond_0
return-void
.end method
.method public getContent()Ljava/io/InputStream;
.locals 2
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/lang/IllegalStateException;
}
.end annotation
.line 1
iget-object v0, p0, Lorg/apache/http/entity/BasicHttpEntity;->content:Ljava/io/InputStream;
if-eqz v0, :cond_1
.line 2
iget-boolean v1, p0, Lorg/apache/http/entity/BasicHttpEntity;->contentObtained:Z
if-nez v1, :cond_0
const/4 v1, 0x1
.line 3
iput-boolean v1, p0, Lorg/apache/http/entity/BasicHttpEntity;->contentObtained:Z
return-object v0
.line 4
:cond_0
new-instance v0, Ljava/lang/IllegalStateException;
const-string v1, "Content has been consumed"
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw v0
.line 5
:cond_1
new-instance v0, Ljava/lang/IllegalStateException;
const-string v1, "Content has not been provided"
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw v0
.end method
.method public getContentLength()J
.locals 2
.line 1
iget-wide v0, p0, Lorg/apache/http/entity/BasicHttpEntity;->length:J
return-wide v0
.end method
.method public isRepeatable()Z
.locals 1
const/4 v0, 0x0
return v0
.end method
.method public isStreaming()Z
.locals 1
.line 1
iget-boolean v0, p0, Lorg/apache/http/entity/BasicHttpEntity;->contentObtained:Z
if-nez v0, :cond_0
iget-object v0, p0, Lorg/apache/http/entity/BasicHttpEntity;->content:Ljava/io/InputStream;
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 setContent(Ljava/io/InputStream;)V
.locals 0
.line 1
iput-object p1, p0, Lorg/apache/http/entity/BasicHttpEntity;->content:Ljava/io/InputStream;
const/4 p1, 0x0
.line 2
iput-boolean p1, p0, Lorg/apache/http/entity/BasicHttpEntity;->contentObtained:Z
return-void
.end method
.method public setContentLength(J)V
.locals 0
.line 1
iput-wide p1, p0, Lorg/apache/http/entity/BasicHttpEntity;->length:J
return-void
.end method
.method public writeTo(Ljava/io/OutputStream;)V
.locals 4
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
if-eqz p1, :cond_1
.line 1
invoke-virtual {p0}, Lorg/apache/http/entity/BasicHttpEntity;->getContent()Ljava/io/InputStream;
move-result-object v0
const/16 v1, 0x800
new-array v1, v1, [B
.line 2
:goto_0
invoke-virtual {v0, v1}, Ljava/io/InputStream;->read([B)I
move-result v2
const/4 v3, -0x1
if-eq v2, v3, :cond_0
const/4 v3, 0x0
.line 3
invoke-virtual {p1, v1, v3, v2}, Ljava/io/OutputStream;->write([BII)V
goto :goto_0
:cond_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