+BitVector::BitVector(std::FILE * file) :
+ rank_index(0), select_index(0)
+{
+ std::fread(&(this->size), sizeof(this->size), 1, file);
+ std::fread(&(this->items), sizeof(this->items), 1, file);
+ std::fread(&(this->number_of_blocks), sizeof(this->number_of_blocks), 1, file);
+ std::fread(&(this->block_size), sizeof(this->block_size), 1, file);
+
+ this->array = new usint[this->block_size * this->number_of_blocks];
+ std::fread(this->array, sizeof(usint), this->block_size * this->number_of_blocks, file);
+ this->buffer = new FastBitBuffer(this->array, this->block_size);
+
+ this->integer_bits = length(this->size);
+ this->samples = new FastBitBuffer(file, 2 * (this->number_of_blocks + 1), this->integer_bits);
+
+ this->indexForRank();
+ this->indexForSelect();
+}
+