Add configuration values for encoding

* Add default value for encoding.global : true

* Add encoding.stream configuration key to allow stream encoding (no size check !)

* Add default value for encoding.stream : true
Refactor shouldEncode do handle stream

Should encode will not check stream size in encoding.stream is set to true in the configuration