private void Merge(string firstPointer, string secondPointer, int steep, int chunkNumber, string output = null) { if (firstPointer != null && secondPointer != null) { using (var first = _manager.GetReader(firstPointer)) using (var second = _manager.GetReader(secondPointer)) using (var writer = output != null ? _manager.GetWriter(output) : _manager.GetWriter(steep, chunkNumber)) { string data1 = null; string data2 = second.Read(); while (!first.IsEnd || !second.IsEnd) { data1 = first.Read(); while (!second.IsEnd && _comparer.Compare(data1, data2) >= 0) { writer.Write(data2); data2 = second.Read(); } writer.Write(data1); } writer.Write(data2); } } }