/** * Reads a {@code float} as specified by {@link DataInputStream#readFloat()}, except using * little-endian byte order. * * @return the next four bytes of the input stream, interpreted as a {@code float} in * little-endian byte order * @throws IOException if an I/O error occurs */ @CanIgnoreReturnValue // to skip some bytes @Override public float readFloat() throws IOException { return Float.intBitsToFloat(readInt()); }
/** * Reads a {@code float} as specified by {@link DataInputStream#readFloat()}, except using * little-endian byte order. * * @return the next four bytes of the input stream, interpreted as a {@code float} in * little-endian byte order * @throws IOException if an I/O error occurs */ @CanIgnoreReturnValue // to skip some bytes @Override public float readFloat() throws IOException { return Float.intBitsToFloat(readInt()); }
/** * Reads a {@code float} as specified by {@link DataInputStream#readFloat()}, except using * little-endian byte order. * * @return the next four bytes of the input stream, interpreted as a {@code float} in * little-endian byte order * @throws IOException if an I/O error occurs */ @CanIgnoreReturnValue // to skip some bytes @Override public float readFloat() throws IOException { return Float.intBitsToFloat(readInt()); }
/** * Warning: the result is negative in Java if UInt32 > 0x7fffffff * @return next UInt32 value as an int * @throws IOException */ public int readUInt32AsInt() throws IOException { return in.readInt(); }
/** * Warning: the result is negative in Java if UInt32 > 0x7fffffff * @return next UInt32 value as an int * @throws IOException */ public int readUInt32AsInt() throws IOException { return in.readInt(); }
/** * Reads a {@code float} as specified by {@link DataInputStream#readFloat()}, * except using little-endian byte order. * * @return the next four bytes of the input stream, interpreted as a * {@code float} in little-endian byte order * @throws IOException if an I/O error occurs */ @Override public float readFloat() throws IOException { return Float.intBitsToFloat(readInt()); }
/** * Reads a {@code float} as specified by {@link DataInputStream#readFloat()}, * except using little-endian byte order. * * @return the next four bytes of the input stream, interpreted as an {@code * float} in little-endian byte order * @throws IOException if an I/O error occurs */ @Override public float readFloat() throws IOException { return Float.intBitsToFloat(readInt()); }
/** * Reads a {@code float} as specified by {@link DataInputStream#readFloat()}, * except using little-endian byte order. * * @return the next four bytes of the input stream, interpreted as a * {@code float} in little-endian byte order * @throws IOException if an I/O error occurs */ @Override public float readFloat() throws IOException { return Float.intBitsToFloat(readInt()); }
/** * Reads a {@code float} as specified by {@link DataInputStream#readFloat()}, * except using little-endian byte order. * * @return the next four bytes of the input stream, interpreted as a * {@code float} in little-endian byte order * @throws IOException if an I/O error occurs */ @Override public float readFloat() throws IOException { return Float.intBitsToFloat(readInt()); }
/** * Reads a {@code float} as specified by {@link DataInputStream#readFloat()}, * except using little-endian byte order. * * @return the next four bytes of the input stream, interpreted as a * {@code float} in little-endian byte order * @throws IOException if an I/O error occurs */ @Override public float readFloat() throws IOException { return Float.intBitsToFloat(readInt()); }
/** * Reads a {@code float} as specified by {@link DataInputStream#readFloat()}, * except using little-endian byte order. * * @return the next four bytes of the input stream, interpreted as a * {@code float} in little-endian byte order * @throws IOException if an I/O error occurs */ @Override public float readFloat() throws IOException { return Float.intBitsToFloat(readInt()); }
/** * Reads a {@code float} as specified by {@link DataInputStream#readFloat()}, * except using little-endian byte order. * * @return the next four bytes of the input stream, interpreted as a * {@code float} in little-endian byte order * @throws IOException if an I/O error occurs */ @Override public float readFloat() throws IOException { return Float.intBitsToFloat(readInt()); }
/** * Reads a {@code float} as specified by {@link DataInputStream#readFloat()}, * except using little-endian byte order. * * @return the next four bytes of the input stream, interpreted as a * {@code float} in little-endian byte order * @throws IOException if an I/O error occurs */ @Override public float readFloat() throws IOException { return Float.intBitsToFloat(readInt()); }
/** * Reads a {@code float} as specified by {@link DataInputStream#readFloat()}, * except using little-endian byte order. * * @return the next four bytes of the input stream, interpreted as a * {@code float} in little-endian byte order * @throws IOException if an I/O error occurs */ @Override public float readFloat() throws IOException { return Float.intBitsToFloat(readInt()); }
@Override public int readInt() { try { return dataInputStream.readInt(); } catch (IOException e) { throw new RuntimeIOException(e); } }
/** * Reads a {@code float} as specified by {@link DataInputStream#readFloat()}, except using * little-endian byte order. * * @return the next four bytes of the input stream, interpreted as a {@code float} in * little-endian byte order * @throws IOException if an I/O error occurs */ @CanIgnoreReturnValue // to skip some bytes @Override public float readFloat() throws IOException { return Float.intBitsToFloat(readInt()); }
/** * Reads a {@code float} as specified by {@link DataInputStream#readFloat()}, except using * little-endian byte order. * * @return the next four bytes of the input stream, interpreted as a {@code float} in * little-endian byte order * @throws IOException if an I/O error occurs */ @CanIgnoreReturnValue // to skip some bytes @Override public float readFloat() throws IOException { return Float.intBitsToFloat(readInt()); }
private static void validateHeaderAndVersion(LittleEndianDataInputStream input) throws IOException { char[] header = new char[8]; for (int i = 0; i < 8; i++) { header[i] = (char) input.readByte(); } if (!"ACCESSGR".equals(new String(header))) { throw new IllegalArgumentException("Input not in access grid format!"); } int version = input.readInt(); if (version != ACCESS_GRID_VERSION) { throw new IllegalArgumentException(String.format("Version mismatch of access grids, expected %s, found %s", ACCESS_GRID_VERSION, version)); } }
private static void validateHeaderAndVersion(LittleEndianDataInputStream input) throws IOException { char[] header = new char[8]; for (int i = 0; i < 8; i++) { header[i] = (char) input.readByte(); } if (!"ACCESSGR".equals(new String(header))) { throw new IllegalArgumentException("Input not in access grid format!"); } int version = input.readInt(); if (version != ACCESS_GRID_VERSION) { throw new IllegalArgumentException(String.format("Version mismatch of access grids, expected %s, found %s", ACCESS_GRID_VERSION, version)); } }
@Override public CrxMetadata parseMetadata(InputStream crxInput) throws IOException { String magicNumber = readMagicNumber(crxInput); checkMagicNumber(magicNumber); LittleEndianDataInputStream in = new LittleEndianDataInputStream(crxInput); int version = Ints.checkedCast(UnsignedInteger.fromIntBits(in.readInt()).longValue()); CrxInterpreter interpreter = getCrxInterpreter(magicNumber, version); CrxMetadata metadata = interpreter.parseMetadataAfterVersion(crxInput); return metadata; }