typical chunked stdin/stdout conversion example