public WSBoolRecord(RecordInputStream in) { byte data[] = in.readRemainder(); field_1_wsbool = data[ 1 ]; // backwards because theoretically this is one short field field_2_wsbool = data[ 0 ]; // but it was easier to implement it this way to avoid confusion } // because the dev kit shows the masks for it as 2 byte fields
/** * construct an UserSViewBegin 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 UserSViewBegin(RecordInputStream in) { _rawData = in.readRemainder(); }
/** * construct an UserSViewEnd 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 UserSViewEnd(RecordInputStream in) { _rawData = in.readRemainder(); }
/** * construct a HeaderFooterRecord 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 HeaderFooterRecord(RecordInputStream in) { _rawData = in.readRemainder(); }
public FeatSmartTag(RecordInputStream in) { data = in.readRemainder(); }
public ContinueRecord(RecordInputStream in) { _data = in.readRemainder(); }
public DrawingRecord(RecordInputStream in) { recordData = 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. }
/** * Reads all byte data for the current record, including any that overlaps * into any following continue records. * * @return all byte data for the current record * * @deprecated POI 2.0 Best to write a input stream that wraps this one * where there is special sub record that may overlap continue * records. */ @Deprecated public byte[] readAllContinuedRemainder() { ByteArrayOutputStream out = new ByteArrayOutputStream(2 * MAX_RECORD_DATA_SIZE); while (true) { byte[] b = readRemainder(); out.write(b, 0, b.length); if (!isContinueNext()) { break; } nextRecord(); } return out.toByteArray(); }
public AbstractEscherHolderRecord(RecordInputStream in) { escherRecords = new ArrayList<>(); if (! DESERIALISE ) { rawDataContainer.concatenate(in.readRemainder()); } else { byte[] data = in.readAllContinuedRemainder(); convertToEscherRecords( 0, data.length, data ); } }
public FeatProtection(RecordInputStream in) { fSD = in.readInt(); passwordVerifier = in.readInt(); title = StringUtil.readUnicodeString(in); securityDescriptor = in.readRemainder(); }
public FeatHdrRecord(RecordInputStream in) { futureHeader = new FtrHeader(in); isf_sharedFeatureType = in.readShort(); reserved = in.readByte(); cbHdrData = in.readInt(); // Don't process this just yet, need the BOFRecord rgbHdrData = in.readRemainder(); }
public void run() throws IOException { try (POIFSFileSystem fs = new POIFSFileSystem(new File(file), true); InputStream din = BiffViewer.getPOIFSInputStream(fs)) { RecordInputStream rinp = new RecordInputStream(din); while (rinp.hasNextRecord()) { int sid = rinp.getNextSid(); rinp.nextRecord(); int size = rinp.available(); Class<? extends Record> clz = RecordFactory.getRecordClass(sid); System.out.print( formatSID(sid) + " - " + formatSize(size) + " bytes" ); if (clz != null) { System.out.print(" \t"); System.out.print(clz.getName().replace("org.apache.poi.hssf.record.", "")); } System.out.println(); byte[] data = rinp.readRemainder(); if (data.length > 0) { System.out.print(" "); System.out.println(formatData(data)); } } } }
} catch (LeftoverDataException e) { logger.log(POILogger.ERROR, "Discarding " + recStream.remaining() + " bytes and continuing", e); recStream.readRemainder(); hasNext = recStream.hasNextRecord(); recStream.readRemainder();
byte[] subRecordData = in.readRemainder(); if (LittleEndian.getUShort(subRecordData, 0) != CommonObjectDataSubRecord.sid) {
/** * @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()) ); } }
/** * 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(); }
/** * @param in the RecordInputstream to read the record from */ public LabelRecord(RecordInputStream in) { field_1_row = in.readUShort(); field_2_column = in.readShort(); field_3_xf_index = in.readShort(); field_4_string_len = in.readShort(); field_5_unicode_flag = in.readByte(); if (field_4_string_len > 0) { if (isUnCompressedUnicode()) { field_6_value = in.readUnicodeLEString(field_4_string_len); } else { field_6_value = in.readCompressedUnicode(field_4_string_len); } } else { field_6_value = ""; } if (in.remaining() > 0) { logger.log(POILogger.INFO, "LabelRecord data remains: " + in.remaining() + " : " + HexDump.toHex(in.readRemainder()) ); } }
} else { logger.log(POILogger.WARN, "CF Rule v12 template params length should be 0 or 16, found " + template_param_length); in.readRemainder(); data_bar = new DataBarFormatting(in); } else if (type == CONDITION_TYPE_FILTER) { filter_data = in.readRemainder(); } else if (type == CONDITION_TYPE_ICON_SET) { multistate = new IconMultiStateFormatting(in);
logger.log(POILogger.WARN, "Hyperlink data remains: " + in.remaining() + " : " +HexDump.toHex(in.readRemainder()) );