Skip to content

LineDecoder

Defined in: packages/format-core/src/codecs/line-decoder.ts:39

Decodes one string per \n-terminated line, stripping a preceding \r.

This is the read half of the framing used by SMTP, LMTP, IMAP, POP3, IRC and most other text command protocols. Stateful across partial lines, so an instance must back exactly one driver.

new LineDecoder(encoding, options?): LineDecoder

Defined in: packages/format-core/src/codecs/line-decoder.ts:46

TextEncodingName

LineDecoderOptions

LineDecoder

decode(view): DecodeResult<string>

Defined in: packages/format-core/src/codecs/line-decoder.ts:54

Attempt to decode one value from the front of view.

view is a window into the driver’s buffer and is invalidated as soon as this call returns. Copy anything retained in the returned value.

Uint8Array

DecodeResult<string>

Decoder.decode


reset(): void

Defined in: packages/format-core/src/codecs/line-decoder.ts:98

Discard accumulated decode state ahead of a protocol mode switch.

void

Decoder.reset