How do I quickly save a large number of variables?

I have a large number of variables (263,169 to be exact, what I am trying to save is the terrain heights), and every way I have tried saving them has not seemed to work because it takes way to long. Does anyone have an easy way of saving them?
Thanks!

Convert the 2D array of floats to a 1D arrays of bytes, then use File.WriteAllBytes with that array. (That’s what Fractscape does when saving the terrain heightmap, and it takes a fraction of a second to export a 513x513 terrain.)

Have you tried using an array?

What are the different ways you have tried saving them?
For that amount I’d suggest using a database engine of some sort.

Most people tried some sort of image map and that seems to work fine. Have you tried saving the data as a simple image object? Do a search for terrain image map here in the forums. That might help.

Okay, I tried making my 2d array into a 1D array, and it seems to work, but where does it save my file?
Here is the code, thanks!

import System.IO;
var TerrainD:Terrain;
function Start () {

var TD = TerrainD.terrainData;
var heights:float[,] = TD.GetHeights(0,0,512,512);
var BigArray = new byte[263169];
print(BigArray.length);
var Inte = 0;
for (var y : int = 0; y < 512; ++y) {
	for (var x : int = 0; x < 512; ++x) {
		BigArray[Inte] = Mathf.Round(Mathf.Lerp(0,65535,heights[y,x]));
		Inte+=1;
	}
}
print(Time.time);
// Apply all SetPixel calls
File.WriteAllBytes( "/Hello.ini", BigArray);
}

To be more exact, where is it saving Hello.ini? Also, the code doesn’t seem to be working because it doesn’t seem to be creating a file.