ES3.SaveRaw

public static void SaveRaw(byte[] bytes, string filePath, ES3Settings settings)

Description

Saves a byte array as a file, overwriting any existing files.

Parameters

[table th=”0″]bytes,”The bytes we want to save as a file.”

filePath,”[Optional] The relative or absolute path of the file we want to store our value to.”

settings,”[Optional] The settings we want to use to override the default settings.”[/table]

Examples

C#

// Saves a byte array as a file.
ES3.SaveRaw(byteArray, "myFile.txt");

JS

// Saves a byte array as a file.
ES3.SaveRaw(byteArray, "myFile.txt");

public static void SaveRaw(string str, string filePath, ES3Settings settings)

Description

Saves a string as a file, overwriting any existing files.

It will use the text encoding in the default settings to determine the encoding to use to store the string unless you provide a different encoding in an ES3Settings object provided as a parameter.

Because an encoding is applied, the string will be readable and editable in a text editor.

Parameters

[table th=”0″]str,”The string we want to save as a file.”

filePath,”[Optional] The relative or absolute path of the file we want to store our value to.”

settings,”[Optional] The settings we want to use to override the default settings.”[/table]

Examples

C#

// Create a string which we want to store as a file.
string str = "Line 1 \nLine2 \nLine3";
// Saves the string as a file.
ES3.SaveRaw(str, "myFile.txt");

JS

// Create a string which we want to store as a file.
var str : string = "Line 1 \nLine2 \nLine3";
// Saves the string as a file.
ES3.SaveRaw(str, "myFile.txt");