Table of Contents

Class TextLinoProtocol

Namespace
Foundation.Data.Doublets.Cli.Protocol
Assembly
Foundation.Data.Doublets.Cli.dll

UTF-8 LiNo text, one message per block of lines ended by a line holding only .. Lines starting with . get one extra . (SMTP dot-stuffing).

public sealed record TextLinoProtocol : ILinoProtocol, IEquatable<TextLinoProtocol>
Inheritance
TextLinoProtocol
Implements
Inherited Members

Remarks

Lines may end with \n or \r\n; a carriage return right before a line feed is dropped in legacy quoted input. The formatter uses lossless ~1{hex} literals for control characters, preserving \r\n inside references.

Properties

MaxTextBytes

Maximum size of a text message in bytes, applied when reading.

public long MaxTextBytes { get; init; }

Property Value

long

Methods

Reads one message; null when the stream ended cleanly.

public IReadOnlyList<Link<string>>? ReadDocument(PacketReader input)

Parameters

input PacketReader

Returns

IReadOnlyList<Link<string>>

Reads one framed message as raw text, without parsing it.

public string? ReadText(PacketReader input)

Parameters

input PacketReader

Returns

string

Writes one message carrying document.

public void WriteDocument(Stream output, IReadOnlyList<Link<string>> document)

Parameters

output Stream
document IReadOnlyList<Link<string>>

WriteText(Stream, string)

Frames already formatted LiNo text as one message.

public static void WriteText(Stream output, string text)

Parameters

output Stream
text string