I have voxel files of 1billion voxels, every voxel is true/false and is kept in a 1D boolean array.
What is a good way to copy it to disk, for example as bytes/ a 0100010101 ASCII file, where i can read the file back into memory fast and efficiently?
At the moment i can write files to disk using:
savePath = System.IO.Directory.GetParent(Application.dataPath).ToString()+ "/Saved_Files" ;
var sw : System.IO.StreamWriter;
I don't know the best way to read and write 1-2gb files.
This is what i wrote for the moment:
function saveBW(){
//var SW2 : System.IO.StreamWriter;
var timeString = DateTime.Now.ToString("HH-mm");
var fileNameFromFolder= Path.GetFileNameWithoutExtension(QPath[QDone]);
fileNameFromFolder = stripTrailingSlash(fileNameFromFolder);
PLYname = "MK5_aliased_" + fileNameFromFolder + "_"+ timeString + ".Bo0L" ;
var str ="";
var SW2 = new System.IO.StreamWriter(savePath + "/" + PLYname);
for( var tr = 0 ; tr < mesher.supernormous.Length ; tr++ )
{
str += mesher.supernormous ? 1 : 0;
if(tr%255==0)SW2.Write(str);
}
SW2.Write(str);
SW2.Flush();
SW2.Close();
}