Currently EncoderDecoder.Feed.consume is utilized for both Decoder.Feed and Encoder.Feed, and accepts a Byte for both operations. This results in a lot of conversions between Byte to Char and Char to Byte.
Because we can't specify the Char type using generics (JS does not do Chars), consume and consumeProtected must become wholly separate methods implemented on each Decoder.Feed and Encoder.Feed with the correct input types, Char and Byte respectively.
Furthermore, OutFeed should also be separate interfaces for each operation. Encoder.OutFeed which outputs a Char, and Decoder.OutFeed which outputs a Byte
Currently
EncoderDecoder.Feed.consume
is utilized for bothDecoder.Feed
andEncoder.Feed
, and accepts aByte
for both operations. This results in a lot of conversions betweenByte
toChar
andChar
toByte
.Because we can't specify the
Char
type using generics (JS does not doChar
s),consume
andconsumeProtected
must become wholly separate methods implemented on eachDecoder.Feed
andEncoder.Feed
with the correct input types,Char
andByte
respectively.Furthermore,
OutFeed
should also be separate interfaces for each operation.Encoder.OutFeed
which outputs aChar
, andDecoder.OutFeed
which outputs aByte