Change the codec for this stream.

Property definitions

core $ Stream :: codec=
	# Change the codec for this stream.
	fun codec=(c: Codec) do
		if c.max_lookahead > lookahead_capacity then
			var lcap = codec.max_lookahead
			var lk = new CString(lcap)
			var llen = lookahead_length
			if llen > 0 then
				lookahead.copy_to(lk, llen, 0, 0)
			end
			lookahead = lk
			lookahead_capacity = lcap
			write_buffer = new CString(lcap)
		end
		set_codec(c)
	end
lib/core/stream.nit:60,2--74,4