/** * Write the block's data to an OutputStream * * @param stream the OutputStream to which the stored data should * be written * * @exception IOException on problems writing to the specified * stream */ public void writeData(final OutputStream stream) throws IOException { // Update the counts and start positions new IntegerField(_bat_count_offset, _bat_count, _data); new IntegerField(_property_start_offset, _property_start, _data); new IntegerField(_sbat_start_offset, _sbat_start, _data); new IntegerField(_sbat_block_count_offset, _sbat_count, _data); new IntegerField(_xbat_start_offset, _xbat_start, _data); new IntegerField(_xbat_count_offset, _xbat_count, _data); // Write the main data out stream.write(_data, 0, 512); // Now do the padding if needed for(int i=POIFSConstants.SMALLER_BIG_BLOCK_SIZE; i<bigBlockSize.getBigBlockSize(); i++) { stream.write(0); } } }
/** * find out the document size * * @return size in bytes */ public int getSize() { return _size.get(); }
/** * Construct the IntegerField with its offset into its containing * byte array and initialize its value from its byte array * * @param offset of the field within its byte array * @param data the byte array to read the value from * * @exception ArrayIndexOutOfBoundsException if the offset is not * within the range of 0..(data.length - 1) */ public IntegerField(final int offset, final byte [] data) throws ArrayIndexOutOfBoundsException { this(offset); readFromBytes(data); }
_bat_count = new IntegerField(_bat_count_offset, data).get(); _property_start = new IntegerField(_property_start_offset,_data).get(); _sbat_start = new IntegerField(_sbat_start_offset, _data).get(); _sbat_count = new IntegerField(_sbat_block_count_offset, _data).get(); _xbat_start = new IntegerField(_xbat_start_offset, _data).get(); _xbat_count = new IntegerField(_xbat_count_offset, _data).get();
/** * Set the child property. * * @param child the child property's index in the Property Table */ protected void setChildProperty(int child) { _child_property.set(child, _raw_data); }
/** * set the IntegerField's current value and write it to a byte * array * * @param value to be set * @param data the byte array to write the value to * * @exception ArrayIndexOutOfBoundsException if the offset is too * large */ public void set(final int value, final byte [] data) throws ArrayIndexOutOfBoundsException { _value = value; writeToBytes(data); }
_bat_count = new IntegerField(_bat_count_offset, data).get(); _property_start = new IntegerField(_property_start_offset,_data).get(); _sbat_start = new IntegerField(_sbat_start_offset, _data).get(); _sbat_count = new IntegerField(_sbat_block_count_offset, _data).get(); _xbat_start = new IntegerField(_xbat_start_offset, _data).get(); _xbat_count = new IntegerField(_xbat_count_offset, _data).get();
/** * Set the start block for the document referred to by this * Property. * * @param startBlock the start block index */ public void setStartBlock(int startBlock) { _start_block.set(startBlock, _raw_data); }
/** * set the IntegerField's current value and write it to a byte * array * * @param value to be set * @param data the byte array to write the value to * * @exception ArrayIndexOutOfBoundsException if the offset is too * large */ public void set(final int value, final byte [] data) throws ArrayIndexOutOfBoundsException { _value = value; writeToBytes(data); }
/** * Get the child property (its index in the Property Table) * * @return child property index */ protected int getChildIndex() { return _child_property.get(); }
protected Property() { _raw_data = new byte[ POIFSConstants.PROPERTY_SIZE ]; Arrays.fill(_raw_data, _default_fill); _name_size = new ShortField(_name_size_offset); _property_type = new ByteField(PropertyConstants.PROPERTY_TYPE_OFFSET); _node_color = new ByteField(_node_color_offset); _previous_property = new IntegerField(_previous_property_offset, _NO_INDEX, _raw_data); _next_property = new IntegerField(_next_property_offset, _NO_INDEX, _raw_data); _child_property = new IntegerField(_child_property_offset, _NO_INDEX, _raw_data); _storage_clsid = new ClassID(_raw_data,_storage_clsid_offset); _user_flags = new IntegerField(_user_flags_offset, 0, _raw_data); _seconds_1 = new IntegerField(_seconds_1_offset, 0, _raw_data); _days_1 = new IntegerField(_days_1_offset, 0, _raw_data); _seconds_2 = new IntegerField(_seconds_2_offset, 0, _raw_data); _days_2 = new IntegerField(_days_2_offset, 0, _raw_data); _start_block = new IntegerField(_start_block_offset); _size = new IntegerField(_size_offset, 0, _raw_data); _index = _NO_INDEX; setName(""); setNextChild(null); setPreviousChild(null); }
_bat_count = new IntegerField(_bat_count_offset, data).get(); _property_start = new IntegerField(_property_start_offset,_data).get(); _sbat_start = new IntegerField(_sbat_start_offset, _data).get(); _sbat_count = new IntegerField(_sbat_block_count_offset, _data).get(); _xbat_start = new IntegerField(_xbat_start_offset, _data).get(); _xbat_count = new IntegerField(_xbat_count_offset, _data).get();
/** * Set the size of the document associated with this Property * * @param size the size of the document, in bytes */ protected void setSize(int size) { _size.set(size, _raw_data); }
/** * Construct the IntegerField with its offset into its containing * byte array and initialize its value from its byte array * * @param offset of the field within its byte array * @param data the byte array to read the value from * * @exception ArrayIndexOutOfBoundsException if the offset is not * within the range of 0..(data.length - 1) */ public IntegerField(final int offset, final byte [] data) throws ArrayIndexOutOfBoundsException { this(offset); readFromBytes(data); }
/** * set the IntegerField's current value and write it to a byte * array * * @param value to be set * @param data the byte array to write the value to * * @exception ArrayIndexOutOfBoundsException if the offset is too * large */ public void set(final int value, final byte [] data) throws ArrayIndexOutOfBoundsException { _value = value; writeToBytes(data); }
/** * get the next sibling * * @return index of next sibling */ int getNextChildIndex() { return _next_property.get(); }
new IntegerField(0x08, 0, _data); new IntegerField(0x0c, 0, _data); new IntegerField(0x10, 0, _data); new IntegerField(0x14, 0, _data); new ShortField(0x18, ( short ) 0x3b, _data); new ShortField(0x1a, ( short ) 0x3, _data); new IntegerField(0x20, 0x6, _data); new IntegerField(0x24, 0, _data); new IntegerField(0x28, 0, _data); new IntegerField(0x34, 0, _data); new IntegerField(0x38, 0x1000, _data);
_bat_count = new IntegerField(_bat_count_offset, data).get(); _property_start = new IntegerField(_property_start_offset,_data).get(); _sbat_start = new IntegerField(_sbat_start_offset, _data).get(); _sbat_count = new IntegerField(_sbat_block_count_offset, _data).get(); _xbat_start = new IntegerField(_xbat_start_offset, _data).get(); _xbat_count = new IntegerField(_xbat_count_offset, _data).get();
/** * construct the IntegerField with its offset into its containing * byte array and initialize its value * * @param offset of the field within its byte array * @param value the initial value * * @exception ArrayIndexOutOfBoundsException if the offset is * negative */ public IntegerField(final int offset, final int value) throws ArrayIndexOutOfBoundsException { this(offset); set(value); }
/** * Construct the IntegerField with its offset into its containing * byte array and initialize its value from its byte array * * @param offset of the field within its byte array * @param data the byte array to read the value from * * @exception ArrayIndexOutOfBoundsException if the offset is not * within the range of 0..(data.length - 1) */ public IntegerField(final int offset, final byte [] data) throws ArrayIndexOutOfBoundsException { this(offset); readFromBytes(data); }