FileHandle
Overview
Low level file handle.
Location
- Reference:
- Elements.dll .NET, .NET Core 6.0, .NET Standard 2.0
- elements.jar Cooper
- Elements.fx Island-Android, Island-iOS Simulator, Island-iOS-arm64, Island-Mac Catalyst, Island-macOS, Island-tvOS Simulator, Island-tvOS-arm64, Island-Ubuntu, Island-visionOS Simulator, Island-visionOS-arm64, Island-watchOS Simulator, Island-watchOS-arm64_32, Island-Windows, ToffeeV2
- libElements.fx Toffee
- Namespace: RemObjects.Elements.RTL
- Platforms: .NET, .NET Core 6.0, .NET Standard 2.0, Cooper, Island-Android, Island-iOS Simulator, Island-iOS-arm64, Island-Mac Catalyst, Island-macOS, Island-tvOS Simulator, Island-tvOS-arm64, Island-Ubuntu, Island-visionOS Simulator, Island-visionOS-arm64, Island-watchOS Simulator, Island-watchOS-arm64_32, Island-Windows, Toffee, ToffeeV2
- Mapped to:
- FileStream .NET, .NET Core 6.0, .NET Standard 2.0, ToffeeV2
- RandomAccessFile Cooper
- FileStream Island-Android, Island-iOS Simulator, Island-iOS-arm64, Island-Mac Catalyst, Island-macOS, Island-tvOS Simulator, Island-tvOS-arm64, Island-Ubuntu, Island-visionOS Simulator, Island-visionOS-arm64, Island-watchOS Simulator, Island-watchOS-arm64_32, Island-Windows
- NSFileHandle Toffee
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)Sub New(FileName As String, Mode As FileOpenMode)Parameters:
- FileName:
- Mode:
Close the handle.
method Closevoid Close()func Close()void Close()Sub Close()Flush the changes to the file to disk.
method Flushvoid Flush()func Flush()void Flush()Sub Flush()Create a filehandle from a File object
class method FromFile(aFile: File; Mode: FileOpenMode): FileHandlestatic FileHandle FromFile(File aFile, FileOpenMode Mode)static func FromFile( aFile: File, Mode: FileOpenMode) -> FileHandlestatic FileHandle FromFile(File aFile, FileOpenMode Mode)Shared Function FromFile(aFile As File, Mode As FileOpenMode) As FileHandleParameters:
- aFile:
- Mode:
Returns the size of this file.
property Length: Int64 read write;Int64 Length { get; set; }var Length: Int64 { get{} set{} }Int64 Length { get; set; }Property Length() As Int64Returns the current position in this file.
property Position: Int64 read write;Int64 Position { get; set; }var Position: Int64 { get{} set{} }Int64 Position { get; set; }Property Position() As Int64Read 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): Int32Int32 Read(Byte[] Buffer, Int32 Count)func Read( Buffer: Byte..., Count: Int32) -> Int32Integer Read(Byte[] Buffer, Integer Count)Function Read(Buffer As Byte(), Count As Int32) As Int32Parameters:
- Buffer:
- Count:
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): Int32Int32 Read(Byte[] Buffer, Int32 Offset, Int32 Count)func Read( Buffer: Byte..., Offset: Int32, _ Count: Int32) -> Int32Integer Read(Byte[] Buffer, Integer Offset, Integer Count)Function Read(Buffer As Byte(), Offset As Int32, Count As Int32) As Int32Parameters:
- Buffer:
- Offset:
- Count:
Read Count bytes from a file, returning it as binary.
method Read(Count: Int32): ImmutableBinaryImmutableBinary Read(Int32 Count)func Read(_ Count: Int32) -> ImmutableBinaryImmutableBinary Read(Integer Count)Function Read(Count As Int32) As ImmutableBinaryParameters:
- Count:
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)Sub Seek(Offset As Int64, Origin As SeekOrigin)Parameters:
- Offset:
- Origin:
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)Sub Write(Buffer As Byte())Parameters:
- Buffer:
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)Sub Write(Buffer As Byte(), Count As Int32)Parameters:
- Buffer:
- Count:
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)Sub Write(Buffer As Byte(), Offset As Int32, Count As Int32)Parameters:
- Buffer:
- Offset:
- Count:
Write a binary to a file.
method Write(Data: ImmutableBinary)void Write(ImmutableBinary Data)func Write(_ Data: ImmutableBinary)void Write(ImmutableBinary Data)Sub Write(Data As ImmutableBinary)Parameters:
- Data:
Returns the size of this file.
property Length: Int64 read write;Int64 Length { get; set; }var Length: Int64 { get{} set{} }Int64 Length { get; set; }Property Length() As Int64Returns the current position in this file.
property Position: Int64 read write;Int64 Position { get; set; }var Position: Int64 { get{} set{} }Int64 Position { get; set; }Property Position() As Int64
Create a filehandle from a File object
class method FromFile(aFile: File; Mode: FileOpenMode): FileHandlestatic FileHandle FromFile(File aFile, FileOpenMode Mode)static func FromFile( aFile: File, Mode: FileOpenMode) -> FileHandlestatic FileHandle FromFile(File aFile, FileOpenMode Mode)Shared Function FromFile(aFile As File, Mode As FileOpenMode) As FileHandleParameters:
- aFile:
- Mode:
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)Sub New(FileName As String, Mode As FileOpenMode)Parameters:
- FileName:
- Mode:
Close the handle.
method Closevoid Close()func Close()void Close()Sub Close()Flush the changes to the file to disk.
method Flushvoid Flush()func Flush()void Flush()Sub Flush()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): Int32Int32 Read(Byte[] Buffer, Int32 Count)func Read( Buffer: Byte..., Count: Int32) -> Int32Integer Read(Byte[] Buffer, Integer Count)Function Read(Buffer As Byte(), Count As Int32) As Int32Parameters:
- Buffer:
- Count:
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): Int32Int32 Read(Byte[] Buffer, Int32 Offset, Int32 Count)func Read( Buffer: Byte..., Offset: Int32, _ Count: Int32) -> Int32Integer Read(Byte[] Buffer, Integer Offset, Integer Count)Function Read(Buffer As Byte(), Offset As Int32, Count As Int32) As Int32Parameters:
- Buffer:
- Offset:
- Count:
Read Count bytes from a file, returning it as binary.
method Read(Count: Int32): ImmutableBinaryImmutableBinary Read(Int32 Count)func Read(_ Count: Int32) -> ImmutableBinaryImmutableBinary Read(Integer Count)Function Read(Count As Int32) As ImmutableBinaryParameters:
- Count:
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)Sub Seek(Offset As Int64, Origin As SeekOrigin)Parameters:
- Offset:
- Origin:
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)Sub Write(Buffer As Byte())Parameters:
- Buffer:
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)Sub Write(Buffer As Byte(), Count As Int32)Parameters:
- Buffer:
- Count:
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)Sub Write(Buffer As Byte(), Offset As Int32, Count As Int32)Parameters:
- Buffer:
- Offset:
- Count:
Write a binary to a file.
method Write(Data: ImmutableBinary)void Write(ImmutableBinary Data)func Write(_ Data: ImmutableBinary)void Write(ImmutableBinary Data)Sub Write(Data As ImmutableBinary)Parameters:
- Data: