/** Read one byte and return it. */ @Override public byte readByte() throws IOException { return raf.readByte(); }
/** Read one byte and return it. */ @Override public byte readByte() throws IOException { return raf.readByte(); }
/** Read one byte and return it. */ @Override public byte readByte() throws IOException { return raf.readByte(); }
/** Read one byte and return it. */ @Override public byte readByte() throws IOException { return raf.readByte(); }
/** * Write a summary of the contents of the record * * @param is * @throws IOException */ public void writeSummary(IRandomAccess is, String indentation) throws IOException { is.seek(offset); LOGGER.info(indentation + toString()); for (int i=0; (i<length) && (i < 256); i+= 32) { StringBuilder msg = new StringBuilder(indentation + String.format("%02x:", i)); for (int j=i;(j < length) &&(j < i+32); j++) { msg.append(String.format(" %02x", is.readByte())); } LOGGER.info(msg.toString()); } } /* (non-Javadoc)
/** * Write a summary of the contents of the record * * @param is * @throws IOException */ public void writeSummary(IRandomAccess is, String indentation) throws IOException { is.seek(offset); LOGGER.info(indentation + toString()); for (int i=0; (i<length) && (i < 256); i+= 32) { StringBuilder msg = new StringBuilder(indentation + String.format("%02x:", i)); for (int j=i;(j < length) &&(j < i+32); j++) { msg.append(String.format(" %02x", is.readByte())); } LOGGER.info(msg.toString()); } } /* (non-Javadoc)
/** * 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 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); } }