function arrayBufferToBase64( arrayBuffer ) {

	let chars = '';

	const array = new Uint8Array( arrayBuffer );

	for ( let i = 0; i < array.length; i ++ ) {

		chars += String.fromCharCode( array[ i ] );

	}

	return btoa( chars );

}
Converts the given array buffer to a Base64 string.

@method
@param {ArrayBuffer} arrayBuffer - The array buffer.
@return {string} The Base64 string.