Skip to content

Class KernelRpcBinaryCodec

Namespace: DotBoxD.Plugins
Assembly: DotBoxD.Plugins.dll

Encodes server extension IR values as a small binary payload: one value-kind byte followed by only the active scalar or child sequence. The IPC layer transports the resulting bytes as an ordinary binary argument, avoiding reflection-bound DTO maps and repeated string kind tags on the wire.

public static class KernelRpcBinaryCodec

objectKernelRpcBinaryCodec

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

The encode side writes into an System.Buffers.IBufferWriter so the hot push path can supply a pooled buffer and hand its written span straight to the transport. The byte[]-returning overloads stay for server-extension callers and tests; they encode through a pooled writer and copy once at the boundary.

public static KernelRpcValue[] DecodeArguments(ReadOnlyMemory<byte> payload)

payload ReadOnlyMemory<byte>

KernelRpcValue[]

public static KernelRpcValue DecodeValue(ReadOnlyMemory<byte> payload)

payload ReadOnlyMemory<byte>

KernelRpcValue

EncodeArguments(IReadOnlyList<KernelRpcValue>)

Section titled “ EncodeArguments(IReadOnlyList<KernelRpcValue>)”
public static byte[] EncodeArguments(IReadOnlyList<KernelRpcValue> arguments)

arguments IReadOnlyList<KernelRpcValue>

byte[]

EncodeArguments(IReadOnlyList<KernelRpcValue>, IBufferWriter<byte>)

Section titled “ EncodeArguments(IReadOnlyList<KernelRpcValue>, IBufferWriter<byte>)”

Encodes arguments into writer without an intermediate array.

public static void EncodeArguments(IReadOnlyList<KernelRpcValue> arguments, IBufferWriter<byte> writer)

arguments IReadOnlyList<KernelRpcValue>

writer IBufferWriter<byte>

public static byte[] EncodeValue(KernelRpcValue value)

value KernelRpcValue

byte[]

EncodeValue(KernelRpcValue, IBufferWriter<byte>)

Section titled “ EncodeValue(KernelRpcValue, IBufferWriter<byte>)”

Encodes value into writer without an intermediate array.

public static void EncodeValue(KernelRpcValue value, IBufferWriter<byte> writer)

value KernelRpcValue

writer IBufferWriter<byte>

public static byte[] EncodeValue(SandboxValue value)

value SandboxValue

byte[]

EncodeValue(SandboxValue, IBufferWriter<byte>)

Section titled “ EncodeValue(SandboxValue, IBufferWriter<byte>)”

Encodes value into writer without building a KernelRpcValue tree.

public static void EncodeValue(SandboxValue value, IBufferWriter<byte> writer)

value SandboxValue

writer IBufferWriter<byte>