function copyView( arr, dtype ) {
	var x;

	// Create a new "base" view, thus ensuring we have an `.iget` method and associated meta data...
	x = new ndarray( getDType( arr ), getData( arr ), getShape( arr ), getStrides( arr ), getOffset( arr ), getOrder( arr ) ); // eslint-disable-line max-len

	if ( dtype === 'generic' ) {
		return generic( x );
	}
	if ( dtype === 'binary' ) {
		return binary( x );
	}
	return typed( x, dtype );
}
Copies an ndarray view to a data buffer.

@private
@param {ndarray} arr - input ndarray
@param {string} dtype - data type
@returns {(Array|TypedArray|Buffer)} output data buffer

@example
var ndarray = require( '@stdlib/ndarray/ctor' );

var buffer = [ 1.0, 2.0, 3.0 ];
var shape = [ 3 ];
var strides = [ -1 ];
var vec = ndarray( 'generic', buffer, shape, strides, 2, 'row-major' );

var b = copyView( vec, 'float64' );
// returns <Float64Array>[ 3.0, 2.0, 1.0 ]