Show / Hide Table of Contents

TlvObject Constructor

TlvObject(int, ReadOnlySpan<byte>)

Creates a new TLV (Tag-Length-Value) object with the specified tag and value.

C#
public TlvObject(int tag, ReadOnlySpan<byte> value)

Parameters

Type Name Description
int tag

The tag value, must be between 0x00 and 0xFFFF.

ReadOnlySpan<byte> value

The value data as a read-only span of bytes.

Exceptions

Type Condition
TlvException

Thrown when the tag value is outside the supported range (0x00-0xFFFF).

Remarks

This constructor creates a BER-TLV encoded structure where:

  • The tag is encoded in the minimum number of bytes needed
  • The length is encoded according to BER-TLV rules
  • The value is stored as provided
In this article
Back to top Generated by DocFX