Bundle Supports filesystem operations
FileReaderWriter
Supports file read and write operations
Inherits: File
Operations
- New
- Close
- ReadBinaryFile
- ReadBuffer
- ReadByte
- ReadFile
- ReadLine
- Temp
- WriteBuffer
- WriteByte
- WriteFile
- WriteString
New # constructor
Default constructor.
New(name:System.String)Parameters
| Name | Type | Description |
|---|---|---|
| name | String | filename |
ReadBinaryFile # function
Reads a file's contents into byte array
function : ReadBinaryFile(name:String) ~ Byte[]Parameters
| Name | Type | Description |
|---|---|---|
| name | String | filename |
Return
| Type | Description |
|---|---|
| Byte | byte array, Nil if file is not found |
ReadBuffer #
Reads bytes into a character buffer
method : public : ReadBuffer(offset:Int, num:Int, buffer:Char[]) ~ IntParameters
| Name | Type | Description |
|---|---|---|
| offset | Int | destination buffer offset |
| num | Int | number of values to read |
| buffer | Char | input buffer |
Return
| Type | Description |
|---|---|
| Int | number of values read |
ReadBuffer #
Reads bytes into a byte buffer
method : public : ReadBuffer(offset:Int, num:Int, buffer:Byte[]) ~ IntParameters
| Name | Type | Description |
|---|---|---|
| offset | Int | destination buffer offset |
| num | Int | number of values to read |
| buffer | Byte | input buffer |
Return
| Type | Description |
|---|---|
| Int | number of values read |
ReadFile # function
Reads a file's contents into a string
function : ReadFile(name:String) ~ StringParameters
| Name | Type | Description |
|---|---|---|
| name | String | filename |
Return
| Type | Description |
|---|---|
| String | character string, Nil if file is not found |
ReadLine #
Reads a string until a newline or character return is detected
method : public : ReadLine() ~ System.StringReturn
| Type | Description |
|---|---|
| String | character string |
WriteBuffer #
Writes bytes from a buffer
method : public : WriteBuffer(buffer:Byte[]) ~ IntParameters
| Name | Type | Description |
|---|---|---|
| buffer | Byte | output buffer |
Return
| Type | Description |
|---|---|
| Int | true if successful, false otherwise |
WriteBuffer #
Writes bytes from a buffer
method : public : WriteBuffer(offset:Int, num:Int, buffer:Byte[]) ~ IntParameters
| Name | Type | Description |
|---|---|---|
| offset | Int | destination buffer offset |
| num | Int | number of values to write |
| buffer | Byte | output buffer |
Return
| Type | Description |
|---|---|
| Int | number of values written |
WriteBuffer #
Writes characters from a buffer
method : public : WriteBuffer(buffer:Char[]) ~ IntParameters
| Name | Type | Description |
|---|---|---|
| buffer | Char | output buffer |
Return
| Type | Description |
|---|---|
| Int | true if successful, false otherwise |
WriteBuffer #
Writes characters from a buffer
method : public : WriteBuffer(offset:Int, num:Int, buffer:Char[]) ~ IntParameters
| Name | Type | Description |
|---|---|---|
| offset | Int | destination buffer offset |
| num | Int | number of values to write |
| buffer | Char | input buffer |
Return
| Type | Description |
|---|---|
| Int | number of values written |
WriteByte #
Writes a byte
method : public : WriteByte(b:Int) ~ BoolParameters
| Name | Type | Description |
|---|---|---|
| b | Int | byte to write |
Return
| Type | Description |
|---|---|
| Bool | true if byte was written, false otherwise |
WriteFile # function
Write string to file
function : WriteFile(name:String, content:String) ~ BoolParameters
| Name | Type | Description |
|---|---|---|
| name | String | filename |
| content | String | string to write |
Return
| Type | Description |
|---|---|
| Bool | true if successful, false otherwise |