/** * @return the current (absolute) file pointer. * @throws IOException if the current pointer cannot be retrieved */ public long getFilePointer() throws IOException { return raf.getFilePointer(); }
/** * @return the current offset within the stream. * @throws IOException if the offset cannot be retrieved */ public long getFilePointer() throws IOException { return outputFile.getFilePointer(); }
/** Gets the current (absolute) file pointer. */ public long getFilePointer() throws IOException { return raf.getFilePointer(); }
/** Returns the current offset within the stream. */ public long getFilePointer() throws IOException { return outputFile.getFilePointer(); }
/** Gets the current (absolute) file pointer. */ public long getFilePointer() { try { return raf.getFilePointer(); } catch (IOException e) { throw new RuntimeException(e); } }
/** * @return the current (absolute) file pointer. */ public long getFilePointer() { try { return raf.getFilePointer(); } catch (IOException e) { throw new RuntimeException(e); } }
/** Advances the current offset by the given number of bytes. */ public void skipBytes(int skip) throws IOException { outputFile.seek(outputFile.getFilePointer() + skip); }
/** * Read n bytes from the stream into the given array at the specified offset. */ @Override public int read(byte[] array, int offset, int n) throws IOException { int rtn = raf.read(array, offset, n); if (rtn == 0 && raf.getFilePointer() >= raf.length() - 1) rtn = -1; return rtn; }
/** Read bytes from the stream into the given array. */ @Override public int read(byte[] array) throws IOException { int rtn = raf.read(array); if (rtn == 0 && raf.getFilePointer() >= raf.length() - 1) rtn = -1; return rtn; }
/** Read bytes from the stream into the given array. */ @Override public int read(byte[] array) throws IOException { int rtn = raf.read(array); if (rtn == 0 && raf.getFilePointer() >= raf.length() - 1) rtn = -1; return rtn; }
/** * Read n bytes from the stream into the given array at the specified offset. */ @Override public int read(byte[] array, int offset, int n) throws IOException { int rtn = raf.read(array, offset, n); if (rtn == 0 && raf.getFilePointer() >= raf.length() - 1) rtn = -1; return rtn; }
/** * Get the # of boolean values in this record * * @return number of boolean values contained in the record * @throws IOException */ public int getNumEntries(IRandomAccess is) throws IOException { long oldPos = is.getFilePointer(); try { is.seek(offset+4); return is.readInt(); } finally { is.seek(oldPos); } }
/** * Get the # of boolean values in this record * * @return number of boolean values contained in the record * @throws IOException */ public int getNumEntries(IRandomAccess is) throws IOException { long oldPos = is.getFilePointer(); try { is.seek(offset+4); return is.readInt(); } finally { is.seek(oldPos); } }
/** * Return the string value for this record * * @param is an open handle on the .IM3 file * @return the string value stored in the record * @throws IOException */ public String getValue(IRandomAccess is) throws IOException { final long oldPos = is.getFilePointer(); try { is.seek(offset+4); return parseString(is); } finally { is.seek(oldPos); } }
/** * Get the boolean 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 boolean getEntry(IRandomAccess is, int index) throws IOException { long oldPos = is.getFilePointer(); try { is.seek(offset+8+index); return (is.readByte() != 0); } finally { is.seek(oldPos); } }
/** * Return the string value for this record * * @param is an open handle on the .IM3 file * @return the string value stored in the record * @throws IOException */ public String getValue(IRandomAccess is) throws IOException { final long oldPos = is.getFilePointer(); try { is.seek(offset+4); return parseString(is); } finally { is.seek(oldPos); } }
/** * Get the boolean 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 boolean getEntry(IRandomAccess is, int index) throws IOException { long oldPos = is.getFilePointer(); try { is.seek(offset+8+index); return (is.readByte() != 0); } finally { is.seek(oldPos); } }
/** * Get the # of floating-point values in this record * * @return number of integer values contained in the record * @throws IOException */ public int getNumEntries(IRandomAccess is) throws IOException { long oldPos = is.getFilePointer(); try { is.seek(offset); if (is.readInt() == 0) return 1; return is.readInt(); } finally { is.seek(oldPos); } }
/** * Get the # of floating-point values in this record * * @return number of integer values contained in the record * @throws IOException */ public int getNumEntries(IRandomAccess is) throws IOException { long oldPos = is.getFilePointer(); try { is.seek(offset); if (is.readInt() == 0) return 1; return is.readInt(); } finally { is.seek(oldPos); } }
/** * Get the # of integer values in this record * @param is * * @return number of integer values contained in the record * @throws IOException */ public int getNumEntries(IRandomAccess is) throws IOException { long oldPos = is.getFilePointer(); try { is.seek(offset); final int code = is.readInt(); if (code == 0) return 1; return is.readInt(); } finally { is.seek(oldPos); } }