Closed 05nelsonm closed 1 year ago
flush()
should be available for both Encoder.Feed
and Decoder.Feed
.
Because of some of the implementations that hold on to some stateful data, this should be implemented in the following manner:
EncoderDecoder.Feed.flush
EncoderDecoder.Feed.flushProtected
Encoder.Feed
and Decoder.Feed
use final override flush
and call flushProtected
Implementors of EncoderDecoder.Feed
were required to OptIn
to the ExperimentalEncodingApi
, so this is a "non-breaking" change
Actually, this can be done w/o the need to break the current API
When using an
Encoder.Feed
directly, it'd be nice to be able to calldoFinal
w/o closing the feed so that multiple things can be encoded without having to instantiate a new feed. Having the ability to callflush
will open up the possibility to perform multiple encodings within the.use
lambda.