CountingInputStream.java
1.75 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
package com.google.common.io;
import com.google.common.annotations.Beta;
import java.io.FilterInputStream;
import java.io.IOException;
import java.io.InputStream;
import javax.annotation.Nullable;
@Beta
public final class CountingInputStream
extends FilterInputStream
{
private long a;
private long b = -1L;
public CountingInputStream(@Nullable InputStream paramInputStream)
{
super(paramInputStream);
}
public final long getCount()
{
return this.a;
}
public final void mark(int paramInt)
{
try
{
this.in.mark(paramInt);
this.b = this.a;
return;
}
finally
{
localObject = finally;
throw ((Throwable)localObject);
}
}
public final int read()
throws IOException
{
int i = this.in.read();
if (i != -1) {
this.a += 1L;
}
return i;
}
public final int read(byte[] paramArrayOfByte, int paramInt1, int paramInt2)
throws IOException
{
paramInt1 = this.in.read(paramArrayOfByte, paramInt1, paramInt2);
if (paramInt1 != -1) {
this.a += paramInt1;
}
return paramInt1;
}
public final void reset()
throws IOException
{
try
{
if (!this.in.markSupported()) {
throw new IOException("Mark not supported");
}
}
finally {}
if (this.b == -1L) {
throw new IOException("Mark not set");
}
this.in.reset();
this.a = this.b;
}
public final long skip(long paramLong)
throws IOException
{
paramLong = this.in.skip(paramLong);
this.a += paramLong;
return paramLong;
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/google/common/io/CountingInputStream.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/