/** Read four bytes and return a float value. */ @Override public float readFloat() throws IOException { return raf.readFloat(); }
/** Read four bytes and return a float value. */ @Override public float readFloat() throws IOException { return raf.readFloat(); }
/** Read four bytes and return a float value. */ @Override public float readFloat() throws IOException { return raf.readFloat(); }
/** Read four bytes and return a float value. */ @Override public float readFloat() throws IOException { return raf.readFloat(); }
/** * Get the floating-point value at the given index * * @param is the stream for the IM3 file * @param index the zero-based index of the entry to retrieve * @return the value stored in the indexed slot of the record * @throws IOException */ public float getEntry(IRandomAccess is, int index) throws IOException { long oldPos = is.getFilePointer(); try { is.seek(offset); if (is.readInt() == 0) return is.readFloat(); is.seek(offset+8+index*4); return is.readFloat(); } finally { is.seek(oldPos); } } /**
/** * Get the floating-point value at the given index * * @param is the stream for the IM3 file * @param index the zero-based index of the entry to retrieve * @return the value stored in the indexed slot of the record * @throws IOException */ public float getEntry(IRandomAccess is, int index) throws IOException { long oldPos = is.getFilePointer(); try { is.seek(offset); if (is.readInt() == 0) return is.readFloat(); is.seek(offset+8+index*4); return is.readFloat(); } finally { is.seek(oldPos); } } /**
/** * Return all entries as an array * @param is handle to file * @return an array of the stored values * @throws IOException */ public float [] getEntries(IRandomAccess is) throws IOException { final long oldPos = is.getFilePointer(); try { float [] values = new float[getNumEntries(is)]; is.seek(offset+8); for (int index=0; index < values.length; index++) { values[index] = is.readFloat(); } return values; } finally { is.seek(oldPos); } } /* (non-Javadoc)
/** * Return all entries as an array * @param is handle to file * @return an array of the stored values * @throws IOException */ public float [] getEntries(IRandomAccess is) throws IOException { final long oldPos = is.getFilePointer(); try { float [] values = new float[getNumEntries(is)]; is.seek(offset+8); for (int index=0; index < values.length; index++) { values[index] = is.readFloat(); } return values; } finally { is.seek(oldPos); } } /* (non-Javadoc)