/** * Writes the SBATs to their backing blocks, and updates * the mini-stream size in the properties. Stream size is * based on full blocks used, not the data within the streams */ void syncWithDataSource() throws IOException { int blocksUsed = 0; for (BATBlock sbat : _sbat_blocks) { ByteBuffer block = _filesystem.getBlockAt(sbat.getOurBlockIndex()); sbat.writeData(block); if (!sbat.hasFreeSectors()) { blocksUsed += _filesystem.getBigBlockSizeDetails().getBATEntriesPerBlock(); } else { blocksUsed += sbat.getUsedSectors(false); } } // Set the size on the root in terms of the number of SBAT blocks // RootProperty.setSize does the sbat -> bytes conversion for us _filesystem._get_property_table().getRoot().setSize(blocksUsed); } }
int sectorsPerSBAT = _filesystem.getBigBlockSizeDetails().getBATEntriesPerBlock(); BATBlock newSBAT = BATBlock.createEmptyBATBlock(_filesystem.getBigBlockSizeDetails(), false); int batForSBAT = _filesystem.getFreeBlock(); newSBAT.setOurBlockIndex(batForSBAT);
/** * Writes the SBATs to their backing blocks, and updates * the mini-stream size in the properties. Stream size is * based on full blocks used, not the data within the streams */ void syncWithDataSource() throws IOException { int blocksUsed = 0; for (BATBlock sbat : _sbat_blocks) { ByteBuffer block = _filesystem.getBlockAt(sbat.getOurBlockIndex()); sbat.writeData(block); if (!sbat.hasFreeSectors()) { blocksUsed += _filesystem.getBigBlockSizeDetails().getBATEntriesPerBlock(); } else { blocksUsed += sbat.getUsedSectors(false); } } // Set the size on the root in terms of the number of SBAT blocks // RootProperty.setSize does the sbat -> bytes conversion for us _filesystem._get_property_table().getRoot().setSize(blocksUsed); } }
int sectorsPerSBAT = _filesystem.getBigBlockSizeDetails().getBATEntriesPerBlock(); BATBlock newSBAT = BATBlock.createEmptyBATBlock(_filesystem.getBigBlockSizeDetails(), false); int batForSBAT = _filesystem.getFreeBlock(); newSBAT.setOurBlockIndex(batForSBAT);