Reduce code duplication in the implementation of `ReadLine()` and its helper functions, by introducing core helper functions dispatched on the destination type, and definining function templates uniformly in terms of them.
Reduce code duplication in the implementation of `ReadLine()` and its helper
functions, by introducing core helper functions dispatched on the destination
type, and definining function templates uniformly in terms of them.

PiperOrigin-RevId: 369180838

google/riegeli,google/riegeli,google/riegeli,google/riegeli