feat: support variable length buffers