LittleEndianDataInputStream.java
3 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
package com.google.common.io;
import com.google.common.annotations.Beta;
import com.google.common.base.Preconditions;
import com.google.common.primitives.Ints;
import com.google.common.primitives.Longs;
import java.io.DataInput;
import java.io.DataInputStream;
import java.io.EOFException;
import java.io.FilterInputStream;
import java.io.IOException;
import java.io.InputStream;
@Beta
public final class LittleEndianDataInputStream
extends FilterInputStream
implements DataInput
{
public LittleEndianDataInputStream(InputStream paramInputStream)
{
super((InputStream)Preconditions.checkNotNull(paramInputStream));
}
private byte a()
throws IOException, EOFException
{
int i = this.in.read();
if (-1 == i) {
throw new EOFException();
}
return (byte)i;
}
public final boolean readBoolean()
throws IOException
{
return readUnsignedByte() != 0;
}
public final byte readByte()
throws IOException
{
return (byte)readUnsignedByte();
}
public final char readChar()
throws IOException
{
return (char)readUnsignedShort();
}
public final double readDouble()
throws IOException
{
return Double.longBitsToDouble(readLong());
}
public final float readFloat()
throws IOException
{
return Float.intBitsToFloat(readInt());
}
public final void readFully(byte[] paramArrayOfByte)
throws IOException
{
ByteStreams.readFully(this, paramArrayOfByte);
}
public final void readFully(byte[] paramArrayOfByte, int paramInt1, int paramInt2)
throws IOException
{
ByteStreams.readFully(this, paramArrayOfByte, paramInt1, paramInt2);
}
public final int readInt()
throws IOException
{
byte b1 = a();
byte b2 = a();
byte b3 = a();
return Ints.fromBytes(a(), b3, b2, b1);
}
public final String readLine()
{
throw new UnsupportedOperationException("readLine is not supported");
}
public final long readLong()
throws IOException
{
byte b1 = a();
byte b2 = a();
byte b3 = a();
byte b4 = a();
byte b5 = a();
byte b6 = a();
byte b7 = a();
return Longs.fromBytes(a(), b7, b6, b5, b4, b3, b2, b1);
}
public final short readShort()
throws IOException
{
return (short)readUnsignedShort();
}
public final String readUTF()
throws IOException
{
return new DataInputStream(this.in).readUTF();
}
public final int readUnsignedByte()
throws IOException
{
int i = this.in.read();
if (i < 0) {
throw new EOFException();
}
return i;
}
public final int readUnsignedShort()
throws IOException
{
byte b = a();
return Ints.fromBytes((byte)0, (byte)0, a(), b);
}
public final int skipBytes(int paramInt)
throws IOException
{
return (int)this.in.skip(paramInt);
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/google/common/io/LittleEndianDataInputStream.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/