Table of Contents

Class S101DocumentWriter

Namespace
EncDotNet.S100.Datasets.S101
Assembly
EncDotNet.S100.Datasets.S101.dll

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

document S101Document

The document to serialize.

Returns

byte[]

The encoded ISO 8211 dataset bytes.

Exceptions

ArgumentNullException

document is null.

Write(Stream, S101Document)

Serializes the supplied document to a stream.

public static void Write(Stream stream, S101Document document)

Parameters

stream Stream

The destination stream.

document S101Document

The 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

stream Stream

The destination stream.

document S101Document

The document to serialize.

cancellationToken CancellationToken

A 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

path string

The destination file path.

document S101Document

The document to serialize.

Exceptions

ArgumentException

path is null or empty.

ArgumentNullException

document is 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

path string

The destination file path.

document S101Document

The document to serialize.

cancellationToken CancellationToken

A token to cancel the operation.

Returns

Task

A task that completes when the file has been written.

Exceptions

ArgumentException

path is null or empty.

ArgumentNullException

document is null.