Class S101DocumentWriter
Serializes an S101Document to an S-101 ISO/IEC 8211 encoded
dataset (a .000 cell), the symmetric inverse of
EncDotNet.S100.Datasets.S101.S101DocumentReader.
public static class S101DocumentWriter
- Inheritance
-
S101DocumentWriter
- Inherited Members
Remarks
The writer emits a Data Descriptive Record (DDR) describing every field it uses, followed by one data record per dataset / spatial / feature / information object, using the field and subfield structure defined by S-101 (S-100 Part 10a). Field tags, subfield names, and binary formats mirror the canonical S-101 encoding so the output round-trips through EncDotNet.S100.Datasets.S101.S101DocumentReader.
This is the encoder consumed by the S-57 → S-101 conversion pipeline: an
S101Document produced by the translator is serialized here to a
standalone base cell (application profile 1). Feature-to-feature
associations (FASC) are serialized when present; the S-57 translator
produces them for RangeSystem aggregations (see the RangeSystemAggregation
mapping), so converted cells that contain such associations round-trip
through EncDotNet.S100.Datasets.S101.S101DocumentReader.
Methods
Write(S101Document)
Serializes the supplied document to an in-memory ISO 8211 byte buffer.
public static byte[] Write(S101Document document)
Parameters
documentS101DocumentThe document to serialize.
Returns
- byte[]
The encoded ISO 8211 dataset bytes.
Exceptions
- ArgumentNullException
documentis null.
Write(Stream, S101Document)
Serializes the supplied document to a stream.
public static void Write(Stream stream, S101Document document)
Parameters
streamStreamThe destination stream.
documentS101DocumentThe document to serialize.
Exceptions
- ArgumentNullException
A required argument is null.
WriteAsync(Stream, S101Document, CancellationToken)
Asynchronously serializes the supplied document to a stream.
public static Task WriteAsync(Stream stream, S101Document document, CancellationToken cancellationToken = default)
Parameters
streamStreamThe destination stream.
documentS101DocumentThe document to serialize.
cancellationTokenCancellationTokenA token to cancel the operation.
Returns
- Task
A task that completes when the document has been written.
Exceptions
- ArgumentNullException
A required argument is null.
WriteToFile(string, S101Document)
Serializes the supplied document to a file, overwriting any existing file.
public static void WriteToFile(string path, S101Document document)
Parameters
pathstringThe destination file path.
documentS101DocumentThe document to serialize.
Exceptions
- ArgumentException
pathis null or empty.- ArgumentNullException
documentis null.
WriteToFileAsync(string, S101Document, CancellationToken)
Asynchronously serializes the supplied document to a file, overwriting any existing file.
public static Task WriteToFileAsync(string path, S101Document document, CancellationToken cancellationToken = default)
Parameters
pathstringThe destination file path.
documentS101DocumentThe document to serialize.
cancellationTokenCancellationTokenA token to cancel the operation.
Returns
- Task
A task that completes when the file has been written.
Exceptions
- ArgumentException
pathis null or empty.- ArgumentNullException
documentis null.