128 lines
2.5 KiB
Smali
128 lines
2.5 KiB
Smali
.class public Lorg/apache/http/entity/ByteArrayEntity;
|
|
.super Lorg/apache/http/entity/AbstractHttpEntity;
|
|
.source "ByteArrayEntity.java"
|
|
|
|
# interfaces
|
|
.implements Ljava/lang/Cloneable;
|
|
|
|
|
|
# instance fields
|
|
.field public final content:[B
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>([B)V
|
|
.locals 1
|
|
|
|
.line 1
|
|
invoke-direct {p0}, Lorg/apache/http/entity/AbstractHttpEntity;-><init>()V
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
.line 2
|
|
iput-object p1, p0, Lorg/apache/http/entity/ByteArrayEntity;->content:[B
|
|
|
|
return-void
|
|
|
|
.line 3
|
|
:cond_0
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string v0, "Source byte array may not be null"
|
|
|
|
invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public clone()Ljava/lang/Object;
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/lang/CloneNotSupportedException;
|
|
}
|
|
.end annotation
|
|
|
|
.line 1
|
|
invoke-super {p0}, Ljava/lang/Object;->clone()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public getContent()Ljava/io/InputStream;
|
|
.locals 2
|
|
|
|
.line 1
|
|
new-instance v0, Ljava/io/ByteArrayInputStream;
|
|
|
|
iget-object v1, p0, Lorg/apache/http/entity/ByteArrayEntity;->content:[B
|
|
|
|
invoke-direct {v0, v1}, Ljava/io/ByteArrayInputStream;-><init>([B)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public getContentLength()J
|
|
.locals 2
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lorg/apache/http/entity/ByteArrayEntity;->content:[B
|
|
|
|
array-length v0, v0
|
|
|
|
int-to-long v0, v0
|
|
|
|
return-wide v0
|
|
.end method
|
|
|
|
.method public isRepeatable()Z
|
|
.locals 1
|
|
|
|
const/4 v0, 0x1
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public isStreaming()Z
|
|
.locals 1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
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_0
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lorg/apache/http/entity/ByteArrayEntity;->content:[B
|
|
|
|
invoke-virtual {p1, v0}, Ljava/io/OutputStream;->write([B)V
|
|
|
|
.line 2
|
|
invoke-virtual {p1}, Ljava/io/OutputStream;->flush()V
|
|
|
|
return-void
|
|
|
|
.line 3
|
|
:cond_0
|
|
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
|