Implemented encoding protocols for stream channels (fixes #53)