Esempio n. 1
0
void block_file::write_block(int position, const block &b) {
	ASSERTION(position < get_block_count());
	ASSERTION(b.get_size() == block_size);

	file.seekp(position * block_size);
	file.write(b.raw_char_pointer(), block_size);
}
Esempio n. 2
0
void block_file::append_block(const block &b) {
	ASSERTION(b.get_size() == block_size);

	file.seekp(0, ios_base::end);
	file.write(b.raw_char_pointer(), block_size);
}