implement buffer-push and writer