(defun make-cbuffer-writer (fn) (lambda (data buf) (let ((stream (make-cbuffer-output-stream :cbuffer buf))) (funcall fn data stream))))