Utilize more general copy function instead of extract
Support read and write with scalar data sets