- doc encoder
- fix lazy buffer creation in encoder