local function u(u)local c=1 local function N()return c>#u end local function z()return string.byte(u,c)end local function r(N)N=N or 1 c+=N return string.byte(u,c-N,c-1)end return{eof=N;peek=z;byte=r}end return u
local function Stream(raw)
	local idx = 1

	local function eof()
		return idx > #raw
	end

	local function peek()
		return string.byte(raw, idx)
	end

	local function byte(n)
		n = n or 1
		idx += n
		return string.byte(raw, idx - n, idx - 1)
	end

	return {
		eof = eof,
		peek = peek,
		byte = byte,
	}
end

return Stream
