Skip to content

Class: FrameDecoder ​

Defined in: netconf/src/transport/framing/framing.ts:52

Decodes RFC 6242 framed bytes into whole messages: push() bytes in, then call next() until it returns undefined. See Decoding bytes you already have.

Constructors ​

Constructor ​

ts
new FrameDecoder(options?): FrameDecoder;

Defined in: netconf/src/transport/framing/framing.ts:73

Parameters ​

options? ​

DecoderOptions = {}

Returns ​

FrameDecoder

Accessors ​

bufferedBytes ​

Get Signature ​

ts
get bufferedBytes(): number;

Defined in: netconf/src/transport/framing/framing.ts:85

Bytes received but not yet returned as part of a message.

Returns ​

number


mode ​

Get Signature ​

ts
get mode(): FramingMode;

Defined in: netconf/src/transport/framing/framing.ts:80

The framing currently being decoded.

Returns ​

FramingMode

Methods ​

next() ​

ts
next(): string | undefined;

Defined in: netconf/src/transport/framing/framing.ts:113

The next complete message, or undefined if more bytes are needed.

Returns ​

string | undefined

Throws ​

FramingError; the decoder is unusable afterwards.


push() ​

ts
push(chunk): void;

Defined in: netconf/src/transport/framing/framing.ts:104

Add received bytes. The decoder may keep a reference to them until they are decoded, so don't modify them.

Parameters ​

chunk ​

Uint8Array

Returns ​

void


setMode() ​

ts
setMode(mode): void;

Defined in: netconf/src/transport/framing/framing.ts:93

Switch framing for every byte not yet decoded. Only EOM → chunked is meaningful (RFC 6242 §4.1), and only between messages.

Parameters ​

mode ​

FramingMode

Returns ​

void

Released under the MIT Licence.