.class public Lorg/apache/http/impl/entity/EntityDeserializer; .super Ljava/lang/Object; .source "EntityDeserializer.java" # annotations .annotation runtime Ljava/lang/Deprecated; .end annotation # instance fields .field private final lenStrategy:Lorg/apache/http/entity/ContentLengthStrategy; # direct methods .method public constructor (Lorg/apache/http/entity/ContentLengthStrategy;)V .registers 3 .line 72 invoke-direct {p0}, Ljava/lang/Object;->()V .line 73 const-string v0, "Content length strategy" invoke-static {p1, v0}, Lorg/apache/http/util/Args;->notNull(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object; move-result-object p1 check-cast p1, Lorg/apache/http/entity/ContentLengthStrategy; iput-object p1, p0, Lorg/apache/http/impl/entity/EntityDeserializer;->lenStrategy:Lorg/apache/http/entity/ContentLengthStrategy; return-void .end method # virtual methods .method public deserialize(Lorg/apache/http/io/SessionInputBuffer;Lorg/apache/http/HttpMessage;)Lorg/apache/http/HttpEntity; .registers 4 .annotation system Ldalvik/annotation/Throws; value = { Lorg/apache/http/HttpException;, Ljava/io/IOException; } .end annotation .line 139 const-string v0, "Session input buffer" invoke-static {p1, v0}, Lorg/apache/http/util/Args;->notNull(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object; .line 140 const-string v0, "HTTP message" invoke-static {p2, v0}, Lorg/apache/http/util/Args;->notNull(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object; .line 141 invoke-virtual {p0, p1, p2}, Lorg/apache/http/impl/entity/EntityDeserializer;->doDeserialize(Lorg/apache/http/io/SessionInputBuffer;Lorg/apache/http/HttpMessage;)Lorg/apache/http/entity/BasicHttpEntity; move-result-object p1 return-object p1 .end method .method protected doDeserialize(Lorg/apache/http/io/SessionInputBuffer;Lorg/apache/http/HttpMessage;)Lorg/apache/http/entity/BasicHttpEntity; .registers 10 .annotation system Ldalvik/annotation/Throws; value = { Lorg/apache/http/HttpException;, Ljava/io/IOException; } .end annotation .line 94 new-instance v0, Lorg/apache/http/entity/BasicHttpEntity; invoke-direct {v0}, Lorg/apache/http/entity/BasicHttpEntity;->()V .line 96 iget-object v1, p0, Lorg/apache/http/impl/entity/EntityDeserializer;->lenStrategy:Lorg/apache/http/entity/ContentLengthStrategy; invoke-interface {v1, p2}, Lorg/apache/http/entity/ContentLengthStrategy;->determineLength(Lorg/apache/http/HttpMessage;)J move-result-wide v1 const-wide/16 v3, -0x2 cmp-long v3, v1, v3 const-wide/16 v4, -0x1 if-nez v3, :cond_23 const/4 v1, 0x1 .line 98 invoke-virtual {v0, v1}, Lorg/apache/http/entity/BasicHttpEntity;->setChunked(Z)V .line 99 invoke-virtual {v0, v4, v5}, Lorg/apache/http/entity/BasicHttpEntity;->setContentLength(J)V .line 100 new-instance v1, Lorg/apache/http/impl/io/ChunkedInputStream; invoke-direct {v1, p1}, Lorg/apache/http/impl/io/ChunkedInputStream;->(Lorg/apache/http/io/SessionInputBuffer;)V invoke-virtual {v0, v1}, Lorg/apache/http/entity/BasicHttpEntity;->setContent(Ljava/io/InputStream;)V goto :goto_45 :cond_23 cmp-long v3, v1, v4 const/4 v6, 0x0 if-nez v3, :cond_37 .line 102 invoke-virtual {v0, v6}, Lorg/apache/http/entity/BasicHttpEntity;->setChunked(Z)V .line 103 invoke-virtual {v0, v4, v5}, Lorg/apache/http/entity/BasicHttpEntity;->setContentLength(J)V .line 104 new-instance v1, Lorg/apache/http/impl/io/IdentityInputStream; invoke-direct {v1, p1}, Lorg/apache/http/impl/io/IdentityInputStream;->(Lorg/apache/http/io/SessionInputBuffer;)V invoke-virtual {v0, v1}, Lorg/apache/http/entity/BasicHttpEntity;->setContent(Ljava/io/InputStream;)V goto :goto_45 .line 106 :cond_37 invoke-virtual {v0, v6}, Lorg/apache/http/entity/BasicHttpEntity;->setChunked(Z)V .line 107 invoke-virtual {v0, v1, v2}, Lorg/apache/http/entity/BasicHttpEntity;->setContentLength(J)V .line 108 new-instance v3, Lorg/apache/http/impl/io/ContentLengthInputStream; invoke-direct {v3, p1, v1, v2}, Lorg/apache/http/impl/io/ContentLengthInputStream;->(Lorg/apache/http/io/SessionInputBuffer;J)V invoke-virtual {v0, v3}, Lorg/apache/http/entity/BasicHttpEntity;->setContent(Ljava/io/InputStream;)V .line 111 :goto_45 const-string p1, "Content-Type" invoke-interface {p2, p1}, Lorg/apache/http/HttpMessage;->getFirstHeader(Ljava/lang/String;)Lorg/apache/http/Header; move-result-object p1 if-eqz p1, :cond_50 .line 113 invoke-virtual {v0, p1}, Lorg/apache/http/entity/BasicHttpEntity;->setContentType(Lorg/apache/http/Header;)V .line 115 :cond_50 const-string p1, "Content-Encoding" invoke-interface {p2, p1}, Lorg/apache/http/HttpMessage;->getFirstHeader(Ljava/lang/String;)Lorg/apache/http/Header; move-result-object p1 if-eqz p1, :cond_5b .line 117 invoke-virtual {v0, p1}, Lorg/apache/http/entity/BasicHttpEntity;->setContentEncoding(Lorg/apache/http/Header;)V :cond_5b return-object v0 .end method