If we know the correspondence from integers to characters, and we can express that
as a string, then everything else can be derived
This class is explicitly not a java.nio.charset.Charset.
It is a BitsCharset, which is not a compatible type with a java.nio.charset.Charset
on purpose so we don't confuse the two.
The problem is that java.nio.charset.Charset is designed in such a way that
one cannot implement a proxy class that redirects methods to another class.
This is due to all the final methods on the class.
So instead we do the opposite. We implement our own BitsCharset API,
but implement the behavior in terms of a proxy JavaCharsetDecoder and proxy
JavaCharsetEncoder that drive the decodeLoop and encodeLoop. This way
we don't have to re-implement all the error handling and flush/end logic.
Linear Supertypes
BitsCharset, Serializable, Serializable, AnyRef, Any
Some encodings are not byte-oriented.
If we know the correspondence from integers to characters, and we can express that as a string, then everything else can be derived
This class is explicitly not a java.nio.charset.Charset. It is a BitsCharset, which is not a compatible type with a java.nio.charset.Charset on purpose so we don't confuse the two.
The problem is that java.nio.charset.Charset is designed in such a way that one cannot implement a proxy class that redirects methods to another class. This is due to all the final methods on the class.
So instead we do the opposite. We implement our own BitsCharset API, but implement the behavior in terms of a proxy JavaCharsetDecoder and proxy JavaCharsetEncoder that drive the decodeLoop and encodeLoop. This way we don't have to re-implement all the error handling and flush/end logic.