GzipSink.java
2.9 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
package okio;
import java.io.IOException;
import java.util.zip.CRC32;
import java.util.zip.Deflater;
import tx;
import ua;
public final class GzipSink
implements Sink
{
private final BufferedSink a;
private final Deflater b;
private final DeflaterSink c;
private boolean d;
private final CRC32 e = new CRC32();
public GzipSink(Sink paramSink)
{
if (paramSink == null) {
throw new IllegalArgumentException("sink == null");
}
this.b = new Deflater(-1, true);
this.a = Okio.buffer(paramSink);
this.c = new DeflaterSink(this.a, this.b);
paramSink = this.a.buffer();
paramSink.writeShort(8075);
paramSink.writeByte(8);
paramSink.writeByte(0);
paramSink.writeInt(0);
paramSink.writeByte(0);
paramSink.writeByte(0);
}
private void a(Buffer paramBuffer, long paramLong)
{
for (paramBuffer = paramBuffer.a; paramLong > 0L; paramBuffer = paramBuffer.f)
{
int i = (int)Math.min(paramLong, paramBuffer.c - paramBuffer.b);
this.e.update(paramBuffer.a, paramBuffer.b, i);
paramLong -= i;
}
}
public final void close()
throws IOException
{
if (this.d) {}
for (;;)
{
return;
Object localObject2 = null;
try
{
this.c.a();
this.a.writeIntLe((int)this.e.getValue());
this.a.writeIntLe(this.b.getTotalIn());
try
{
this.b.end();
localObject1 = localObject2;
}
catch (Throwable localThrowable1)
{
for (;;)
{
Object localObject1;
label72:
if (localThrowable3 != null) {
localThrowable2 = localThrowable3;
}
}
}
try
{
this.a.close();
localObject2 = localObject1;
}
catch (Throwable localThrowable4)
{
Object localObject3 = localThrowable2;
if (localThrowable2 != null) {
break label72;
}
localObject3 = localThrowable4;
break label72;
}
this.d = true;
if (localObject2 == null) {
continue;
}
ua.a((Throwable)localObject2);
return;
}
catch (Throwable localThrowable3)
{
for (;;) {}
}
}
}
public final void flush()
throws IOException
{
this.c.flush();
}
public final Timeout timeout()
{
return this.a.timeout();
}
public final void write(Buffer paramBuffer, long paramLong)
throws IOException
{
if (paramLong < 0L) {
throw new IllegalArgumentException("byteCount < 0: " + paramLong);
}
if (paramLong == 0L) {
return;
}
a(paramBuffer, paramLong);
this.c.write(paramBuffer, paramLong);
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/okio/GzipSink.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/