示例#1
0
文件: ChunkReader.cs 项目: uu3474/ess
        public ChunkReader(int id, long bufferSize)
        {
            ID         = id;
            BufferSize = bufferSize;
            _chunk     = new StreamReader(Consts.GetChunkFileName(id));
            _buffer    = new Queue <ProblemString>();

            Load();
        }
示例#2
0
        public void Write()
        {
            Console.WriteLine($"Start write chunk {ID}, {_data.Count} lines");
            var stopwatch = Stopwatch.StartNew();

            File.WriteAllLines(Consts.GetChunkFileName(ID), _data.Select(x => x.RawString));
            stopwatch.Stop();
            Console.WriteLine($"Write chunk {ID} DONE in {stopwatch.Elapsed}, {_data.Count} lines");
        }