Charset codecs are used throughout ribose code. Storing them in a ThreadLocal<Codec> on first use allows them to be accessed anywhere. IModel.close() implementations detach the ThreadLocal<Codec> instance from the calling thread. But
threads that do not directly or indirectly (try-with-resources) call IModel.close()call the static IModel.detach() method to rid themselves of the thread local Codec instance.
Charset codecs are used throughout ribose code. Storing them in a
ThreadLocal<Codec>
on first use allows them to be accessed anywhere.IModel.close()
implementations detach theThreadLocal<Codec>
instance from the calling thread. But threads that do not directly or indirectly (try-with-resources) callIModel.close()
call the staticIModel.detach()
method to rid themselves of the thread localCodec
instance.