Home

FileWriter

Supports file write operations

Derived from: File

Implements: OutputStream

Operations

New

Opens a new file.

New(name:String)
Parameters
NameTypeDescription
nameStringfile name

Opens a new file or appends to an existing one.

New(name:String, append:Bool)
Parameters
NameTypeDescription
nameStringfile name
appendBoolif true, opens a file for appending otherwise creates a new file

Close

Closes a file

method : public : Close() ~ Nil

Flush

Flushes the file buffer

method : public : Flush() ~ Nil

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
bufferByte[]input buffer

Return
TypeDescription
Intnumber of values written

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
bufferChar[]input buffer

Return
TypeDescription
Intnumber of values written

Writes bytes from a buffer

method : public : WriteBuffer(buffer:Byte[]) ~ Int
Parameters
NameTypeDescription
bufferByte[]input buffer

Return
TypeDescription
Intnumber of values written

Writes characters from a buffer

method : public : WriteBuffer(buffer:Char[]) ~ Int
Parameters
NameTypeDescription
bufferChar[]input 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

WriteString

Writes a character string

method : public : WriteString(str:String) ~ Nil
Parameters
NameTypeDescription
strStringstring to be written