FileHandle

Overview

Low level file handle.

Location

  • Reference:
    • Elements.dll  .NET, .NET Standard 2.0
    • Elements.fx  Island-Android, Island-iOS, Island-iOS Simulator, Island-Mac Catalyst, Island-macOS, Island-tvOS, Island-tvOS Simulator, Island-Ubuntu, Island-watchOS, Island-watchOS Simulator, Island-Windows, ToffeeV2
    • libElements.fx  Toffee
  • Namespace: RemObjects.Elements.RTL
  • Platforms: .NET, .NET Standard 2.0, Island-Android, Island-iOS, Island-iOS Simulator, Island-Mac Catalyst, Island-macOS, Island-tvOS, Island-tvOS Simulator, Island-Ubuntu, Island-watchOS, Island-watchOS Simulator, Island-Windows, Toffee, ToffeeV2
  • Mapped to:
    • FileStream  .NET, .NET Standard 2.0, ToffeeV2
    • FileStream  Island-Android, Island-iOS, Island-iOS Simulator, Island-Mac Catalyst, Island-macOS, Island-tvOS, Island-tvOS Simulator, Island-Ubuntu, Island-watchOS, Island-watchOS Simulator, Island-Windows
    • NSFileHandle  Toffee

 

constructor

Creates a new file handle for the given filename.

 

constructor(FileName: String; Mode: FileOpenMode)

 

FileHandle(String FileName, FileOpenMode Mode)

 

init(_ FileName: String, _ Mode: FileOpenMode)

 

Sub New(FileName As String, Mode As FileOpenMode)

Parameters:

  • FileName:
  • Mode:

Close Island-Android, Island-iOS, Island-iOS Simulator, Island-Mac Catalyst, Island-macOS, Island-tvOS, Island-tvOS Simulator, Island-Ubuntu, Island-watchOS, Island-watchOS Simulator, Island-Windows, Toffee, ToffeeV2

Close the handle.

 

method Close

 

void Close()

 

func Close()

 

Sub Close()

Flush Island-Android, Island-iOS, Island-iOS Simulator, Island-Mac Catalyst, Island-macOS, Island-tvOS, Island-tvOS Simulator, Island-Ubuntu, Island-watchOS, Island-watchOS Simulator, Island-Windows, Toffee, ToffeeV2

Flush the changes to the file to disk.

 

method Flush

 

void Flush()

 

func Flush()

 

Sub Flush()

FromFile

Create a filehandle from a File object

 

class method FromFile(aFile: File; Mode: FileOpenMode): FileHandle

 

static FileHandle FromFile(File aFile, FileOpenMode Mode)

 

static func FromFile(_ aFile: File, _ Mode: FileOpenMode) -> FileHandle

 

Shared Function FromFile(aFile As File, Mode As FileOpenMode) As FileHandle

Parameters:

  • aFile:
  • Mode:

Length

Returns the size of this file.

 

property Length: Int64 read write;

 

Int64 Length { get; set; }

 

var Length: Int64 { get{} set{} }

 

Property Length() As Int64

Position

Returns the current position in this file.

 

property Position: Int64 read write;

 

Int64 Position { get; set; }

 

var Position: Int64 { get{} set{} }

 

Property Position() As Int64

Read (array of Byte, Int32): Int32 Island-Android, Island-iOS, Island-iOS Simulator, Island-Mac Catalyst, Island-macOS, Island-tvOS, Island-tvOS Simulator, Island-Ubuntu, Island-watchOS, Island-watchOS Simulator, Island-Windows, Toffee, ToffeeV2

Read Count bytes into buffer; returning the nr of bytes actually read. Returns 0 when the end has been reached.

 

method Read(Buffer: array of Byte; Count: Int32): Int32

 

Int32 Read(Byte[] Buffer, Int32 Count)

 

func Read(_ Buffer: Byte..., _ Count: Int32) -> Int32

 

Function Read(Buffer As Byte(), Count As Int32) As Int32

Parameters:

  • Buffer:
  • Count:

Read (array of Byte, Int32, Int32): Int32 Island-Android, Island-iOS, Island-iOS Simulator, Island-Mac Catalyst, Island-macOS, Island-tvOS, Island-tvOS Simulator, Island-Ubuntu, Island-watchOS, Island-watchOS Simulator, Island-Windows, Toffee, ToffeeV2

Read Count bytes into buffer; returning the nr of bytes actually read. Returns 0 when the end has been reached.

 

method Read(Buffer: array of Byte; Offset: Int32; Count: Int32): Int32

 

Int32 Read(Byte[] Buffer, Int32 Offset, Int32 Count)

 

func Read(_ Buffer: Byte..., _ Offset: Int32, _ Count: Int32) -> Int32

 

Function Read(Buffer As Byte(), Offset As Int32, Count As Int32) As Int32

Parameters:

  • Buffer:
  • Offset:
  • Count:

Read (Int32): ImmutableBinary Island-Android, Island-iOS, Island-iOS Simulator, Island-Mac Catalyst, Island-macOS, Island-tvOS, Island-tvOS Simulator, Island-Ubuntu, Island-watchOS, Island-watchOS Simulator, Island-Windows, Toffee, ToffeeV2

Read Count bytes from a file, returning it as binary.

 

method Read(Count: Int32): ImmutableBinary

 

ImmutableBinary Read(Int32 Count)

 

func Read(_ Count: Int32) -> ImmutableBinary

 

Function Read(Count As Int32) As ImmutableBinary

Parameters:

  • Count:

Read (array of Byte, Int32): Int32 .NET, .NET Standard 2.0

 

method Read(Buffer: array of Byte; Count: Int32): Int32

 

Int32 Read(Byte[] Buffer, Int32 Count)

 

func Read(_ Buffer: Byte..., _ Count: Int32) -> Int32

 

Function Read(Buffer As Byte(), Count As Int32) As Int32

Parameters:

  • Buffer:
  • Count:

Read (array of Byte, Int32, Int32): Int32 .NET, .NET Standard 2.0

 

method Read(Buffer: array of Byte; Offset: Int32; Count: Int32): Int32

 

Int32 Read(Byte[] Buffer, Int32 Offset, Int32 Count)

 

func Read(_ Buffer: Byte..., _ Offset: Int32, _ Count: Int32) -> Int32

 

Function Read(Buffer As Byte(), Offset As Int32, Count As Int32) As Int32

Parameters:

  • Buffer:
  • Offset:
  • Count:

Read (Int32): ImmutableBinary .NET, .NET Standard 2.0

 

method Read(Count: Int32): ImmutableBinary

 

ImmutableBinary Read(Int32 Count)

 

func Read(_ Count: Int32) -> ImmutableBinary

 

Function Read(Count As Int32) As ImmutableBinary

Parameters:

  • Count:

Seek (Int64, SeekOrigin) Island-Android, Island-iOS, Island-iOS Simulator, Island-Mac Catalyst, Island-macOS, Island-tvOS, Island-tvOS Simulator, Island-Ubuntu, Island-watchOS, Island-watchOS Simulator, Island-Windows, Toffee, ToffeeV2

Changes the position, relative to Origin.

 

method Seek(Offset: Int64; Origin: SeekOrigin)

 

void Seek(Int64 Offset, SeekOrigin Origin)

 

func Seek(_ Offset: Int64, _ Origin: SeekOrigin)

 

Sub Seek(Offset As Int64, Origin As SeekOrigin)

Parameters:

  • Offset:
  • Origin:

Seek (Int64, SeekOrigin) .NET, .NET Standard 2.0

 

method Seek(Offset: Int64; Origin: SeekOrigin)

 

void Seek(Int64 Offset, SeekOrigin Origin)

 

func Seek(_ Offset: Int64, _ Origin: SeekOrigin)

 

Sub Seek(Offset As Int64, Origin As SeekOrigin)

Parameters:

  • Offset:
  • Origin:

Write (array of Byte) Island-Android, Island-iOS, Island-iOS Simulator, Island-Mac Catalyst, Island-macOS, Island-tvOS, Island-tvOS Simulator, Island-Ubuntu, Island-watchOS, Island-watchOS Simulator, Island-Windows, Toffee, ToffeeV2

Write a byte array to this file.

 

method Write(Buffer: array of Byte)

 

void Write(Byte[] Buffer)

 

func Write(_ Buffer: Byte...)

 

Sub Write(Buffer As Byte())

Parameters:

  • Buffer:

Write (array of Byte, Int32) Island-Android, Island-iOS, Island-iOS Simulator, Island-Mac Catalyst, Island-macOS, Island-tvOS, Island-tvOS Simulator, Island-Ubuntu, Island-watchOS, Island-watchOS Simulator, Island-Windows, Toffee, ToffeeV2

Write a byte array to this file.

 

method Write(Buffer: array of Byte; Count: Int32)

 

void Write(Byte[] Buffer, Int32 Count)

 

func Write(_ Buffer: Byte..., _ Count: Int32)

 

Sub Write(Buffer As Byte(), Count As Int32)

Parameters:

  • Buffer:
  • Count:

Write (array of Byte, Int32, Int32) Island-Android, Island-iOS, Island-iOS Simulator, Island-Mac Catalyst, Island-macOS, Island-tvOS, Island-tvOS Simulator, Island-Ubuntu, Island-watchOS, Island-watchOS Simulator, Island-Windows, Toffee, ToffeeV2

Write a byte array to this file.

 

method Write(Buffer: array of Byte; Offset: Int32; Count: Int32)

 

void Write(Byte[] Buffer, Int32 Offset, Int32 Count)

 

func Write(_ Buffer: Byte..., _ Offset: Int32, _ Count: Int32)

 

Sub Write(Buffer As Byte(), Offset As Int32, Count As Int32)

Parameters:

  • Buffer:
  • Offset:
  • Count:

Write (ImmutableBinary) Island-Android, Island-iOS, Island-iOS Simulator, Island-Mac Catalyst, Island-macOS, Island-tvOS, Island-tvOS Simulator, Island-Ubuntu, Island-watchOS, Island-watchOS Simulator, Island-Windows, Toffee, ToffeeV2

Write a binary to a file.

 

method Write(Data: ImmutableBinary)

 

void Write(ImmutableBinary Data)

 

func Write(_ Data: ImmutableBinary)

 

Sub Write(Data As ImmutableBinary)

Parameters:

  • Data:

Write (array of Byte) .NET, .NET Standard 2.0

 

method Write(Buffer: array of Byte)

 

void Write(Byte[] Buffer)

 

func Write(_ Buffer: Byte...)

 

Sub Write(Buffer As Byte())

Parameters:

  • Buffer:

Write (array of Byte, Int32) .NET, .NET Standard 2.0

 

method Write(Buffer: array of Byte; Count: Int32)

 

void Write(Byte[] Buffer, Int32 Count)

 

func Write(_ Buffer: Byte..., _ Count: Int32)

 

Sub Write(Buffer As Byte(), Count As Int32)

Parameters:

  • Buffer:
  • Count:

Write (array of Byte, Int32, Int32) .NET, .NET Standard 2.0

 

method Write(Buffer: array of Byte; Offset: Int32; Count: Int32)

 

void Write(Byte[] Buffer, Int32 Offset, Int32 Count)

 

func Write(_ Buffer: Byte..., _ Offset: Int32, _ Count: Int32)

 

Sub Write(Buffer As Byte(), Offset As Int32, Count As Int32)

Parameters:

  • Buffer:
  • Offset:
  • Count:

Write (ImmutableBinary) .NET, .NET Standard 2.0

 

method Write(Data: ImmutableBinary)

 

void Write(ImmutableBinary Data)

 

func Write(_ Data: ImmutableBinary)

 

Sub Write(Data As ImmutableBinary)

Parameters:

  • Data:

 

Length

Returns the size of this file.

 

property Length: Int64 read write;

 

Int64 Length { get; set; }

 

var Length: Int64 { get{} set{} }

 

Property Length() As Int64

Position

Returns the current position in this file.

 

property Position: Int64 read write;

 

Int64 Position { get; set; }

 

var Position: Int64 { get{} set{} }

 

Property Position() As Int64

 

FromFile

Create a filehandle from a File object

 

class method FromFile(aFile: File; Mode: FileOpenMode): FileHandle

 

static FileHandle FromFile(File aFile, FileOpenMode Mode)

 

static func FromFile(_ aFile: File, _ Mode: FileOpenMode) -> FileHandle

 

Shared Function FromFile(aFile As File, Mode As FileOpenMode) As FileHandle

Parameters:

  • aFile:
  • Mode:

 

constructor

Creates a new file handle for the given filename.

 

constructor(FileName: String; Mode: FileOpenMode)

 

FileHandle(String FileName, FileOpenMode Mode)

 

init(_ FileName: String, _ Mode: FileOpenMode)

 

Sub New(FileName As String, Mode As FileOpenMode)

Parameters:

  • FileName:
  • Mode:

Close Island-Android, Island-iOS, Island-iOS Simulator, Island-Mac Catalyst, Island-macOS, Island-tvOS, Island-tvOS Simulator, Island-Ubuntu, Island-watchOS, Island-watchOS Simulator, Island-Windows, Toffee, ToffeeV2

Close the handle.

 

method Close

 

void Close()

 

func Close()

 

Sub Close()

Flush Island-Android, Island-iOS, Island-iOS Simulator, Island-Mac Catalyst, Island-macOS, Island-tvOS, Island-tvOS Simulator, Island-Ubuntu, Island-watchOS, Island-watchOS Simulator, Island-Windows, Toffee, ToffeeV2

Flush the changes to the file to disk.

 

method Flush

 

void Flush()

 

func Flush()

 

Sub Flush()

Read (array of Byte, Int32): Int32 Island-Android, Island-iOS, Island-iOS Simulator, Island-Mac Catalyst, Island-macOS, Island-tvOS, Island-tvOS Simulator, Island-Ubuntu, Island-watchOS, Island-watchOS Simulator, Island-Windows, Toffee, ToffeeV2

Read Count bytes into buffer; returning the nr of bytes actually read. Returns 0 when the end has been reached.

 

method Read(Buffer: array of Byte; Count: Int32): Int32

 

Int32 Read(Byte[] Buffer, Int32 Count)

 

func Read(_ Buffer: Byte..., _ Count: Int32) -> Int32

 

Function Read(Buffer As Byte(), Count As Int32) As Int32

Parameters:

  • Buffer:
  • Count:

Read (array of Byte, Int32, Int32): Int32 Island-Android, Island-iOS, Island-iOS Simulator, Island-Mac Catalyst, Island-macOS, Island-tvOS, Island-tvOS Simulator, Island-Ubuntu, Island-watchOS, Island-watchOS Simulator, Island-Windows, Toffee, ToffeeV2

Read Count bytes into buffer; returning the nr of bytes actually read. Returns 0 when the end has been reached.

 

method Read(Buffer: array of Byte; Offset: Int32; Count: Int32): Int32

 

Int32 Read(Byte[] Buffer, Int32 Offset, Int32 Count)

 

func Read(_ Buffer: Byte..., _ Offset: Int32, _ Count: Int32) -> Int32

 

Function Read(Buffer As Byte(), Offset As Int32, Count As Int32) As Int32

Parameters:

  • Buffer:
  • Offset:
  • Count:

Read (Int32): ImmutableBinary Island-Android, Island-iOS, Island-iOS Simulator, Island-Mac Catalyst, Island-macOS, Island-tvOS, Island-tvOS Simulator, Island-Ubuntu, Island-watchOS, Island-watchOS Simulator, Island-Windows, Toffee, ToffeeV2

Read Count bytes from a file, returning it as binary.

 

method Read(Count: Int32): ImmutableBinary

 

ImmutableBinary Read(Int32 Count)

 

func Read(_ Count: Int32) -> ImmutableBinary

 

Function Read(Count As Int32) As ImmutableBinary

Parameters:

  • Count:

Seek (Int64, SeekOrigin) Island-Android, Island-iOS, Island-iOS Simulator, Island-Mac Catalyst, Island-macOS, Island-tvOS, Island-tvOS Simulator, Island-Ubuntu, Island-watchOS, Island-watchOS Simulator, Island-Windows, Toffee, ToffeeV2

Changes the position, relative to Origin.

 

method Seek(Offset: Int64; Origin: SeekOrigin)

 

void Seek(Int64 Offset, SeekOrigin Origin)

 

func Seek(_ Offset: Int64, _ Origin: SeekOrigin)

 

Sub Seek(Offset As Int64, Origin As SeekOrigin)

Parameters:

  • Offset:
  • Origin:

Write (array of Byte) Island-Android, Island-iOS, Island-iOS Simulator, Island-Mac Catalyst, Island-macOS, Island-tvOS, Island-tvOS Simulator, Island-Ubuntu, Island-watchOS, Island-watchOS Simulator, Island-Windows, Toffee, ToffeeV2

Write a byte array to this file.

 

method Write(Buffer: array of Byte)

 

void Write(Byte[] Buffer)

 

func Write(_ Buffer: Byte...)

 

Sub Write(Buffer As Byte())

Parameters:

  • Buffer:

Write (array of Byte, Int32) Island-Android, Island-iOS, Island-iOS Simulator, Island-Mac Catalyst, Island-macOS, Island-tvOS, Island-tvOS Simulator, Island-Ubuntu, Island-watchOS, Island-watchOS Simulator, Island-Windows, Toffee, ToffeeV2

Write a byte array to this file.

 

method Write(Buffer: array of Byte; Count: Int32)

 

void Write(Byte[] Buffer, Int32 Count)

 

func Write(_ Buffer: Byte..., _ Count: Int32)

 

Sub Write(Buffer As Byte(), Count As Int32)

Parameters:

  • Buffer:
  • Count:

Write (array of Byte, Int32, Int32) Island-Android, Island-iOS, Island-iOS Simulator, Island-Mac Catalyst, Island-macOS, Island-tvOS, Island-tvOS Simulator, Island-Ubuntu, Island-watchOS, Island-watchOS Simulator, Island-Windows, Toffee, ToffeeV2

Write a byte array to this file.

 

method Write(Buffer: array of Byte; Offset: Int32; Count: Int32)

 

void Write(Byte[] Buffer, Int32 Offset, Int32 Count)

 

func Write(_ Buffer: Byte..., _ Offset: Int32, _ Count: Int32)

 

Sub Write(Buffer As Byte(), Offset As Int32, Count As Int32)

Parameters:

  • Buffer:
  • Offset:
  • Count:

Write (ImmutableBinary) Island-Android, Island-iOS, Island-iOS Simulator, Island-Mac Catalyst, Island-macOS, Island-tvOS, Island-tvOS Simulator, Island-Ubuntu, Island-watchOS, Island-watchOS Simulator, Island-Windows, Toffee, ToffeeV2

Write a binary to a file.

 

method Write(Data: ImmutableBinary)

 

void Write(ImmutableBinary Data)

 

func Write(_ Data: ImmutableBinary)

 

Sub Write(Data As ImmutableBinary)

Parameters:

  • Data:

Read (array of Byte, Int32): Int32 .NET, .NET Standard 2.0

 

method Read(Buffer: array of Byte; Count: Int32): Int32

 

Int32 Read(Byte[] Buffer, Int32 Count)

 

func Read(_ Buffer: Byte..., _ Count: Int32) -> Int32

 

Function Read(Buffer As Byte(), Count As Int32) As Int32

Parameters:

  • Buffer:
  • Count:

Read (array of Byte, Int32, Int32): Int32 .NET, .NET Standard 2.0

 

method Read(Buffer: array of Byte; Offset: Int32; Count: Int32): Int32

 

Int32 Read(Byte[] Buffer, Int32 Offset, Int32 Count)

 

func Read(_ Buffer: Byte..., _ Offset: Int32, _ Count: Int32) -> Int32

 

Function Read(Buffer As Byte(), Offset As Int32, Count As Int32) As Int32

Parameters:

  • Buffer:
  • Offset:
  • Count:

Read (Int32): ImmutableBinary .NET, .NET Standard 2.0

 

method Read(Count: Int32): ImmutableBinary

 

ImmutableBinary Read(Int32 Count)

 

func Read(_ Count: Int32) -> ImmutableBinary

 

Function Read(Count As Int32) As ImmutableBinary

Parameters:

  • Count:

Seek (Int64, SeekOrigin) .NET, .NET Standard 2.0

 

method Seek(Offset: Int64; Origin: SeekOrigin)

 

void Seek(Int64 Offset, SeekOrigin Origin)

 

func Seek(_ Offset: Int64, _ Origin: SeekOrigin)

 

Sub Seek(Offset As Int64, Origin As SeekOrigin)

Parameters:

  • Offset:
  • Origin:

Write (array of Byte) .NET, .NET Standard 2.0

 

method Write(Buffer: array of Byte)

 

void Write(Byte[] Buffer)

 

func Write(_ Buffer: Byte...)

 

Sub Write(Buffer As Byte())

Parameters:

  • Buffer:

Write (array of Byte, Int32) .NET, .NET Standard 2.0

 

method Write(Buffer: array of Byte; Count: Int32)

 

void Write(Byte[] Buffer, Int32 Count)

 

func Write(_ Buffer: Byte..., _ Count: Int32)

 

Sub Write(Buffer As Byte(), Count As Int32)

Parameters:

  • Buffer:
  • Count:

Write (array of Byte, Int32, Int32) .NET, .NET Standard 2.0

 

method Write(Buffer: array of Byte; Offset: Int32; Count: Int32)

 

void Write(Byte[] Buffer, Int32 Offset, Int32 Count)

 

func Write(_ Buffer: Byte..., _ Offset: Int32, _ Count: Int32)

 

Sub Write(Buffer As Byte(), Offset As Int32, Count As Int32)

Parameters:

  • Buffer:
  • Offset:
  • Count:

Write (ImmutableBinary) .NET, .NET Standard 2.0

 

method Write(Data: ImmutableBinary)

 

void Write(ImmutableBinary Data)

 

func Write(_ Data: ImmutableBinary)

 

Sub Write(Data As ImmutableBinary)

Parameters:

  • Data: