Encode / Decode functional, no buffered IO.