HttpConnection$UnknownLengthSource.smali
.class Lcom/squareup/okhttp/internal/http/HttpConnection$UnknownLengthSource;
.super Lcom/squareup/okhttp/internal/http/HttpConnection$AbstractSource;
.source "HttpConnection.java"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/squareup/okhttp/internal/http/HttpConnection;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x2
name = "UnknownLengthSource"
.end annotation
# instance fields
.field private inputExhausted:Z
.field final synthetic this$0:Lcom/squareup/okhttp/internal/http/HttpConnection;
# direct methods
.method private constructor <init>(Lcom/squareup/okhttp/internal/http/HttpConnection;)V
.registers 3
.line 1
iput-object p1, p0, Lcom/squareup/okhttp/internal/http/HttpConnection$UnknownLengthSource;->this$0:Lcom/squareup/okhttp/internal/http/HttpConnection;
const/4 v0, 0x0
invoke-direct {p0, p1, v0}, Lcom/squareup/okhttp/internal/http/HttpConnection$AbstractSource;-><init>(Lcom/squareup/okhttp/internal/http/HttpConnection;Lcom/squareup/okhttp/internal/http/HttpConnection$1;)V
return-void
.end method
.method synthetic constructor <init>(Lcom/squareup/okhttp/internal/http/HttpConnection;Lcom/squareup/okhttp/internal/http/HttpConnection$1;)V
.registers 3
.line 2
invoke-direct {p0, p1}, Lcom/squareup/okhttp/internal/http/HttpConnection$UnknownLengthSource;-><init>(Lcom/squareup/okhttp/internal/http/HttpConnection;)V
return-void
.end method
# virtual methods
.method public close()V
.registers 2
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 1
iget-boolean v0, p0, Lcom/squareup/okhttp/internal/http/HttpConnection$AbstractSource;->closed:Z
if-eqz v0, :cond_5
return-void
.line 2
:cond_5
iget-boolean v0, p0, Lcom/squareup/okhttp/internal/http/HttpConnection$UnknownLengthSource;->inputExhausted:Z
if-nez v0, :cond_c
.line 3
invoke-virtual {p0}, Lcom/squareup/okhttp/internal/http/HttpConnection$AbstractSource;->unexpectedEndOfInput()V
:cond_c
const/4 v0, 0x1
.line 4
iput-boolean v0, p0, Lcom/squareup/okhttp/internal/http/HttpConnection$AbstractSource;->closed:Z
return-void
.end method
.method public read(Lokio/Buffer;J)J
.registers 7
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
const-wide/16 v0, 0x0
cmp-long v2, p2, v0
if-ltz v2, :cond_30
.line 1
iget-boolean v0, p0, Lcom/squareup/okhttp/internal/http/HttpConnection$AbstractSource;->closed:Z
if-nez v0, :cond_28
.line 2
iget-boolean v0, p0, Lcom/squareup/okhttp/internal/http/HttpConnection$UnknownLengthSource;->inputExhausted:Z
const-wide/16 v1, -0x1
if-eqz v0, :cond_11
return-wide v1
.line 3
:cond_11
iget-object v0, p0, Lcom/squareup/okhttp/internal/http/HttpConnection$UnknownLengthSource;->this$0:Lcom/squareup/okhttp/internal/http/HttpConnection;
# getter for: Lcom/squareup/okhttp/internal/http/HttpConnection;->source:Lokio/BufferedSource;
invoke-static {v0}, Lcom/squareup/okhttp/internal/http/HttpConnection;->access$600(Lcom/squareup/okhttp/internal/http/HttpConnection;)Lokio/BufferedSource;
move-result-object v0
invoke-interface {v0, p1, p2, p3}, Lokio/Source;->read(Lokio/Buffer;J)J
move-result-wide p1
cmp-long p3, p1, v1
if-nez p3, :cond_27
const/4 p1, 0x1
.line 4
iput-boolean p1, p0, Lcom/squareup/okhttp/internal/http/HttpConnection$UnknownLengthSource;->inputExhausted:Z
const/4 p1, 0x0
.line 5
invoke-virtual {p0, p1}, Lcom/squareup/okhttp/internal/http/HttpConnection$AbstractSource;->endOfInput(Z)V
return-wide v1
:cond_27
return-wide p1
.line 6
:cond_28
new-instance p1, Ljava/lang/IllegalStateException;
const-string p2, "closed"
invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p1
.line 7
:cond_30
new-instance p1, Ljava/lang/IllegalArgumentException;
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
const-string v1, "byteCount < 0: "
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0, p2, p3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p2
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p1
.end method