Table of Contents

Class TlvStream

Namespace
NLightning.Common.Types
Assembly
NLightning.Common.dll

A series of (possibly zero) TLVs

public sealed class TlvStream
Inheritance
TlvStream
Inherited Members

Methods

Add(Tlv)

Add a TLV to the stream

public void Add(Tlv tlv)

Parameters

tlv Tlv

The TLV to add

Any()

Check if any TLVs are present

public bool Any()

Returns

bool

DeserializeAsync(Stream)

Deserialize a TLV stream

public static Task<TlvStream?> DeserializeAsync(Stream stream)

Parameters

stream Stream

The stream to use

Returns

Task<TlvStream>

The TLV stream

Exceptions

SerializationException

Error deserializing TLVStream or any of it's TLVs

GetTlvs()

Get all TLVs in the stream

public IEnumerable<Tlv> GetTlvs()

Returns

IEnumerable<Tlv>

SerializeAsync(Stream)

Serialize the TLV stream

public Task SerializeAsync(Stream stream)

Parameters

stream Stream

Returns

Task

TryGetTlv(BigSize, out Tlv?)

Get a specific TLV from the stream

public bool TryGetTlv(BigSize type, out Tlv? tlv)

Parameters

type BigSize

The type of TLV to get

tlv Tlv

The TLV to get

Returns

bool