private void WriteBuf(ulong[] buf, int id)
        {
            Array.Sort(buf);

            var name = GetName(id);

            SpatialData.WriteSequence(buf, name);

            FileWritten(id, 0);
        }
        private void Merge(int level, int[] fileIds, int resultFileId)
        {
            var source = CreateMergedSource(fileIds);

            SpatialData.WriteSequence(source, GetName(resultFileId));

            FileWritten(resultFileId, level);
            foreach (var fileId in fileIds)
            {
                File.Delete(GetName(fileId));
            }
        }