writeVarint throws if number is too big