Adding a duplicate-buffer convenience function.