3 import java.io.DataInput;
4 import java.io.DataInputStream;
5 import java.io.IOException;
6 import java.io.InputStream;
28 this.in =
new DataInputStream(in);
35 }
catch (IOException e) {
45 public float[]
readFloat(
int _size)
throws IOException {
46 float[] ofloat =
new float[_size];
48 byte[] tmp =
new byte[4 * _size];
49 for (i = 0; i < 4 * _size; i++)
50 tmp[i] =
in.readByte();
52 for (
int count = 0; count < _size; count++) {
55 for (
int shiftBy = 0; shiftBy < 32; shiftBy += 8) {
56 accum |= ((long) (tmp[i + count * 4] & 0xff)) << shiftBy;
59 ofloat[count] = Float.intBitsToFloat(accum);
68 public void readFully(byte[] b)
throws IOException {
69 throw new RuntimeException(
"Not implemented.");
76 public void readFully(byte[] b,
int off,
int len)
throws IOException {
77 throw new RuntimeException(
"Not implemented.");
86 throw new RuntimeException(
"Not implemented.");
94 throw new RuntimeException(
"Not implemented.");
102 throw new RuntimeException(
"Not implemented.");
110 throw new RuntimeException(
"Not implemented.");
118 throw new RuntimeException(
"Not implemented.");
126 throw new RuntimeException(
"Not implemented.");
134 throw new RuntimeException(
"Not implemented.");
143 byte[] tmp =
new byte[2];
144 for (i = 0; i < 2; i++)
145 tmp[i] =
in.readByte();
146 int low = tmp[0] & 0xff;
147 int high = tmp[1] & 0xff;
148 return (
int) (high << 8 | low);
157 byte[] tmp =
new byte[4];
158 for (i = 0; i < 4; i++)
159 tmp[i] =
in.readByte();
162 for (
int shiftBy = 0; shiftBy < 32; shiftBy += 8) {
163 accum |= ((long) (tmp[i] & 0xff)) << shiftBy;
175 byte[] tmp =
new byte[4];
176 for (i = 0; i < 4; i++)
177 tmp[i] =
in.readByte();
180 for (
int shiftBy = 0; shiftBy < 32; shiftBy += 8) {
181 accum |= ((long) (tmp[i] & 0xff)) << shiftBy;
184 return Float.intBitsToFloat(accum);
193 byte[] tmp =
new byte[8];
194 for (i = 0; i < 8; i++)
195 tmp[i] =
in.readByte();
198 for (
int shiftBy = 0; shiftBy < 64; shiftBy += 8) {
199 accum |= ((long) (tmp[i] & 0xff)) << shiftBy;
202 return Double.longBitsToDouble(accum);
210 throw new RuntimeException(
"Not implemented.");
218 throw new RuntimeException(
"Not implemented.");