148 |
* @exception IOException if a i/o error occured. |
* @exception IOException if a i/o error occured. |
149 |
* @exception EOFException if the file ends prematurely |
* @exception EOFException if the file ends prematurely |
150 |
*/ |
*/ |
151 |
private final int readLeShort(DataInput di, byte[] b) throws IOException |
private int readLeShort(DataInput di, byte[] b) throws IOException |
152 |
{ |
{ |
153 |
di.readFully(b, 0, 2); |
di.readFully(b, 0, 2); |
154 |
return (b[0] & 0xff) | (b[1] & 0xff) << 8; |
return (b[0] & 0xff) | (b[1] & 0xff) << 8; |
165 |
* @exception IOException if a i/o error occured. |
* @exception IOException if a i/o error occured. |
166 |
* @exception EOFException if the file ends prematurely |
* @exception EOFException if the file ends prematurely |
167 |
*/ |
*/ |
168 |
private final int readLeInt(DataInput di, byte[] b) throws IOException |
private int readLeInt(DataInput di, byte[] b) throws IOException |
169 |
{ |
{ |
170 |
di.readFully(b, 0, 4); |
di.readFully(b, 0, 4); |
171 |
return ((b[0] & 0xff) | (b[1] & 0xff) << 8) |
return ((b[0] & 0xff) | (b[1] & 0xff) << 8) |
172 |
| ((b[2] & 0xff) | (b[3] & 0xff) << 8) << 16; |
| ((b[2] & 0xff) | (b[3] & 0xff) << 8) << 16; |
173 |
} |
} |
174 |
|
|
|
|
|
175 |
/** |
/** |
176 |
* Read an unsigned short in little endian byte order from the given |
* Read an unsigned short in little endian byte order from the given |
177 |
* byte buffer at the given offset. |
* byte buffer at the given offset. |
180 |
* @param off the offset to read from. |
* @param off the offset to read from. |
181 |
* @return The value read. |
* @return The value read. |
182 |
*/ |
*/ |
183 |
private final int readLeShort(byte[] b, int off) |
private int readLeShort(byte[] b, int off) |
184 |
{ |
{ |
185 |
return (b[off] & 0xff) | (b[off+1] & 0xff) << 8; |
return (b[off] & 0xff) | (b[off+1] & 0xff) << 8; |
186 |
} |
} |
193 |
* @param off the offset to read from. |
* @param off the offset to read from. |
194 |
* @return The value read. |
* @return The value read. |
195 |
*/ |
*/ |
196 |
private final int readLeInt(byte[] b, int off) |
private int readLeInt(byte[] b, int off) |
197 |
{ |
{ |
198 |
return ((b[off] & 0xff) | (b[off+1] & 0xff) << 8) |
return ((b[off] & 0xff) | (b[off+1] & 0xff) << 8) |
199 |
| ((b[off+2] & 0xff) | (b[off+3] & 0xff) << 8) << 16; |
| ((b[off+2] & 0xff) | (b[off+3] & 0xff) << 8) << 16; |