buffer: implement reallocation (aka buffer re-specification)