generic buffer creation