public int readUShort() { checkRecordPosition(); int result = LittleEndian.getUShort(data, recordOffset); recordOffset += LittleEndian.SHORT_SIZE; pos += LittleEndian.SHORT_SIZE; return result; }
/** This method will read a byte from the current record */ public int read() throws IOException { checkRecordPosition(); byte result = data[recordOffset]; recordOffset += 1; pos += 1; return result; }
public long readLong() { checkRecordPosition(); long result = LittleEndian.getLong(data, recordOffset); recordOffset += LittleEndian.LONG_SIZE; pos += LittleEndian.LONG_SIZE; return result; }
public int readInt() { checkRecordPosition(); int result = LittleEndian.getInt(data, recordOffset); recordOffset += LittleEndian.INT_SIZE; pos += LittleEndian.INT_SIZE; return result; }
public byte readByte() { checkRecordPosition(); byte result = data[recordOffset]; recordOffset += 1; pos += 1; return result; }
public short[] readShortArray() { checkRecordPosition(); short[] arr = LittleEndian.getShortArray(data, recordOffset); final int size = (2 * (arr.length + 1)); recordOffset += size; pos += size; return arr; }
public double readDouble() { checkRecordPosition(); // Reset NAN data NAN_data = null; double result = LittleEndian.getDouble(data, recordOffset); // Excel represents NAN in several ways, at this point in time we do not often // know the sequence of bytes, so as a hack we store the NAN byte sequence // so that it is not corrupted. if (Double.isNaN(result)) { NAN_data = new byte[8]; System.arraycopy(data, recordOffset, NAN_data, 0, 8); } recordOffset += LittleEndian.DOUBLE_SIZE; pos += LittleEndian.DOUBLE_SIZE; return result; }