System.arraycopy(array, offset, _raw_data, 0, POIFSConstants.PROPERTY_SIZE); _name_size = new ShortField(_name_size_offset, _raw_data); _property_type = new ByteField(PropertyConstants.PROPERTY_TYPE_OFFSET, _raw_data); _size = new IntegerField(_size_offset, _raw_data); _index = index; int name_length = (_name_size.get() / LittleEndianConsts.SHORT_SIZE) - 1; char_array[ j ] = ( char ) new ShortField(name_offset, _raw_data).get(); name_offset += LittleEndianConsts.SHORT_SIZE;
/** * Construct the ShortField 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 ShortField(final int offset, final byte [] data) throws ArrayIndexOutOfBoundsException { this(offset); readFromBytes(data); }
/** * Set the name; silently truncates the name if it's too long. * * @param name the new name */ protected void setName(String name) { char[] char_array = name.toCharArray(); int limit = Math.min(char_array.length, _max_name_length); _name = new String(char_array, 0, limit); short offset = 0; int j = 0; for (; j < limit; j++) { new ShortField(offset, ( short ) char_array[ j ], _raw_data); offset += LittleEndianConsts.SHORT_SIZE; } for (; j < _max_name_length + 1; j++) { new ShortField(offset, ( short ) 0, _raw_data); offset += LittleEndianConsts.SHORT_SIZE; } // double the count, and include the null at the end _name_size .set(( short ) ((limit + 1) * LittleEndianConsts.SHORT_SIZE), _raw_data); }
new IntegerField(0x10, 0, _data); new IntegerField(0x14, 0, _data); new ShortField(0x18, ( short ) 0x3b, _data); new ShortField(0x1a, ( short ) 0x3, _data); new ShortField(0x1c, ( short ) -2, _data); new ShortField(0x1e, bigBlockSize.getHeaderValue(), _data); new IntegerField(0x20, 0x6, _data); new IntegerField(0x24, 0, _data);
/** * construct the ShortField 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 offset is negative */ public ShortField(final int offset, final short value) throws ArrayIndexOutOfBoundsException { this(offset); set(value); }
/** * set the ShortField'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 out * of range */ public void set(final short value, final byte [] data) throws ArrayIndexOutOfBoundsException { _value = value; writeToBytes(data); }
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); }
/** * construct the ShortField with its offset into its containing * byte array, initialize its value, and write its value to its * byte array * * @param offset of the field within its byte array * @param value the initial value * @param data the byte array to write the value to * * @exception ArrayIndexOutOfBoundsException if offset is negative */ public ShortField(final int offset, final short value, final byte [] data) throws ArrayIndexOutOfBoundsException { this(offset); set(value, data); }
/** * set the ShortField'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 out * of range */ public void set(final short value, final byte [] data) throws ArrayIndexOutOfBoundsException { _value = value; writeToBytes(data); }
short _name_size = new ShortField(_name_size_offset, array).get(); _previous_property = new IntegerField(_previous_property_offset, array); _next_property = new IntegerField(_next_property_offset, array); char_array[ j ] = ( char ) new ShortField(name_offset, array).get(); name_offset += LittleEndianConsts.SHORT_SIZE;
/** * Set the name; silently truncates the name if it's too long. * * @param name the new name */ protected void setName(String name) { char[] char_array = name.toCharArray(); int limit = Math.min(char_array.length, _max_name_length); _name = new String(char_array, 0, limit); short offset = 0; int j = 0; for (; j < limit; j++) { new ShortField(offset, ( short ) char_array[ j ], _raw_data); offset += LittleEndianConsts.SHORT_SIZE; } for (; j < _max_name_length + 1; j++) { new ShortField(offset, ( short ) 0, _raw_data); offset += LittleEndianConsts.SHORT_SIZE; } // double the count, and include the null at the end _name_size .set(( short ) ((limit + 1) * LittleEndianConsts.SHORT_SIZE), _raw_data); }
new IntegerField(0x10, 0, _data); new IntegerField(0x14, 0, _data); new ShortField(0x18, ( short ) 0x3b, _data); new ShortField(0x1a, ( short ) 0x3, _data); new ShortField(0x1c, ( short ) -2, _data); new ShortField(0x1e, bigBlockSize.getHeaderValue(), _data); new IntegerField(0x20, 0x6, _data); new IntegerField(0x24, 0, _data);
/** * construct the ShortField 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 offset is negative */ public ShortField(final int offset, final short value) throws ArrayIndexOutOfBoundsException { this(offset); set(value); }
/** * set the ShortField'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 out * of range */ public void set(final short value, final byte [] data) throws ArrayIndexOutOfBoundsException { _value = value; writeToBytes(data); }
/** * Construct the ShortField 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 ShortField(final int offset, final byte [] data) throws ArrayIndexOutOfBoundsException { this(offset); readFromBytes(data); }
System.arraycopy(array, offset, _raw_data, 0, POIFSConstants.PROPERTY_SIZE); _name_size = new ShortField(_name_size_offset, _raw_data); _property_type = new ByteField(PropertyConstants.PROPERTY_TYPE_OFFSET, _raw_data); _size = new IntegerField(_size_offset, _raw_data); _index = index; int name_length = (_name_size.get() / LittleEndianConsts.SHORT_SIZE) - 1; char_array[ j ] = ( char ) new ShortField(name_offset, _raw_data).get(); name_offset += LittleEndianConsts.SHORT_SIZE;
/** * Set the name; silently truncates the name if it's too long. * * @param name the new name */ protected void setName(String name) { char[] char_array = name.toCharArray(); int limit = Math.min(char_array.length, _max_name_length); _name = new String(char_array, 0, limit); short offset = 0; int j = 0; for (; j < limit; j++) { new ShortField(offset, ( short ) char_array[ j ], _raw_data); offset += LittleEndianConsts.SHORT_SIZE; } for (; j < _max_name_length + 1; j++) { new ShortField(offset, ( short ) 0, _raw_data); offset += LittleEndianConsts.SHORT_SIZE; } // double the count, and include the null at the end _name_size .set(( short ) ((limit + 1) * LittleEndianConsts.SHORT_SIZE), _raw_data); }
new IntegerField(0x10, 0, _data); new IntegerField(0x14, 0, _data); new ShortField(0x18, ( short ) 0x3b, _data); new ShortField(0x1a, ( short ) 0x3, _data); new ShortField(0x1c, ( short ) -2, _data); new ShortField(0x1e, bigBlockSize.getHeaderValue(), _data); new IntegerField(0x20, 0x6, _data); new IntegerField(0x24, 0, _data);
/** * construct the ShortField 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 offset is negative */ public ShortField(final int offset, final short value) throws ArrayIndexOutOfBoundsException { this(offset); set(value); }
/** * set the ShortField'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 out * of range */ public void set(final short value, final byte [] data) throws ArrayIndexOutOfBoundsException { _value = value; writeToBytes(data); }