Changelog:
fixed a small decoding bug that causes the decoded file to be 1 byte bigger than the original;
improved memory management during the encoding process;