void CheckSegmentNo(int segmentNo) { if(segmentNo < 0 || segmentNo >= SegmentCount) { throw new ArgumentOutOfRangeException("segmentNo"); } }