FileStream

Overview

Stream implementation for file access.

Location

  • Reference: Island.fx
  • Namespace: RemObjects.Elements.System
  • Platforms: Android, iOS, iOS Simulator, macOS, tvOS, tvOS Simulator, Ubuntu, UIKit for Mac, watchOS, watchOS Simulator, Windows
  • Ancestry: Stream | FileStream

 

constructor  protected    (declared in Stream)

 

constructor

 

FileStream()

 

init()

 

FileStream()

constructor (^_IO_FILE, FileAccess) Ubuntu

 

constructor(aHandle: ^_IO_FILE; Access: FileAccess)

 

FileStream(_IO_FILE* aHandle, FileAccess Access)

 

init(_ aHandle: UnsafeMutablePointer<_IO_FILE>, _ Access: FileAccess)

 

FileStream(_IO_FILE* aHandle, FileAccess Access)

Parameters:

  • aHandle:
  • Access:

constructor (^FILE, FileAccess) Android, iOS, iOS Simulator, macOS, tvOS, tvOS Simulator, UIKit for Mac, watchOS, watchOS Simulator

 

constructor(aHandle: ^FILE; Access: FileAccess)

 

FileStream(FILE* aHandle, FileAccess Access)

 

init(_ aHandle: UnsafeMutablePointer<FILE>, _ Access: FileAccess)

 

FileStream(FILE* aHandle, FileAccess Access)

Parameters:

  • aHandle:
  • Access:

constructor (HANDLE, FileAccess) Windows

 

constructor(aHandle: HANDLE; Access: FileAccess)

 

FileStream(HANDLE aHandle, FileAccess Access)

 

init(_ aHandle: HANDLE, _ Access: FileAccess)

 

FileStream(HANDLE aHandle, FileAccess Access)

Parameters:

  • aHandle:
  • Access:

constructor (String, FileMode, FileAccess, FileShare)

Constructor

 

constructor(FileName: String; Mode: FileMode; Access: FileAccess; Share: FileShare)

 

FileStream(String FileName, FileMode Mode, FileAccess Access, FileShare Share)

 

init(_ FileName: String, _ Mode: FileMode, _ Access: FileAccess, _ Share: FileShare)

 

FileStream(String FileName, FileMode Mode, FileAccess Access, FileShare Share)

Parameters:

  • FileName: Specifies the file name
  • Mode: Specifies the mode in which to open the file
  • Access: Specifies the access with which to open the file
  • Share: Specifies the sharing mode with which to open the file

CanRead  override virtual

Returns true.

 

property CanRead: Boolean read;

 

Boolean CanRead { get; }

 

var CanRead: Boolean { get{} }

 

Boolean CanRead { __get; }

CanSeek  override virtual

Returns true.

 

property CanSeek: Boolean read;

 

Boolean CanSeek { get; }

 

var CanSeek: Boolean { get{} }

 

Boolean CanSeek { __get; }

CanWrite  override virtual

Returns true.

 

property CanWrite: Boolean read;

 

Boolean CanWrite { get; }

 

var CanWrite: Boolean { get{} }

 

Boolean CanWrite { __get; }

Close  override virtual

Close this file.

 

method Close

 

void Close()

 

func Close()

 

void Close()

CopyTo    (declared in Stream)

 

method CopyTo(Destination: Stream)

 

void CopyTo(Stream Destination)

 

func CopyTo(_ Destination: Stream)

 

void CopyTo(Stream Destination)

Parameters:

  • Destination:

Equals  virtual    (declared in Object)

Returns true if the target object matches this one, by default compares the reference.

 

method Equals(obj: Object): Boolean

 

Boolean Equals(Object obj)

 

func Equals(_ obj: Object) -> Boolean

 

Boolean Equals(Object obj)

Parameters:

  • obj: the reference to compare this with.

Finalize  protected virtual    (declared in Object)

Finalizer implementation. If not overriden it's not called at all, the runtime checks if there is an override before calling a finalizer.

 

method Finalize

 

void Finalize()

 

func Finalize()

 

void Finalize()

Flush  override virtual

Flush all writes to disk.

 

method Flush

 

void Flush()

 

func Flush()

 

void Flush()

GetHashCode  virtual    (declared in Object)

Returns a hashcode for this object. Overriden implementations should make sure that the number returned here is constant given the same object.

 

method GetHashCode: Int32

 

Int32 GetHashCode()

 

func GetHashCode() -> Int32

 

Int32 GetHashCode()

GetType    (declared in Object)

Returns the actual type of this class

 

method GetType: Type

 

Type GetType()

 

func GetType() -> Type

 

Type GetType()

IsValid  protected override virtual

Returns true if this is valid.

 

method IsValid: Boolean

 

Boolean IsValid()

 

func IsValid() -> Boolean

 

Boolean IsValid()

Length  override virtual

returns the size of this file.

 

property Length: Int64 read;

 

Int64 Length { get; }

 

var Length: Int64 { get{} }

 

Int64 Length { __get; }

Name

Contains the filename.

 

property Name: String read;

 

String Name { get; }

 

var Name: String { get{} }

 

String Name { __get; }

Position  virtual    (declared in Stream)

 

property Position: Int64 read write;

 

Int64 Position { get; set; }

 

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

 

Int64 Position { __get; __set; }

Read (^void, Int32): Int32    (declared in Stream)

 

method Read(buf: ^void; Count: Int32): Int32

 

Int32 Read(void* buf, Int32 Count)

 

func Read(_ buf: UnsafeMutablePointer<void>, _ Count: Int32) -> Int32

 

Int32 Read(void* buf, Int32 Count)

Parameters:

  • buf:
  • Count:

Read (array of Byte, Int32, Int32): Int32    (declared in Stream)

 

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

 

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

Parameters:

  • Buffer:
  • Offset:
  • Count:

Read (Span<Byte>): Int32  override virtual

Reads data from a file.

 

method Read(aSpan: Span<Byte>): Int32

 

Int32 Read(Span<Byte> aSpan)

 

func Read(_ aSpan: Span<Byte>) -> Int32

 

Int32 Read(Span<Byte> aSpan)

Parameters:

  • aSpan:

ReferenceEquals    (declared in Object)

Compares two references for equivalence (even if they have an equals operator)

 

class method ReferenceEquals(a: Object; b: Object): Boolean

 

static Boolean ReferenceEquals(Object a, Object b)

 

static func ReferenceEquals(_ a: Object, _ b: Object) -> Boolean

 

static Boolean ReferenceEquals(Object a, Object b)

Parameters:

  • a: left value
  • b: right value

Seek  override virtual

Change the position of this filestream.

 

method Seek(Offset: Int64; Origin: SeekOrigin): Int64

 

Int64 Seek(Int64 Offset, SeekOrigin Origin)

 

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

 

Int64 Seek(Int64 Offset, SeekOrigin Origin)

Parameters:

  • Offset: relative offset to Origin.
  • Origin: Origin to seek from (Start, End, Current)

SetLength  override virtual

Sets the length of the file (either truncates or appends zeros)

 

method SetLength(value: Int64)

 

void SetLength(Int64 value)

 

func SetLength(_ value: Int64)

 

void SetLength(Int64 value)

Parameters:

  • value: new size

ToString  virtual    (declared in Object)

Gets the string representation of this method.

 

method ToString: String

 

String ToString()

 

func ToString() -> String

 

String ToString()

Write (^void, Int32): Int32    (declared in Stream)

 

method Write(buf: ^void; Count: Int32): Int32

 

Int32 Write(void* buf, Int32 Count)

 

func Write(_ buf: UnsafeMutablePointer<void>, _ Count: Int32) -> Int32

 

Int32 Write(void* buf, Int32 Count)

Parameters:

  • buf:
  • Count:

Write (array of Byte, Int32, Int32): Int32    (declared in Stream)

 

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

 

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

 

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

 

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

Parameters:

  • Buffer:
  • Offset:
  • Count:

Write (ImmutableSpan<Byte>): Int32  override virtual

Writes to a file

 

method Write(aSpan: ImmutableSpan<Byte>): Int32

 

Int32 Write(ImmutableSpan<Byte> aSpan)

 

func Write(_ aSpan: ImmutableSpan<Byte>) -> Int32

 

Int32 Write(ImmutableSpan<Byte> aSpan)

Parameters:

  • aSpan:

 

CanRead  override virtual

Returns true.

 

property CanRead: Boolean read;

 

Boolean CanRead { get; }

 

var CanRead: Boolean { get{} }

 

Boolean CanRead { __get; }

CanSeek  override virtual

Returns true.

 

property CanSeek: Boolean read;

 

Boolean CanSeek { get; }

 

var CanSeek: Boolean { get{} }

 

Boolean CanSeek { __get; }

CanWrite  override virtual

Returns true.

 

property CanWrite: Boolean read;

 

Boolean CanWrite { get; }

 

var CanWrite: Boolean { get{} }

 

Boolean CanWrite { __get; }

Length  override virtual

returns the size of this file.

 

property Length: Int64 read;

 

Int64 Length { get; }

 

var Length: Int64 { get{} }

 

Int64 Length { __get; }

Name

Contains the filename.

 

property Name: String read;

 

String Name { get; }

 

var Name: String { get{} }

 

String Name { __get; }

Position  virtual    (declared in Stream)

 

property Position: Int64 read write;

 

Int64 Position { get; set; }

 

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

 

Int64 Position { __get; __set; }

 

ReferenceEquals    (declared in Object)

Compares two references for equivalence (even if they have an equals operator)

 

class method ReferenceEquals(a: Object; b: Object): Boolean

 

static Boolean ReferenceEquals(Object a, Object b)

 

static func ReferenceEquals(_ a: Object, _ b: Object) -> Boolean

 

static Boolean ReferenceEquals(Object a, Object b)

Parameters:

  • a: left value
  • b: right value

 

constructor  protected    (declared in Stream)

 

constructor

 

FileStream()

 

init()

 

FileStream()

constructor (^_IO_FILE, FileAccess) Ubuntu

 

constructor(aHandle: ^_IO_FILE; Access: FileAccess)

 

FileStream(_IO_FILE* aHandle, FileAccess Access)

 

init(_ aHandle: UnsafeMutablePointer<_IO_FILE>, _ Access: FileAccess)

 

FileStream(_IO_FILE* aHandle, FileAccess Access)

Parameters:

  • aHandle:
  • Access:

constructor (^FILE, FileAccess) Android, iOS, iOS Simulator, macOS, tvOS, tvOS Simulator, UIKit for Mac, watchOS, watchOS Simulator

 

constructor(aHandle: ^FILE; Access: FileAccess)

 

FileStream(FILE* aHandle, FileAccess Access)

 

init(_ aHandle: UnsafeMutablePointer<FILE>, _ Access: FileAccess)

 

FileStream(FILE* aHandle, FileAccess Access)

Parameters:

  • aHandle:
  • Access:

constructor (HANDLE, FileAccess) Windows

 

constructor(aHandle: HANDLE; Access: FileAccess)

 

FileStream(HANDLE aHandle, FileAccess Access)

 

init(_ aHandle: HANDLE, _ Access: FileAccess)

 

FileStream(HANDLE aHandle, FileAccess Access)

Parameters:

  • aHandle:
  • Access:

constructor (String, FileMode, FileAccess, FileShare)

Constructor

 

constructor(FileName: String; Mode: FileMode; Access: FileAccess; Share: FileShare)

 

FileStream(String FileName, FileMode Mode, FileAccess Access, FileShare Share)

 

init(_ FileName: String, _ Mode: FileMode, _ Access: FileAccess, _ Share: FileShare)

 

FileStream(String FileName, FileMode Mode, FileAccess Access, FileShare Share)

Parameters:

  • FileName: Specifies the file name
  • Mode: Specifies the mode in which to open the file
  • Access: Specifies the access with which to open the file
  • Share: Specifies the sharing mode with which to open the file

Close  override virtual

Close this file.

 

method Close

 

void Close()

 

func Close()

 

void Close()

CopyTo    (declared in Stream)

 

method CopyTo(Destination: Stream)

 

void CopyTo(Stream Destination)

 

func CopyTo(_ Destination: Stream)

 

void CopyTo(Stream Destination)

Parameters:

  • Destination:

Equals  virtual    (declared in Object)

Returns true if the target object matches this one, by default compares the reference.

 

method Equals(obj: Object): Boolean

 

Boolean Equals(Object obj)

 

func Equals(_ obj: Object) -> Boolean

 

Boolean Equals(Object obj)

Parameters:

  • obj: the reference to compare this with.

Finalize  protected virtual    (declared in Object)

Finalizer implementation. If not overriden it's not called at all, the runtime checks if there is an override before calling a finalizer.

 

method Finalize

 

void Finalize()

 

func Finalize()

 

void Finalize()

Flush  override virtual

Flush all writes to disk.

 

method Flush

 

void Flush()

 

func Flush()

 

void Flush()

GetHashCode  virtual    (declared in Object)

Returns a hashcode for this object. Overriden implementations should make sure that the number returned here is constant given the same object.

 

method GetHashCode: Int32

 

Int32 GetHashCode()

 

func GetHashCode() -> Int32

 

Int32 GetHashCode()

GetType    (declared in Object)

Returns the actual type of this class

 

method GetType: Type

 

Type GetType()

 

func GetType() -> Type

 

Type GetType()

IsValid  protected override virtual

Returns true if this is valid.

 

method IsValid: Boolean

 

Boolean IsValid()

 

func IsValid() -> Boolean

 

Boolean IsValid()

Read (^void, Int32): Int32    (declared in Stream)

 

method Read(buf: ^void; Count: Int32): Int32

 

Int32 Read(void* buf, Int32 Count)

 

func Read(_ buf: UnsafeMutablePointer<void>, _ Count: Int32) -> Int32

 

Int32 Read(void* buf, Int32 Count)

Parameters:

  • buf:
  • Count:

Read (array of Byte, Int32, Int32): Int32    (declared in Stream)

 

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

 

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

Parameters:

  • Buffer:
  • Offset:
  • Count:

Read (Span<Byte>): Int32  override virtual

Reads data from a file.

 

method Read(aSpan: Span<Byte>): Int32

 

Int32 Read(Span<Byte> aSpan)

 

func Read(_ aSpan: Span<Byte>) -> Int32

 

Int32 Read(Span<Byte> aSpan)

Parameters:

  • aSpan:

Seek  override virtual

Change the position of this filestream.

 

method Seek(Offset: Int64; Origin: SeekOrigin): Int64

 

Int64 Seek(Int64 Offset, SeekOrigin Origin)

 

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

 

Int64 Seek(Int64 Offset, SeekOrigin Origin)

Parameters:

  • Offset: relative offset to Origin.
  • Origin: Origin to seek from (Start, End, Current)

SetLength  override virtual

Sets the length of the file (either truncates or appends zeros)

 

method SetLength(value: Int64)

 

void SetLength(Int64 value)

 

func SetLength(_ value: Int64)

 

void SetLength(Int64 value)

Parameters:

  • value: new size

ToString  virtual    (declared in Object)

Gets the string representation of this method.

 

method ToString: String

 

String ToString()

 

func ToString() -> String

 

String ToString()

Write (^void, Int32): Int32    (declared in Stream)

 

method Write(buf: ^void; Count: Int32): Int32

 

Int32 Write(void* buf, Int32 Count)

 

func Write(_ buf: UnsafeMutablePointer<void>, _ Count: Int32) -> Int32

 

Int32 Write(void* buf, Int32 Count)

Parameters:

  • buf:
  • Count:

Write (array of Byte, Int32, Int32): Int32    (declared in Stream)

 

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

 

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

 

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

 

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

Parameters:

  • Buffer:
  • Offset:
  • Count:

Write (ImmutableSpan<Byte>): Int32  override virtual

Writes to a file

 

method Write(aSpan: ImmutableSpan<Byte>): Int32

 

Int32 Write(ImmutableSpan<Byte> aSpan)

 

func Write(_ aSpan: ImmutableSpan<Byte>) -> Int32

 

Int32 Write(ImmutableSpan<Byte> aSpan)

Parameters:

  • aSpan: