final OutputBitStream permutedSizes = new OutputBitStream( batchBasename( batch, basename, batchDir ) + DiskBasedIndex.SIZES_EXTENSION );
for ( int i = 0, d = 0; i < documentCount; i++ ) {
while ( d++ < document[ i ] )
permutedSizes.writeGamma( 0 );
permutedSizes.writeGamma( size[ i ] );
}
permutedSizes.close();
}
}