Skip to content

IOFileComponent Class

Definition

Base class for a component of a file, providing access to the underlying binary data.

public abstract class IOFileComponent

View source

Constructors

Name Description
IOFileComponent(Byte[]) Base class for a component of a file, providing access to the underlying binary data.
IOFileComponent(Int32) Initialises a new instance of the IOFileComponent class with zero-filled data of the specified length.
IOFileComponent(Int32, Stream) Initialises a new instance of the IOFileComponent class by reading data from a stream.
IOFileComponent(Int32, IEnumerable<Byte>) Initialises a new instance of the IOFileComponent class from a sequence of bytes.

Properties

Name Description
Data Gets the raw byte data for this component.
Length Gets the length of the data in bytes.

Methods

Name Description
AsReadOnlySpan() Returns the data as a read-only span.
AsReadOnlySpan(Int32) Returns the data as a read-only span starting at the specified index.
AsReadOnlySpan(Index) Returns the data as a read-only span starting at the specified index.
AsSpan() Returns the data as a writable span.
AsSpan(Int32) Returns the data as a writable span starting at the specified index.
AsSpan(Index) Returns the data as a writable span starting at the specified index.
CopyTo(Span<Byte>) Copies the data to the specified memory span.
CopyTo(Span<Byte>, Int32) Copies the data to the specified memory span at the given start position.
GetBit(Int32, Int32) Gets a single bit at the specified byte and bit index.
GetBits(Int32, Int32, Int32) Gets a range of bits from the byte at the specified index.
GetBits<TEnum>(Int32, Int32, Int32) Gets a range of bits from the byte at the specified index as an enum value.
GetByte(Int32) Gets the byte at the specified index.
GetByte<TEnum>(Int32) Gets the byte at the specified index as an enum value.
GetInt32(Int32, Endian) Gets a 32-bit signed integer at the specified index.
GetInt64(Int32, Endian) Gets a 64-bit signed integer at the specified index.
GetString(Int32, Int32) Gets a null-terminated ASCII string at the specified index.
GetUInt16(Int32, Endian) Gets a 16-bit unsigned integer at the specified index.
GetUInt24(Int32, Endian) Gets a 24-bit unsigned integer at the specified index.
GetUInt32(Int32, Endian) Gets a 32-bit unsigned integer at the specified index.
GetUInt64(Int32, Endian) Gets a 64-bit unsigned integer at the specified index.
SetBit(Int32, Int32, Boolean) Sets a single bit at the specified byte and bit index.
SetBits(Int32, Byte, Int32, Int32) Sets a range of bits in the byte at the specified index.
SetBits<TEnum>(Int32, TEnum, Int32, Int32) Sets a range of bits in the byte at the specified index from an enum value.
SetByte(Int32, Byte) Sets the byte at the specified index.
SetByte<TEnum>(Int32, TEnum) Sets the byte at the specified index from an enum value.
SetInt32(Int32, Int32, Endian) Sets a 32-bit signed integer at the specified index.
SetInt64(Int32, Int64, Endian) Sets a 64-bit signed integer at the specified index.
SetString(Int32, Int32, ReadOnlySpan<Char>) Sets a null-terminated ASCII string at the specified index.
SetUInt16(Int32, UInt16, Endian) Sets a 16-bit unsigned integer at the specified index.
SetUInt24(Int32, UInt24, Endian) Sets a 24-bit unsigned integer at the specified index.
SetUInt32(Int32, UInt32, Endian) Sets a 32-bit unsigned integer at the specified index.
SetUInt64(Int32, UInt64, Endian) Sets a 64-bit unsigned integer at the specified index.
Write(Stream) Writes the data to a stream.