Struct DatasetHeader
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
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
IsHdf5
Whether the file starts with the HDF5 signature.
public bool IsHdf5 { get; }
Property Value
LeadingBytes
The file's leading bytes, at most MaxLength; empty when unreadable.
public required ReadOnlyMemory<byte> LeadingBytes { get; init; }
Property Value
Methods
HasExtension(string)
Whether Extension is extension, ignoring case.
public bool HasExtension(string extension)
Parameters
extensionstringThe extension including the dot, e.g.
".grib2".
Returns
StartsWith(ReadOnlySpan<byte>)
Whether LeadingBytes starts with signature.
public bool StartsWith(ReadOnlySpan<byte> signature)
Parameters
signatureReadOnlySpan<byte>The bytes to look for at offset 0.
Returns
StartsWithAscii(string)
Whether LeadingBytes starts with the ASCII text
signature (e.g. "GRIB"), compared exactly.
public bool StartsWithAscii(string signature)
Parameters
signaturestringThe ASCII signature to look for at offset 0.