InflaterSource.java
2.87 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
package okio;
import java.io.EOFException;
import java.io.IOException;
import java.util.zip.DataFormatException;
import java.util.zip.Inflater;
import tx;
import ty;
public final class InflaterSource
implements Source
{
private final BufferedSource a;
private final Inflater b;
private int c;
private boolean d;
InflaterSource(BufferedSource paramBufferedSource, Inflater paramInflater)
{
if (paramBufferedSource == null) {
throw new IllegalArgumentException("source == null");
}
if (paramInflater == null) {
throw new IllegalArgumentException("inflater == null");
}
this.a = paramBufferedSource;
this.b = paramInflater;
}
public InflaterSource(Source paramSource, Inflater paramInflater)
{
this(Okio.buffer(paramSource), paramInflater);
}
private void a()
throws IOException
{
if (this.c == 0) {
return;
}
int i = this.c - this.b.getRemaining();
this.c -= i;
this.a.skip(i);
}
public final void close()
throws IOException
{
if (this.d) {
return;
}
this.b.end();
this.d = true;
this.a.close();
}
public final long read(Buffer paramBuffer, long paramLong)
throws IOException
{
if (paramLong < 0L) {
throw new IllegalArgumentException("byteCount < 0: " + paramLong);
}
if (this.d) {
throw new IllegalStateException("closed");
}
if (paramLong == 0L) {
return 0L;
}
for (;;)
{
boolean bool = refill();
try
{
tx localtx = paramBuffer.a(1);
int i = this.b.inflate(localtx.a, localtx.c, 2048 - localtx.c);
if (i > 0)
{
localtx.c += i;
paramBuffer.b += i;
return i;
}
if ((this.b.finished()) || (this.b.needsDictionary()))
{
a();
if (localtx.b == localtx.c)
{
paramBuffer.a = localtx.a();
ty.a(localtx);
}
}
else
{
if (!bool) {
continue;
}
throw new EOFException("source exhausted prematurely");
}
}
catch (DataFormatException paramBuffer)
{
throw new IOException(paramBuffer);
}
}
return -1L;
}
public final boolean refill()
throws IOException
{
if (!this.b.needsInput()) {
return false;
}
a();
if (this.b.getRemaining() != 0) {
throw new IllegalStateException("?");
}
if (this.a.exhausted()) {
return true;
}
tx localtx = this.a.buffer().a;
this.c = (localtx.c - localtx.b);
this.b.setInput(localtx.a, localtx.b, this.c);
return false;
}
public final Timeout timeout()
{
return this.a.timeout();
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/okio/InflaterSource.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/