lib: encoder => buffer