public FileSegment(int index, long start, long end, FileSegmentType type) { Index = index; Start = start; End = end; Type = type; Key = new FileSegmentKey(index, type); }
public FileSegmentKey(int index, FileSegmentType type) { _type = type; if (type == FileSegmentType.Tail) { _value = -1; } else { if (index < 0) { throw new ArgumentOutOfRangeException(nameof(index)); } _value = index; } }