Added copy function to Buffer.