public void setValueAt(int relativeOffset, int value) { int oldValue = _values[relativeOffset]; _values[relativeOffset] = value; // Do we need to re-compute the free? if(value == POIFSConstants.UNUSED_BLOCK) { _has_free_sectors = true; return; } if(oldValue == POIFSConstants.UNUSED_BLOCK) { recomputeFree(); } }
/** * Create a single BATBlock from the byte buffer, which must hold at least * one big block of data to be read. */ public static BATBlock createBATBlock(final POIFSBigBlockSize bigBlockSize, ByteBuffer data) { // Create an empty block BATBlock block = new BATBlock(bigBlockSize); // Fill it byte[] buffer = new byte[LittleEndian.INT_SIZE]; for(int i=0; i<block._values.length; i++) { data.get(buffer); block._values[i] = LittleEndian.getInt(buffer); } block.recomputeFree(); // All done return block; }
public void setValueAt(int relativeOffset, int value) { int oldValue = _values[relativeOffset]; _values[relativeOffset] = value; // Do we need to re-compute the free? if(value == POIFSConstants.UNUSED_BLOCK) { _has_free_sectors = true; return; } if(oldValue == POIFSConstants.UNUSED_BLOCK) { recomputeFree(); } }
public void setValueAt(int relativeOffset, int value) { int oldValue = _values[relativeOffset]; _values[relativeOffset] = value; // Do we need to re-compute the free? if(value == POIFSConstants.UNUSED_BLOCK) { _has_free_sectors = true; return; } if(oldValue == POIFSConstants.UNUSED_BLOCK) { recomputeFree(); } }
public void setValueAt(int relativeOffset, int value) { int oldValue = _values[relativeOffset]; _values[relativeOffset] = value; // Do we need to re-compute the free? if(value == POIFSConstants.UNUSED_BLOCK) { _has_free_sectors = true; return; } if(oldValue == POIFSConstants.UNUSED_BLOCK) { recomputeFree(); } }
/** * Create a single instance initialized (perhaps partially) with entries * * @param entries the array of block allocation table entries * @param start_index the index of the first entry to be written * to the block * @param end_index the index, plus one, of the last entry to be * written to the block (writing is for all index * k, start_index <= k < end_index) */ private BATBlock(POIFSBigBlockSize bigBlockSize, final int [] entries, final int start_index, final int end_index) { this(bigBlockSize); for (int k = start_index; k < end_index; k++) { _values[k - start_index] = entries[k]; } // Do we have any free sectors? if(end_index - start_index == _values.length) { recomputeFree(); } }
/** * Create a single instance initialized (perhaps partially) with entries * * @param entries the array of block allocation table entries * @param start_index the index of the first entry to be written * to the block * @param end_index the index, plus one, of the last entry to be * written to the block (writing is for all index * k, start_index <= k < end_index) */ private BATBlock(POIFSBigBlockSize bigBlockSize, final int [] entries, final int start_index, final int end_index) { this(bigBlockSize); for (int k = start_index; k < end_index; k++) { _values[k - start_index] = entries[k]; } // Do we have any free sectors? if(end_index - start_index == _values.length) { recomputeFree(); } }
/** * Create a single BATBlock from the byte buffer, which must hold at least * one big block of data to be read. */ public static BATBlock createBATBlock(final POIFSBigBlockSize bigBlockSize, ByteBuffer data) { // Create an empty block BATBlock block = new BATBlock(bigBlockSize); // Fill it byte[] buffer = new byte[LittleEndian.INT_SIZE]; for(int i=0; i<block._values.length; i++) { data.get(buffer); block._values[i] = LittleEndian.getInt(buffer); } block.recomputeFree(); // All done return block; }
/** * Create a single BATBlock from the byte buffer, which must hold at least * one big block of data to be read. */ public static BATBlock createBATBlock(final POIFSBigBlockSize bigBlockSize, ByteBuffer data) { // Create an empty block BATBlock block = new BATBlock(bigBlockSize); // Fill it byte[] buffer = new byte[LittleEndian.INT_SIZE]; for(int i=0; i<block._values.length; i++) { data.get(buffer); block._values[i] = LittleEndian.getInt(buffer); } block.recomputeFree(); // All done return block; }
/** * Create a single BATBlock from the byte buffer, which must hold at least * one big block of data to be read. */ public static BATBlock createBATBlock(final POIFSBigBlockSize bigBlockSize, ByteBuffer data) { // Create an empty block BATBlock block = new BATBlock(bigBlockSize); // Fill it byte[] buffer = new byte[LittleEndian.INT_SIZE]; for(int i=0; i<block._values.length; i++) { data.get(buffer); block._values[i] = LittleEndian.getInt(buffer); } block.recomputeFree(); // All done return block; }