Read the input stream
Added a skeleton outline
build a table of the characters, their code lengths, and sorts them