FileHandle

Overview

Low level file handle.

Location

  • Reference:
    • Elements.dll  .NET, .NET Standard 2.0
    • elements.jar  Cooper
    • Elements.fx  Island-Android, Island-iOS, Island-iOS Simulator-x86_64, Island-macOS-x86_64, Island-tvOS, Island-tvOS Simulator-x86_64, Island-Ubuntu, Island-UIKit for Mac-x86_64, Island-watchOS, Island-watchOS Simulator, Island-Windows, ToffeeV2
    • libElements.fx  Toffee
  • Namespace: RemObjects.Elements.RTL
  • Platforms: .NET, .NET Standard 2.0, Cooper, Island-Android, Island-iOS, Island-iOS Simulator-x86_64, Island-macOS-x86_64, Island-tvOS, Island-tvOS Simulator-x86_64, Island-Ubuntu, Island-UIKit for Mac-x86_64, Island-watchOS, Island-watchOS Simulator, Island-Windows, Toffee, ToffeeV2
  • Mapped to:
    • System.IO.FileStream  .NET, .NET Standard 2.0
    • java.io.RandomAccessFile  Cooper
    • RemObjects.Elements.System.FileStream  Island-Android, Island-iOS, Island-iOS Simulator-x86_64, Island-macOS-x86_64, Island-tvOS, Island-tvOS Simulator-x86_64, Island-Ubuntu, Island-UIKit for Mac-x86_64, Island-watchOS, Island-watchOS Simulator, Island-Windows, ToffeeV2
    • Foundation.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)

 

FileHandle(String FileName, FileOpenMode Mode)

Parameters:

  • FileName:
  • Mode:

Close

Close the handle.

 

method Close

 

void Close()

 

func Close()

 

void Close()

Flush

Flush the changes to the file to disk.

 

method Flush

 

void Flush()

 

func Flush()

 

void 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

 

static FileHandle FromFile(File aFile, FileOpenMode Mode)

Parameters:

  • aFile:
  • Mode:

Length

Returns the size of this file.

 

property Length: Int64 read write;

 

Int64 Length { get; set; }

 

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

 

Int64 Length { __get; __set; }

Position

Returns the current position in this file.

 

property Position: Int64 read write;

 

Int64 Position { get; set; }

 

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

 

Int64 Position { __get; __set; }

Read (array of Byte, Int32): Int32

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

 

Integer Read(Byte[] Buffer, Integer Count)

Parameters:

  • Buffer:
  • Count:

Read (array of Byte, Int32, Int32): Int32

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

 

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

Parameters:

  • Buffer:
  • Offset:
  • Count:

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

 

method Read(Count: Int32): ImmutableBinary

 

ImmutableBinary Read(Int32 Count)

 

func Read(_ Count: Int32) -> ImmutableBinary

 

ImmutableBinary Read(Integer Count)

Parameters:

  • Count:

Seek

Changes the position, relative to Origin.

 

method Seek(Offset: Int64; Origin: SeekOrigin)

 

void Seek(Int64 Offset, SeekOrigin Origin)

 

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

 

void Seek(Int64 Offset, SeekOrigin Origin)

Parameters:

  • Offset:
  • Origin:

Write (array of Byte)

Write a byte array to this file.

 

method Write(Buffer: array of Byte)

 

void Write(Byte[] Buffer)

 

func Write(_ Buffer: Byte...)

 

void Write(Byte[] Buffer)

Parameters:

  • Buffer:

Write (array of Byte, Int32)

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)

 

void Write(Byte[] Buffer, Integer Count)

Parameters:

  • Buffer:
  • Count:

Write (array of Byte, Int32, Int32)

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)

 

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

Parameters:

  • Buffer:
  • Offset:
  • Count:

Write (ImmutableBinary)

Write a binary to a file.

 

method Write(Data: ImmutableBinary)

 

void Write(ImmutableBinary Data)

 

func Write(_ Data: ImmutableBinary)

 

void Write(ImmutableBinary Data)

Parameters:

  • Data:

 

Length

Returns the size of this file.

 

property Length: Int64 read write;

 

Int64 Length { get; set; }

 

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

 

Int64 Length { __get; __set; }

Position

Returns the current position in this file.

 

property Position: Int64 read write;

 

Int64 Position { get; set; }

 

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

 

Int64 Position { __get; __set; }

 

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

 

static FileHandle FromFile(File aFile, FileOpenMode Mode)

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)

 

FileHandle(String FileName, FileOpenMode Mode)

Parameters:

  • FileName:
  • Mode:

Close

Close the handle.

 

method Close

 

void Close()

 

func Close()

 

void Close()

Flush

Flush the changes to the file to disk.

 

method Flush

 

void Flush()

 

func Flush()

 

void Flush()

Read (array of Byte, Int32): Int32

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

 

Integer Read(Byte[] Buffer, Integer Count)

Parameters:

  • Buffer:
  • Count:

Read (array of Byte, Int32, Int32): Int32

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

 

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

Parameters:

  • Buffer:
  • Offset:
  • Count:

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

 

method Read(Count: Int32): ImmutableBinary

 

ImmutableBinary Read(Int32 Count)

 

func Read(_ Count: Int32) -> ImmutableBinary

 

ImmutableBinary Read(Integer Count)

Parameters:

  • Count:

Seek

Changes the position, relative to Origin.

 

method Seek(Offset: Int64; Origin: SeekOrigin)

 

void Seek(Int64 Offset, SeekOrigin Origin)

 

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

 

void Seek(Int64 Offset, SeekOrigin Origin)

Parameters:

  • Offset:
  • Origin:

Write (array of Byte)

Write a byte array to this file.

 

method Write(Buffer: array of Byte)

 

void Write(Byte[] Buffer)

 

func Write(_ Buffer: Byte...)

 

void Write(Byte[] Buffer)

Parameters:

  • Buffer:

Write (array of Byte, Int32)

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)

 

void Write(Byte[] Buffer, Integer Count)

Parameters:

  • Buffer:
  • Count:

Write (array of Byte, Int32, Int32)

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)

 

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

Parameters:

  • Buffer:
  • Offset:
  • Count:

Write (ImmutableBinary)

Write a binary to a file.

 

method Write(Data: ImmutableBinary)

 

void Write(ImmutableBinary Data)

 

func Write(_ Data: ImmutableBinary)

 

void Write(ImmutableBinary Data)

Parameters:

  • Data: