v2025.6.2
All Bundles

FileReaderWriter

Supports file read and write operations

Operations

Close

Closes the file

method : public : Close() ~ Nil

New

Default constructor.

New(name:System.String)

Parameters

NameTypeDescription
nameStringfilename

ReadBinaryFile

Reads a file's contents into byte array

function : ReadBinaryFile(name:String) ~ Byte[]

Parameters

NameTypeDescription
nameStringfilename

Return

TypeDescription
Bytebyte array, Nil if file is not found

ReadBuffer

Reads bytes into a character buffer

method : public : ReadBuffer(offset:Int, num:Int, buffer:Char[]) ~ Int

Parameters

NameTypeDescription
offsetIntdestination buffer offset
numIntnumber of values to read
bufferCharinput buffer

Return

TypeDescription
Intnumber of values read

ReadBuffer

Reads bytes into a byte buffer

method : public : ReadBuffer(offset:Int, num:Int, buffer:Byte[]) ~ Int

Parameters

NameTypeDescription
offsetIntdestination buffer offset
numIntnumber of values to read
bufferByteinput buffer

Return

TypeDescription
Intnumber of values read

ReadByte

Reads a byte

method : public : ReadByte() ~ Byte

Return

TypeDescription
Bytebyte read

ReadFile

Reads a file's contents into a string

function : ReadFile(name:String) ~ String

Parameters

NameTypeDescription
nameStringfilename

Return

TypeDescription
Stringcharacter string, Nil if file is not found

ReadLine

Reads a string until a newline or character return is detected

method : public : ReadLine() ~ System.String

Return

TypeDescription
Stringcharacter string

Temp

Creates a temporary file

function : Temp() ~ FileWriter

WriteBuffer

Writes bytes from a buffer

method : public : WriteBuffer(buffer:Byte[]) ~ Int

Parameters

NameTypeDescription
bufferByteoutput buffer

Return

TypeDescription
Inttrue if successful, false otherwise

WriteBuffer

Writes bytes from a buffer

method : public : WriteBuffer(offset:Int, num:Int, buffer:Byte[]) ~ Int

Parameters

NameTypeDescription
offsetIntdestination buffer offset
numIntnumber of values to write
bufferByteoutput buffer

Return

TypeDescription
Intnumber of values written

WriteBuffer

Writes characters from a buffer

method : public : WriteBuffer(buffer:Char[]) ~ Int

Parameters

NameTypeDescription
bufferCharoutput buffer

Return

TypeDescription
Inttrue if successful, false otherwise

WriteBuffer

Writes characters from a buffer

method : public : WriteBuffer(offset:Int, num:Int, buffer:Char[]) ~ Int

Parameters

NameTypeDescription
offsetIntdestination buffer offset
numIntnumber of values to write
bufferCharinput buffer

Return

TypeDescription
Intnumber of values written

WriteByte

Writes a byte

method : public : WriteByte(b:Int) ~ Bool

Parameters

NameTypeDescription
bIntbyte to write

Return

TypeDescription
Booltrue if byte was written, false otherwise

WriteFile

Write string to file

function : WriteFile(name:String, content:String) ~ Bool

Parameters

NameTypeDescription
nameStringfilename
contentStringstring to write

Return

TypeDescription
Booltrue if successful, false otherwise

WriteFile

Write bytes to file

function : WriteFile(name:String, content:Byte[]) ~ Bool

Parameters

NameTypeDescription
nameStringfilename
contentByteto write

Return

TypeDescription
Booltrue if successful, false otherwise

WriteString

Writes a character string

method : public : WriteString(str:System.String) ~ Nil

Parameters

NameTypeDescription
strStringstring to be written