}
for (int i = 0; i < miniBlocksToFlush; i++) {
//writing i th miniblock
int currentBitWidth = bitWidths[i];
BytePacker packer = Packer.LITTLE_ENDIAN.newBytePacker(currentBitWidth);
int miniBlockStart = i * config.miniBlockSizeInValues;
for (int j = miniBlockStart; j < (i + 1) * config.miniBlockSizeInValues; j += 8) {//8 values per pack
// mini block is atomic in terms of flushing
// This may write more values when reach to the end of data writing to last mini block,
// since it may not be aligend to miniblock,
// but doesnt matter. The reader uses total count to see if reached the end.
packer.pack8Values(deltaBlockBuffer, j, miniBlockByteBuffer, 0);
baos.write(miniBlockByteBuffer, 0, currentBitWidth);
}
}
minDeltaInCurrentBlock = Integer.MAX_VALUE;