ResponseBody$BomAwareReader.smali
3.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
.class final Lcom/brplug/okhttp3/ResponseBody$BomAwareReader;
.super Ljava/io/Reader;
.source "ResponseBody.java"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/brplug/okhttp3/ResponseBody;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x18
name = "BomAwareReader"
.end annotation
# instance fields
.field private final charset:Ljava/nio/charset/Charset;
.field private closed:Z
.field private delegate:Ljava/io/Reader;
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
.end field
.field private final source:Lcom/brplug/okio/BufferedSource;
# direct methods
.method constructor <init>(Lcom/brplug/okio/BufferedSource;Ljava/nio/charset/Charset;)V
.locals 0
.line 250
invoke-direct {p0}, Ljava/io/Reader;-><init>()V
.line 251
iput-object p1, p0, Lcom/brplug/okhttp3/ResponseBody$BomAwareReader;->source:Lcom/brplug/okio/BufferedSource;
.line 252
iput-object p2, p0, Lcom/brplug/okhttp3/ResponseBody$BomAwareReader;->charset:Ljava/nio/charset/Charset;
return-void
.end method
# virtual methods
.method public close()V
.locals 1
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
const/4 v0, 0x1
.line 267
iput-boolean v0, p0, Lcom/brplug/okhttp3/ResponseBody$BomAwareReader;->closed:Z
.line 268
iget-object v0, p0, Lcom/brplug/okhttp3/ResponseBody$BomAwareReader;->delegate:Ljava/io/Reader;
if-eqz v0, :cond_0
.line 269
invoke-virtual {v0}, Ljava/io/Reader;->close()V
goto :goto_0
.line 271
:cond_0
iget-object v0, p0, Lcom/brplug/okhttp3/ResponseBody$BomAwareReader;->source:Lcom/brplug/okio/BufferedSource;
invoke-interface {v0}, Lcom/brplug/okio/BufferedSource;->close()V
:goto_0
return-void
.end method
.method public read([CII)I
.locals 3
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 256
iget-boolean v0, p0, Lcom/brplug/okhttp3/ResponseBody$BomAwareReader;->closed:Z
if-nez v0, :cond_1
.line 258
iget-object v0, p0, Lcom/brplug/okhttp3/ResponseBody$BomAwareReader;->delegate:Ljava/io/Reader;
if-nez v0, :cond_0
.line 260
iget-object v0, p0, Lcom/brplug/okhttp3/ResponseBody$BomAwareReader;->source:Lcom/brplug/okio/BufferedSource;
iget-object v1, p0, Lcom/brplug/okhttp3/ResponseBody$BomAwareReader;->charset:Ljava/nio/charset/Charset;
invoke-static {v0, v1}, Lcom/brplug/okhttp3/internal/Util;->bomAwareCharset(Lcom/brplug/okio/BufferedSource;Ljava/nio/charset/Charset;)Ljava/nio/charset/Charset;
move-result-object v0
.line 261
new-instance v1, Ljava/io/InputStreamReader;
iget-object v2, p0, Lcom/brplug/okhttp3/ResponseBody$BomAwareReader;->source:Lcom/brplug/okio/BufferedSource;
invoke-interface {v2}, Lcom/brplug/okio/BufferedSource;->inputStream()Ljava/io/InputStream;
move-result-object v2
invoke-direct {v1, v2, v0}, Ljava/io/InputStreamReader;-><init>(Ljava/io/InputStream;Ljava/nio/charset/Charset;)V
iput-object v1, p0, Lcom/brplug/okhttp3/ResponseBody$BomAwareReader;->delegate:Ljava/io/Reader;
move-object v0, v1
.line 263
:cond_0
invoke-virtual {v0, p1, p2, p3}, Ljava/io/Reader;->read([CII)I
move-result p1
return p1
.line 256
:cond_1
new-instance p1, Ljava/io/IOException;
const-string p2, "Stream closed"
invoke-direct {p1, p2}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
throw p1
.end method