474 lines
10 KiB
Smali
474 lines
10 KiB
Smali
.class public Lorg/apache/http/impl/conn/Wire;
|
|
.super Ljava/lang/Object;
|
|
.source "Wire.java"
|
|
|
|
|
|
# annotations
|
|
.annotation build Lorg/apache/http/annotation/Immutable;
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field private final log:Lorg/apache/commons/logging/Log;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Lorg/apache/commons/logging/Log;)V
|
|
.locals 0
|
|
|
|
.line 1
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
.line 2
|
|
iput-object p1, p0, Lorg/apache/http/impl/conn/Wire;->log:Lorg/apache/commons/logging/Log;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private wire(Ljava/lang/String;Ljava/io/InputStream;)V
|
|
.locals 4
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
.line 1
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
.line 2
|
|
:goto_0
|
|
invoke-virtual {p2}, Ljava/io/InputStream;->read()I
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, -0x1
|
|
|
|
const/4 v3, 0x0
|
|
|
|
if-eq v1, v2, :cond_4
|
|
|
|
const/16 v2, 0xd
|
|
|
|
if-ne v1, v2, :cond_0
|
|
|
|
const-string v1, "[\\r]"
|
|
|
|
.line 3
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/16 v2, 0xa
|
|
|
|
if-ne v1, v2, :cond_1
|
|
|
|
const-string v1, "[\\n]\""
|
|
|
|
.line 4
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v1, "\""
|
|
|
|
.line 5
|
|
invoke-virtual {v0, v3, v1}, Ljava/lang/StringBuilder;->insert(ILjava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
.line 6
|
|
invoke-virtual {v0, v3, p1}, Ljava/lang/StringBuilder;->insert(ILjava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
.line 7
|
|
iget-object v1, p0, Lorg/apache/http/impl/conn/Wire;->log:Lorg/apache/commons/logging/Log;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-interface {v1, v2}, Lorg/apache/commons/logging/Log;->debug(Ljava/lang/Object;)V
|
|
|
|
.line 8
|
|
invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->setLength(I)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
const/16 v2, 0x20
|
|
|
|
if-lt v1, v2, :cond_3
|
|
|
|
const/16 v2, 0x7f
|
|
|
|
if-le v1, v2, :cond_2
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
int-to-char v1, v1
|
|
|
|
.line 9
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_3
|
|
:goto_1
|
|
const-string v2, "[0x"
|
|
|
|
.line 10
|
|
invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
.line 11
|
|
invoke-static {v1}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v1, "]"
|
|
|
|
.line 12
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
goto :goto_0
|
|
|
|
.line 13
|
|
:cond_4
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->length()I
|
|
|
|
move-result p2
|
|
|
|
if-lez p2, :cond_5
|
|
|
|
const/16 p2, 0x22
|
|
|
|
.line 14
|
|
invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
|
|
|
|
.line 15
|
|
invoke-virtual {v0, v3, p2}, Ljava/lang/StringBuilder;->insert(IC)Ljava/lang/StringBuilder;
|
|
|
|
.line 16
|
|
invoke-virtual {v0, v3, p1}, Ljava/lang/StringBuilder;->insert(ILjava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
.line 17
|
|
iget-object p1, p0, Lorg/apache/http/impl/conn/Wire;->log:Lorg/apache/commons/logging/Log;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-interface {p1, p2}, Lorg/apache/commons/logging/Log;->debug(Ljava/lang/Object;)V
|
|
|
|
:cond_5
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public enabled()Z
|
|
.locals 1
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lorg/apache/http/impl/conn/Wire;->log:Lorg/apache/commons/logging/Log;
|
|
|
|
invoke-interface {v0}, Lorg/apache/commons/logging/Log;->isDebugEnabled()Z
|
|
|
|
move-result v0
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public input(I)V
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
const/4 v0, 0x1
|
|
|
|
new-array v0, v0, [B
|
|
|
|
int-to-byte p1, p1
|
|
|
|
const/4 v1, 0x0
|
|
|
|
aput-byte p1, v0, v1
|
|
|
|
.line 7
|
|
invoke-virtual {p0, v0}, Lorg/apache/http/impl/conn/Wire;->input([B)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public input(Ljava/io/InputStream;)V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
const-string v0, "<< "
|
|
|
|
.line 1
|
|
invoke-direct {p0, v0, p1}, Lorg/apache/http/impl/conn/Wire;->wire(Ljava/lang/String;Ljava/io/InputStream;)V
|
|
|
|
return-void
|
|
|
|
.line 2
|
|
:cond_0
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string v0, "Input may not be null"
|
|
|
|
invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public input(Ljava/lang/String;)V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
.line 8
|
|
invoke-virtual {p1}, Ljava/lang/String;->getBytes()[B
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p0, p1}, Lorg/apache/http/impl/conn/Wire;->input([B)V
|
|
|
|
return-void
|
|
|
|
.line 9
|
|
:cond_0
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string v0, "Input may not be null"
|
|
|
|
invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public input([B)V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
.line 5
|
|
new-instance v0, Ljava/io/ByteArrayInputStream;
|
|
|
|
invoke-direct {v0, p1}, Ljava/io/ByteArrayInputStream;-><init>([B)V
|
|
|
|
const-string p1, "<< "
|
|
|
|
invoke-direct {p0, p1, v0}, Lorg/apache/http/impl/conn/Wire;->wire(Ljava/lang/String;Ljava/io/InputStream;)V
|
|
|
|
return-void
|
|
|
|
.line 6
|
|
:cond_0
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string v0, "Input may not be null"
|
|
|
|
invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public input([BII)V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
.line 3
|
|
new-instance v0, Ljava/io/ByteArrayInputStream;
|
|
|
|
invoke-direct {v0, p1, p2, p3}, Ljava/io/ByteArrayInputStream;-><init>([BII)V
|
|
|
|
const-string p1, "<< "
|
|
|
|
invoke-direct {p0, p1, v0}, Lorg/apache/http/impl/conn/Wire;->wire(Ljava/lang/String;Ljava/io/InputStream;)V
|
|
|
|
return-void
|
|
|
|
.line 4
|
|
:cond_0
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string p2, "Input may not be null"
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public output(I)V
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
const/4 v0, 0x1
|
|
|
|
new-array v0, v0, [B
|
|
|
|
int-to-byte p1, p1
|
|
|
|
const/4 v1, 0x0
|
|
|
|
aput-byte p1, v0, v1
|
|
|
|
.line 7
|
|
invoke-virtual {p0, v0}, Lorg/apache/http/impl/conn/Wire;->output([B)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public output(Ljava/io/InputStream;)V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
const-string v0, ">> "
|
|
|
|
.line 1
|
|
invoke-direct {p0, v0, p1}, Lorg/apache/http/impl/conn/Wire;->wire(Ljava/lang/String;Ljava/io/InputStream;)V
|
|
|
|
return-void
|
|
|
|
.line 2
|
|
:cond_0
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string v0, "Output may not be null"
|
|
|
|
invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public output(Ljava/lang/String;)V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
.line 8
|
|
invoke-virtual {p1}, Ljava/lang/String;->getBytes()[B
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p0, p1}, Lorg/apache/http/impl/conn/Wire;->output([B)V
|
|
|
|
return-void
|
|
|
|
.line 9
|
|
:cond_0
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string v0, "Output may not be null"
|
|
|
|
invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public output([B)V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
.line 5
|
|
new-instance v0, Ljava/io/ByteArrayInputStream;
|
|
|
|
invoke-direct {v0, p1}, Ljava/io/ByteArrayInputStream;-><init>([B)V
|
|
|
|
const-string p1, ">> "
|
|
|
|
invoke-direct {p0, p1, v0}, Lorg/apache/http/impl/conn/Wire;->wire(Ljava/lang/String;Ljava/io/InputStream;)V
|
|
|
|
return-void
|
|
|
|
.line 6
|
|
:cond_0
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string v0, "Output may not be null"
|
|
|
|
invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public output([BII)V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
.line 3
|
|
new-instance v0, Ljava/io/ByteArrayInputStream;
|
|
|
|
invoke-direct {v0, p1, p2, p3}, Ljava/io/ByteArrayInputStream;-><init>([BII)V
|
|
|
|
const-string p1, ">> "
|
|
|
|
invoke-direct {p0, p1, v0}, Lorg/apache/http/impl/conn/Wire;->wire(Ljava/lang/String;Ljava/io/InputStream;)V
|
|
|
|
return-void
|
|
|
|
.line 4
|
|
:cond_0
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string p2, "Output may not be null"
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|