HashingInputStream.java
1.47 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
package com.google.common.hash;
import com.google.common.annotations.Beta;
import com.google.common.base.Preconditions;
import java.io.FilterInputStream;
import java.io.IOException;
import java.io.InputStream;
@Beta
public final class HashingInputStream
extends FilterInputStream
{
private final Hasher a;
public HashingInputStream(HashFunction paramHashFunction, InputStream paramInputStream)
{
super((InputStream)Preconditions.checkNotNull(paramInputStream));
this.a = ((Hasher)Preconditions.checkNotNull(paramHashFunction.newHasher()));
}
public final HashCode hash()
{
return this.a.hash();
}
public final void mark(int paramInt) {}
public final boolean markSupported()
{
return false;
}
public final int read()
throws IOException
{
int i = this.in.read();
if (i != -1) {
this.a.putByte((byte)i);
}
return i;
}
public final int read(byte[] paramArrayOfByte, int paramInt1, int paramInt2)
throws IOException
{
paramInt2 = this.in.read(paramArrayOfByte, paramInt1, paramInt2);
if (paramInt2 != -1) {
this.a.putBytes(paramArrayOfByte, paramInt1, paramInt2);
}
return paramInt2;
}
public final void reset()
throws IOException
{
throw new IOException("reset not supported");
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/google/common/hash/HashingInputStream.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/