GzipSource.java
4.02 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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
package okio;
import java.io.EOFException;
import java.io.IOException;
import java.util.zip.CRC32;
import java.util.zip.Inflater;
import tx;
public final class GzipSource
implements Source
{
private int a = 0;
private final BufferedSource b;
private final Inflater c;
private final InflaterSource d;
private final CRC32 e = new CRC32();
public GzipSource(Source paramSource)
{
if (paramSource == null) {
throw new IllegalArgumentException("source == null");
}
this.c = new Inflater(true);
this.b = Okio.buffer(paramSource);
this.d = new InflaterSource(this.b, this.c);
}
private static void a(String paramString, int paramInt1, int paramInt2)
throws IOException
{
if (paramInt2 != paramInt1) {
throw new IOException(String.format("%s: actual 0x%08x != expected 0x%08x", new Object[] { paramString, Integer.valueOf(paramInt2), Integer.valueOf(paramInt1) }));
}
}
private void a(Buffer paramBuffer, long paramLong1, long paramLong2)
{
Object localObject;
long l1;
long l2;
for (paramBuffer = paramBuffer.a;; paramBuffer = paramBuffer.f)
{
localObject = paramBuffer;
l1 = paramLong1;
l2 = paramLong2;
if (paramLong1 < paramBuffer.c - paramBuffer.b) {
break;
}
paramLong1 -= paramBuffer.c - paramBuffer.b;
}
while (l2 > 0L)
{
int i = (int)(((tx)localObject).b + l1);
int j = (int)Math.min(((tx)localObject).c - i, l2);
this.e.update(((tx)localObject).a, i, j);
l2 -= j;
localObject = ((tx)localObject).f;
l1 = 0L;
}
}
public final void close()
throws IOException
{
this.d.close();
}
public final long read(Buffer paramBuffer, long paramLong)
throws IOException
{
if (paramLong < 0L) {
throw new IllegalArgumentException("byteCount < 0: " + paramLong);
}
if (paramLong == 0L) {
return 0L;
}
long l;
if (this.a == 0)
{
this.b.require(10L);
int j = this.b.buffer().getByte(3L);
if ((j >> 1 & 0x1) == 1) {}
for (int i = 1;; i = 0)
{
if (i != 0) {
a(this.b.buffer(), 0L, 10L);
}
a("ID1ID2", 8075, this.b.readShort());
this.b.skip(8L);
if ((j >> 2 & 0x1) == 1)
{
this.b.require(2L);
if (i != 0) {
a(this.b.buffer(), 0L, 2L);
}
int k = this.b.buffer().readShortLe();
this.b.require(k);
if (i != 0) {
a(this.b.buffer(), 0L, k);
}
this.b.skip(k);
}
if ((j >> 3 & 0x1) != 1) {
break label323;
}
l = this.b.indexOf((byte)0);
if (l != -1L) {
break;
}
throw new EOFException();
}
if (i != 0) {
a(this.b.buffer(), 0L, 1L + l);
}
this.b.skip(1L + l);
label323:
if ((j >> 4 & 0x1) == 1)
{
l = this.b.indexOf((byte)0);
if (l == -1L) {
throw new EOFException();
}
if (i != 0) {
a(this.b.buffer(), 0L, 1L + l);
}
this.b.skip(1L + l);
}
if (i != 0)
{
a("FHCRC", this.b.readShortLe(), (short)(int)this.e.getValue());
this.e.reset();
}
this.a = 1;
}
if (this.a == 1)
{
l = paramBuffer.b;
paramLong = this.d.read(paramBuffer, paramLong);
if (paramLong != -1L)
{
a(paramBuffer, l, paramLong);
return paramLong;
}
this.a = 2;
}
if (this.a == 2)
{
a("CRC", this.b.readIntLe(), (int)this.e.getValue());
a("ISIZE", this.b.readIntLe(), this.c.getTotalOut());
this.a = 3;
if (!this.b.exhausted()) {
throw new IOException("gzip finished without exhausting source");
}
}
return -1L;
}
public final Timeout timeout()
{
return this.b.timeout();
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/okio/GzipSource.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/