Throw EncodingError when not streaming and saved bytes/charcodes are not empty
use an arraybuffer instead of an array to store bytes while encoding
Use arraybuffer for decode insead of regular array
tweak to avoid using exceptions for error flows
tweaking formatting
Fix error from example plugin