Add duplicate() and copy() operations to Buffer.