Table of Contents

Struct DatasetHeader

Namespace
EncDotNet.S100.Datasets.Pipelines
Assembly
EncDotNet.S100.Datasets.Pipelines.dll

The leading bytes of a dataset file and its extension, read once by DatasetPipelineFactory and handed to each product's DatasetBytesMatcher.

public readonly record struct DatasetHeader : IEquatable<DatasetHeader>
Implements
Inherited Members

Fields

MaxLength

How many leading bytes the factory reads (fewer for a shorter file).

public const int MaxLength = 1024

Field Value

int

Properties

Extension

The file's extension including the dot (e.g. ".grib2"), or empty when it has none. A NOMADS GRIB filter download, for one, has no useful extension.

public required string Extension { get; init; }

Property Value

string

IsHdf5

Whether the file starts with the HDF5 signature.

public bool IsHdf5 { get; }

Property Value

bool

LeadingBytes

The file's leading bytes, at most MaxLength; empty when unreadable.

public required ReadOnlyMemory<byte> LeadingBytes { get; init; }

Property Value

ReadOnlyMemory<byte>

Methods

HasExtension(string)

Whether Extension is extension, ignoring case.

public bool HasExtension(string extension)

Parameters

extension string

The extension including the dot, e.g. ".grib2".

Returns

bool

StartsWith(ReadOnlySpan<byte>)

Whether LeadingBytes starts with signature.

public bool StartsWith(ReadOnlySpan<byte> signature)

Parameters

signature ReadOnlySpan<byte>

The bytes to look for at offset 0.

Returns

bool

StartsWithAscii(string)

Whether LeadingBytes starts with the ASCII text signature (e.g. "GRIB"), compared exactly.

public bool StartsWithAscii(string signature)

Parameters

signature string

The ASCII signature to look for at offset 0.

Returns

bool