public void Reset() { manager.finished = false; manager.totalRead = 0; manager.fileCursor = 0; manager.start = 0; manager.end = manager.bufferLength - 1; manager.Next(); }
/// <summary> /// Read part files and processes them, then write result in a new file. /// </summary> private void TreatFile() { MemoryReaderFileManager readerManager = new MemoryReaderFileManager(this.bufferLength, filePath); long fileSize = readerManager.fileLength; int start, end; SetStartEnd(readerManager, out start, out end); byte[] pointer = Treat(readerManager.buffer, readerManager, start, end); Persist(this.writer, pointer, start, end); while (!readerManager.finished) { readerManager.Next(); SetStartEnd(readerManager, out start, out end); pointer = Treat(readerManager.buffer, readerManager, start, end); Persist(this.writer, pointer, start, end); } readerManager.Close(); this.Close(); }