/** * construct an unknown record. No fields are interpreted and the record will * be serialized in its original form more or less * @param in the RecordInputstream to read the record from */ public UnknownRecord(RecordInputStream in) { _sid = in.getSid(); _rawData = in.readRemainder(); // TODO - put unknown OBJ sub-records in a different class // unknown sids in the range 0x0004-0x0013 are probably 'sub-records' of ObjectRecord // those sids are in a different number space. }
public static Record createSingleRecord(RecordInputStream in) { I_RecordCreator constructor = _recordCreatorsById.get(Integer.valueOf(in.getSid())); if (constructor == null) { return new UnknownRecord(in); } return constructor.create(in); }
/** * @param in the RecordInputstream to read the record from */ public OldStringRecord(RecordInputStream in) { sid = in.getSid(); if (in.getSid() == biff2_sid) { field_1_string_len = (short)in.readUByte(); } else { field_1_string_len = in.readShort(); } // Can only decode properly later when you know the codepage field_2_bytes = IOUtils.safelyAllocate(field_1_string_len, MAX_RECORD_LENGTH); in.read(field_2_bytes, 0, field_1_string_len); }
private void prepare() { if (! ris.hasNextRecord()) { throw new IllegalArgumentException("File contains no records!"); } ris.nextRecord(); // Work out what version we're dealing with int bofSid = ris.getSid(); switch (bofSid) { case BOFRecord.biff2_sid: biffVersion = 2; break; case BOFRecord.biff3_sid: biffVersion = 3; break; case BOFRecord.biff4_sid: biffVersion = 4; break; case BOFRecord.biff5_sid: biffVersion = 5; break; default: throw new IllegalArgumentException("File does not begin with a BOF, found sid of " + bofSid); } // Get the type BOFRecord bof = new BOFRecord(ris); fileType = bof.getType(); }
protected OldCellRecord(RecordInputStream in, boolean isBiff2) { this.sid = in.getSid(); this.isBiff2 = isBiff2; field_1_row = in.readUShort(); field_2_column = in.readShort(); if (isBiff2) { field_3_cell_attrs = in.readUShort() << 8; field_3_cell_attrs += in.readUByte(); } else { field_3_xf_index = in.readShort(); } }
/** * Read Constructor. * * @param inStream RecordInputStream containing a DConRefRecord structure. */ public DConRefRecord(RecordInputStream inStream) { if (inStream.getSid() != sid) throw new RecordFormatException("Wrong sid: " + inStream.getSid()); firstRow = inStream.readUShort(); lastRow = inStream.readUShort(); firstCol = inStream.readUByte(); lastCol = inStream.readUByte(); charCount = inStream.readUShort(); charType = inStream.readUByte() & 0x01; //first bit only. // byteLength depends on whether we are using single- or double-byte chars. int byteLength = charCount * (charType + 1); path = IOUtils.safelyAllocate(byteLength, MAX_RECORD_LENGTH); inStream.readFully(path); if (path[0] == 0x02) _unused = inStream.readRemainder(); }
if (recStream.getSid() == 0) { continue;
public OldFormulaRecord(RecordInputStream ris) { super(ris, ris.getSid() == biff2_sid); if (isBiff2()) { field_4_value = ris.readDouble(); } else { long valueLongBits = ris.readLong(); specialCachedValue = SpecialCachedValue.create(valueLongBits); if (specialCachedValue == null) { field_4_value = Double.longBitsToDouble(valueLongBits); } } if (isBiff2()) { field_5_options = (short)ris.readUByte(); } else { field_5_options = ris.readShort(); } int expression_len = ris.readShort(); int nBytesAvailable = ris.available(); field_6_parsed_expr = Formula.read(expression_len, ris, nBytesAvailable); }
/** * @param in the RecordInputstream to read the record from */ public OldLabelRecord(RecordInputStream in) { super(in, in.getSid() == biff2_sid); if (isBiff2()) { field_4_string_len = (short)in.readUByte(); } else { field_4_string_len = in.readShort(); } // Can only decode properly later when you know the codepage field_5_bytes = IOUtils.safelyAllocate(field_4_string_len, MAX_RECORD_LENGTH); in.read(field_5_bytes, 0, field_4_string_len); if (in.remaining() > 0) { logger.log(POILogger.INFO, "LabelRecord data remains: " + in.remaining() + " : " + HexDump.toHex(in.readRemainder()) ); } }
/** * construct an unknown record. No fields are interpreted and the record will * be serialized in its original form more or less * @param in the RecordInputstream to read the record from */ public UnknownRecord(RecordInputStream in) { _sid = in.getSid(); _rawData = in.readRemainder(); // TODO - put unknown OBJ sub-records in a different class // unknown sids in the range 0x0004-0x0013 are probably 'sub-records' of ObjectRecord // those sids are in a different number space. }
public static Record createSingleRecord(RecordInputStream in) { I_RecordCreator constructor = _recordCreatorsById.get(Integer.valueOf(in.getSid())); if (constructor == null) { return new UnknownRecord(in); } return constructor.create(in); }
public static Record createSingleRecord(RecordInputStream in) { I_RecordCreator constructor = _recordCreatorsById.get(Integer.valueOf(in.getSid())); if (constructor == null) { return new UnknownRecord(in); } return constructor.create(in); }
public static Record createSingleRecord(RecordInputStream in) { I_RecordCreator constructor = _recordCreatorsById.get(Integer.valueOf(in.getSid())); if (constructor == null) { return new UnknownRecord(in); } return constructor.create(in); }
/** * @param in the RecordInputstream to read the record from */ public OldStringRecord(RecordInputStream in) { sid = in.getSid(); if (in.getSid() == biff2_sid) { field_1_string_len = (short)in.readUByte(); } else { field_1_string_len = in.readShort(); } // Can only decode properly later when you know the codepage field_2_bytes = IOUtils.safelyAllocate(field_1_string_len, MAX_RECORD_LENGTH); in.read(field_2_bytes, 0, field_1_string_len); }
/** * construct an unknown record. No fields are interpreted and the record will * be serialized in its original form more or less * @param in the RecordInputstream to read the record from */ public UnknownRecord(RecordInputStream in) { _sid = in.getSid(); _rawData = in.readRemainder(); if (false && getBiffName(_sid) == null) { // unknown sids in the range 0x0004-0x0013 are probably 'sub-records' of ObjectRecord // those sids are in a different number space. // TODO - put unknown OBJ sub-records in a different class System.out.println("Unknown record 0x" + Integer.toHexString(_sid).toUpperCase()); } }
switch (in.getSid()) { case AreaFormatRecord.sid: return new AreaFormatRecord(in); case AreaRecord.sid: return new AreaRecord(in);
/** * construct an unknown record. No fields are interpreted and the record will * be serialized in its original form more or less * @param in the RecordInputstream to read the record from */ public UnknownRecord(RecordInputStream in) { _sid = in.getSid(); _rawData = in.readRemainder(); if (false && getBiffName(_sid) == null) { // unknown sids in the range 0x0004-0x0013 are probably 'sub-records' of ObjectRecord // those sids are in a different number space. // TODO - put unknown OBJ sub-records in a different class System.out.println("Unknown record 0x" + Integer.toHexString(_sid).toUpperCase()); } }
protected OldCellRecord(RecordInputStream in, boolean isBiff2) { this.sid = in.getSid(); this.isBiff2 = isBiff2; field_1_row = in.readUShort(); field_2_column = in.readShort(); if (isBiff2) { field_3_cell_attrs = in.readUShort() << 8; field_3_cell_attrs += in.readUByte(); } else { field_3_xf_index = in.readShort(); } }
/** * Read Constructor. * * @param inStream RecordInputStream containing a DConRefRecord structure. */ public DConRefRecord(RecordInputStream inStream) { if (inStream.getSid() != sid) throw new RecordFormatException("Wrong sid: " + inStream.getSid()); firstRow = inStream.readUShort(); lastRow = inStream.readUShort(); firstCol = inStream.readUByte(); lastCol = inStream.readUByte(); charCount = inStream.readUShort(); charType = inStream.readUByte() & 0x01; //first bit only. // byteLength depends on whether we are using single- or double-byte chars. int byteLength = charCount * (charType + 1); path = IOUtils.safelyAllocate(byteLength, MAX_RECORD_LENGTH); inStream.readFully(path); if (path[0] == 0x02) _unused = inStream.readRemainder(); }
public OldFormulaRecord(RecordInputStream ris) { super(ris, ris.getSid() == biff2_sid); if (isBiff2()) { field_4_value = ris.readDouble(); } else { long valueLongBits = ris.readLong(); specialCachedValue = SpecialCachedValue.create(valueLongBits); if (specialCachedValue == null) { field_4_value = Double.longBitsToDouble(valueLongBits); } } if (isBiff2()) { field_5_options = (short)ris.readUByte(); } else { field_5_options = ris.readShort(); } int expression_len = ris.readShort(); int nBytesAvailable = ris.available(); field_6_parsed_expr = Formula.read(expression_len, ris, nBytesAvailable); }