FileStream

Overview

Stream implementation for file access.

Location

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

 

constructor    (declared in Object) UIKit for Mac

Default constructor.

 

constructor

 

FileStream()

 

init()

 

FileStream()

 

Sub New()

constructor (PlatformHandle, FileAccess) Android, iOS, iOS Simulator, Mac Catalyst, macOS, tvOS, tvOS Simulator, Ubuntu, watchOS, watchOS Simulator, Windows

 

constructor(aHandle: PlatformHandle; Access: FileAccess)

 

FileStream(PlatformHandle aHandle, FileAccess Access)

 

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

 

FileStream(PlatformHandle aHandle, FileAccess Access)

 

Sub New(aHandle As PlatformHandle, Access As FileAccess)

Parameters:

  • aHandle:
  • Access:

constructor (String, FileMode, FileAccess, FileShare) Android, iOS, iOS Simulator, Mac Catalyst, macOS, tvOS, tvOS Simulator, Ubuntu, watchOS, watchOS Simulator, Windows

 

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)

 

Sub New(FileName As String, Mode As FileMode, Access As FileAccess, Share As FileShare)

Parameters:

  • FileName:
  • Mode:
  • Access:
  • Share:

constructor (String, FileMode, FileAccess, FileShare) UIKit for Mac

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)

 

Sub New(FileName As String, Mode As FileMode, Access As FileAccess, Share As FileShare)

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; }

 

ReadOnly Property CanRead() As Boolean

CanSeek  override virtual

Returns true.

 

property CanSeek: Boolean read;

 

Boolean CanSeek { get; }

 

var CanSeek: Boolean { get{} }

 

Boolean CanSeek { __get; }

 

ReadOnly Property CanSeek() As Boolean

CanWrite  override virtual

Returns true.

 

property CanWrite: Boolean read;

 

Boolean CanWrite { get; }

 

var CanWrite: Boolean { get{} }

 

Boolean CanWrite { __get; }

 

ReadOnly Property CanWrite() As Boolean

Close  override virtual UIKit for Mac

Close this file.

 

method Close

 

Close()

 

func Close()

 

Close()

 

Sub Close()

CopyTo (Stream)    (declared in Stream) Android, iOS, iOS Simulator, Mac Catalyst, macOS, tvOS, tvOS Simulator, Ubuntu, watchOS, watchOS Simulator, Windows

 

method CopyTo(Destination: Stream)

 

void CopyTo(Stream Destination)

 

func CopyTo(_ Destination: Stream)

 

void CopyTo(Stream Destination)

 

Sub CopyTo(Destination As Stream)

Parameters:

  • Destination:

CopyTo (Stream)    (declared in Stream) UIKit for Mac

Copy the stream to another stream.

 

method CopyTo(Destination: Stream)

 

CopyTo(Stream Destination)

 

func CopyTo(_ Destination: Stream)

 

CopyTo(Stream Destination)

 

Sub CopyTo(Destination As Stream)

Parameters:

  • Destination:

Dispose    (declared in Stream) UIKit for Mac

 

method Dispose

 

Dispose()

 

func Dispose()

 

Dispose()

 

Sub Dispose()

Equals (Object): Boolean  virtual    (declared in Object) Android, iOS, iOS Simulator, Mac Catalyst, macOS, tvOS, tvOS Simulator, Ubuntu, watchOS, watchOS Simulator, Windows

 

method Equals(aOther: Object): Boolean

 

Boolean Equals(Object aOther)

 

func Equals(_ aOther: Object) -> Boolean

 

Boolean Equals(Object aOther)

 

Function Equals(aOther As Object) As Boolean

Parameters:

  • aOther:

Equals (Object): Boolean  virtual    (declared in Object) UIKit for Mac

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)

 

Function Equals(obj As Object) As Boolean

Parameters:

  • obj: the reference to compare this with.

Finalize  protected virtual    (declared in Object) UIKit for Mac

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

 

Finalize()

 

func Finalize()

 

Finalize()

 

Sub Finalize()

Flush  override virtual UIKit for Mac

Flush all writes to disk.

 

method Flush

 

Flush()

 

func Flush()

 

Flush()

 

Sub 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()

 

Function GetHashCode() As Int32

GetType    (declared in Object)

Returns the actual type of this class

 

method GetType: Type

 

Type GetType()

 

func GetType() -> Type

 

Type GetType()

 

Function GetType() As Type

IsValid  protected override virtual

Returns true if this is valid.

 

method IsValid: Boolean

 

Boolean IsValid()

 

func IsValid() -> Boolean

 

Boolean IsValid()

 

Function IsValid() As Boolean

Length  override virtual

returns the size of this file.

 

property Length: Int64 read;

 

Int64 Length { get; }

 

var Length: Int64 { get{} }

 

Int64 Length { __get; }

 

ReadOnly Property Length() As Int64

Name

Contains the filename.

 

property Name: String read;

 

String Name { get; }

 

var Name: String { get{} }

 

String Name { __get; }

 

ReadOnly Property Name() As String

Position  virtual    (declared in Stream)

Position in this stream.

 

property Position: Int64 read write;

 

Int64 Position { get; set; }

 

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

 

Int64 Position { __get; __set; }

 

Property Position() As Int64

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)

 

Function Read(aSpan As Span<Byte>) As Int32

Parameters:

  • aSpan:

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

Read from stream into buf.

 

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)

 

Function Read(buf As Ptr(Of Void), Count As Int32) As Int32

Parameters:

  • buf:
  • Count:

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

Read from stream into buffer.

 

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)

 

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

Parameters:

  • Buffer:
  • Offset:
  • Count:

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)

 

Shared Function ReferenceEquals(a As Object, b As Object) As Boolean

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)

 

Function Seek(Offset As Int64, Origin As SeekOrigin) As Int64

Parameters:

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

SetLength (Int64)  override virtual Android, iOS, iOS Simulator, Mac Catalyst, macOS, tvOS, tvOS Simulator, Ubuntu, watchOS, watchOS Simulator, Windows

 

method SetLength(value: Int64)

 

void SetLength(Int64 value)

 

func SetLength(_ value: Int64)

 

void SetLength(Int64 value)

 

Sub SetLength(value As Int64)

Parameters:

  • value:

SetLength (Int64)  override virtual UIKit for Mac

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

 

method SetLength(value: Int64)

 

SetLength(Int64 value)

 

func SetLength(_ value: Int64)

 

SetLength(Int64 value)

 

Sub SetLength(value As Int64)

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()

 

Function ToString() As String

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)

 

Function Write(aSpan As ImmutableSpan<Byte>) As Int32

Parameters:

  • aSpan:

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

Writes buf to a 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)

 

Function Write(buf As Ptr(Of Void), Count As Int32) As Int32

Parameters:

  • buf:
  • Count:

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

Writes a byte array to this 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)

 

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

Parameters:

  • Buffer:
  • Offset:
  • Count:

 

CanRead  override virtual

Returns true.

 

property CanRead: Boolean read;

 

Boolean CanRead { get; }

 

var CanRead: Boolean { get{} }

 

Boolean CanRead { __get; }

 

ReadOnly Property CanRead() As Boolean

CanSeek  override virtual

Returns true.

 

property CanSeek: Boolean read;

 

Boolean CanSeek { get; }

 

var CanSeek: Boolean { get{} }

 

Boolean CanSeek { __get; }

 

ReadOnly Property CanSeek() As Boolean

CanWrite  override virtual

Returns true.

 

property CanWrite: Boolean read;

 

Boolean CanWrite { get; }

 

var CanWrite: Boolean { get{} }

 

Boolean CanWrite { __get; }

 

ReadOnly Property CanWrite() As Boolean

Length  override virtual

returns the size of this file.

 

property Length: Int64 read;

 

Int64 Length { get; }

 

var Length: Int64 { get{} }

 

Int64 Length { __get; }

 

ReadOnly Property Length() As Int64

Name

Contains the filename.

 

property Name: String read;

 

String Name { get; }

 

var Name: String { get{} }

 

String Name { __get; }

 

ReadOnly Property Name() As String

Position  virtual    (declared in Stream)

Position in this stream.

 

property Position: Int64 read write;

 

Int64 Position { get; set; }

 

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

 

Int64 Position { __get; __set; }

 

Property Position() As Int64

 

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)

 

Shared Function ReferenceEquals(a As Object, b As Object) As Boolean

Parameters:

  • a: left value
  • b: right value

 

constructor    (declared in Object) UIKit for Mac

Default constructor.

 

constructor

 

FileStream()

 

init()

 

FileStream()

 

Sub New()

constructor (PlatformHandle, FileAccess) Android, iOS, iOS Simulator, Mac Catalyst, macOS, tvOS, tvOS Simulator, Ubuntu, watchOS, watchOS Simulator, Windows

 

constructor(aHandle: PlatformHandle; Access: FileAccess)

 

FileStream(PlatformHandle aHandle, FileAccess Access)

 

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

 

FileStream(PlatformHandle aHandle, FileAccess Access)

 

Sub New(aHandle As PlatformHandle, Access As FileAccess)

Parameters:

  • aHandle:
  • Access:

constructor (String, FileMode, FileAccess, FileShare) Android, iOS, iOS Simulator, Mac Catalyst, macOS, tvOS, tvOS Simulator, Ubuntu, watchOS, watchOS Simulator, Windows

 

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)

 

Sub New(FileName As String, Mode As FileMode, Access As FileAccess, Share As FileShare)

Parameters:

  • FileName:
  • Mode:
  • Access:
  • Share:

constructor (String, FileMode, FileAccess, FileShare) UIKit for Mac

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)

 

Sub New(FileName As String, Mode As FileMode, Access As FileAccess, Share As FileShare)

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 UIKit for Mac

Close this file.

 

method Close

 

Close()

 

func Close()

 

Close()

 

Sub Close()

CopyTo (Stream)    (declared in Stream) Android, iOS, iOS Simulator, Mac Catalyst, macOS, tvOS, tvOS Simulator, Ubuntu, watchOS, watchOS Simulator, Windows

 

method CopyTo(Destination: Stream)

 

void CopyTo(Stream Destination)

 

func CopyTo(_ Destination: Stream)

 

void CopyTo(Stream Destination)

 

Sub CopyTo(Destination As Stream)

Parameters:

  • Destination:

CopyTo (Stream)    (declared in Stream) UIKit for Mac

Copy the stream to another stream.

 

method CopyTo(Destination: Stream)

 

CopyTo(Stream Destination)

 

func CopyTo(_ Destination: Stream)

 

CopyTo(Stream Destination)

 

Sub CopyTo(Destination As Stream)

Parameters:

  • Destination:

Dispose    (declared in Stream) UIKit for Mac

 

method Dispose

 

Dispose()

 

func Dispose()

 

Dispose()

 

Sub Dispose()

Equals (Object): Boolean  virtual    (declared in Object) Android, iOS, iOS Simulator, Mac Catalyst, macOS, tvOS, tvOS Simulator, Ubuntu, watchOS, watchOS Simulator, Windows

 

method Equals(aOther: Object): Boolean

 

Boolean Equals(Object aOther)

 

func Equals(_ aOther: Object) -> Boolean

 

Boolean Equals(Object aOther)

 

Function Equals(aOther As Object) As Boolean

Parameters:

  • aOther:

Equals (Object): Boolean  virtual    (declared in Object) UIKit for Mac

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)

 

Function Equals(obj As Object) As Boolean

Parameters:

  • obj: the reference to compare this with.

Finalize  protected virtual    (declared in Object) UIKit for Mac

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

 

Finalize()

 

func Finalize()

 

Finalize()

 

Sub Finalize()

Flush  override virtual UIKit for Mac

Flush all writes to disk.

 

method Flush

 

Flush()

 

func Flush()

 

Flush()

 

Sub 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()

 

Function GetHashCode() As Int32

GetType    (declared in Object)

Returns the actual type of this class

 

method GetType: Type

 

Type GetType()

 

func GetType() -> Type

 

Type GetType()

 

Function GetType() As Type

IsValid  protected override virtual

Returns true if this is valid.

 

method IsValid: Boolean

 

Boolean IsValid()

 

func IsValid() -> Boolean

 

Boolean IsValid()

 

Function IsValid() As Boolean

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)

 

Function Read(aSpan As Span<Byte>) As Int32

Parameters:

  • aSpan:

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

Read from stream into buf.

 

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)

 

Function Read(buf As Ptr(Of Void), Count As Int32) As Int32

Parameters:

  • buf:
  • Count:

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

Read from stream into buffer.

 

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)

 

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

Parameters:

  • Buffer:
  • Offset:
  • Count:

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)

 

Function Seek(Offset As Int64, Origin As SeekOrigin) As Int64

Parameters:

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

SetLength (Int64)  override virtual Android, iOS, iOS Simulator, Mac Catalyst, macOS, tvOS, tvOS Simulator, Ubuntu, watchOS, watchOS Simulator, Windows

 

method SetLength(value: Int64)

 

void SetLength(Int64 value)

 

func SetLength(_ value: Int64)

 

void SetLength(Int64 value)

 

Sub SetLength(value As Int64)

Parameters:

  • value:

SetLength (Int64)  override virtual UIKit for Mac

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

 

method SetLength(value: Int64)

 

SetLength(Int64 value)

 

func SetLength(_ value: Int64)

 

SetLength(Int64 value)

 

Sub SetLength(value As Int64)

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()

 

Function ToString() As String

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)

 

Function Write(aSpan As ImmutableSpan<Byte>) As Int32

Parameters:

  • aSpan:

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

Writes buf to a 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)

 

Function Write(buf As Ptr(Of Void), Count As Int32) As Int32

Parameters:

  • buf:
  • Count:

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

Writes a byte array to this 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)

 

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

Parameters:

  • Buffer:
  • Offset:
  • Count: