Move finish out of the Encoder trait.
#98160
Merged
finish out of the Encoder trait.
#98160