Add missing magic encoding comments
Change buffer to behave like a stream