use buffered streams for reading and writing partial indexes in linear fashion for speedup