Added a buffer-copy function.