FileReaderResult Struct

The result of a FileReader: a string or a byte array (an ArrayBuffer in JavaScript).

public readonly struct FileReaderResult : IEquatable<FileReaderResult>
Implements

Properties

NameDescription
BytesValueGets the value as bytes, or null when the result is a string.
StringValueGets the value as a string, or null when the result is a byte array.
ValueGets the value: a String or a Byte array.

BytesValue

FileReader.cs

Gets the value as bytes, or null when the result is a string.

public ReadOnlyMemory<byte>? BytesValue { get; }

Property value

ReadOnlyMemory<byte>?

StringValue

FileReader.cs

Gets the value as a string, or null when the result is a byte array.

public string? StringValue { get; }

Property value

string?

Gets the value: a String or a Byte array.

public object Value { get; }

Property value

object

Methods

NameDescription
Equals(FileReaderResult)Indicates whether the current object is equal to another object of the same type.
Equals(object?)Indicates whether this instance and a specified object are equal.
FromBytes(byte[])Creates a result from a byte array.
FromString(string)Creates a result from a string.
GetHashCode()Returns the hash code for this instance.
ToString()Returns the fully qualified type name of this instance.

Equals overloads

Equals(FileReaderResult)

FileReader.cs

Indicates whether the current object is equal to another object of the same type.

public bool Equals(FileReaderResult other)
Parameters
other FileReaderResult
An object to compare with this object.
Returns

bool true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

FileReader.cs

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)
Parameters
obj object?
The object to compare with the current instance.
Returns

bool true if obj and this instance are the same type and represent the same value; otherwise, false.

FromBytes(byte[])

FileReader.cs

Creates a result from a byte array.

public static FileReaderResult FromBytes(byte[] value)

Parameters

value byte[]

Returns

FileReaderResult

FromString(string)

FileReader.cs

Creates a result from a string.

public static FileReaderResult FromString(string value)

Parameters

value string

Returns

FileReaderResult

GetHashCode()

FileReader.cs

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int A 32-bit signed integer that is the hash code for this instance.

ToString()

FileReader.cs

Returns the fully qualified type name of this instance.

public override string? ToString()

Returns

string? The fully qualified type name.

Operators

NameDescription
operator ==(FileReaderResult, FileReaderResult)Returns whether two results have the same value.
implicit operator FileReaderResult(byte[])Converts a byte array to a result.
implicit operator FileReaderResult(string)Converts a string to a result.
operator !=(FileReaderResult, FileReaderResult)Returns whether two results have different values.

operator ==(FileReaderResult, FileReaderResult)

FileReader.cs

Returns whether two results have the same value.

public static bool operator ==(FileReaderResult left, FileReaderResult right)

Parameters

left FileReaderResult
right FileReaderResult

Returns

bool

op_Implicit overloads

implicit operator FileReaderResult(byte[])

FileReader.cs

Converts a byte array to a result.

public static implicit operator FileReaderResult(byte[] value)
Parameters
value byte[]
Returns

FileReaderResult

implicit operator FileReaderResult(string)

FileReader.cs

Converts a string to a result.

public static implicit operator FileReaderResult(string value)
Parameters
value string
Returns

FileReaderResult

operator !=(FileReaderResult, FileReaderResult)

FileReader.cs

Returns whether two results have different values.

public static bool operator !=(FileReaderResult left, FileReaderResult right)

Parameters

left FileReaderResult
right FileReaderResult

Returns

bool