Renamed readSegment method to make its purpose more clear.