Adaptive / Dynamic Huffman coding implementation in Java