Table of Contents

Interface IJsonRpcMessageFormatter

Namespace
StreamJsonRpc
Assembly
StreamJsonRpc.dll

An interface that offers JsonRpcMessage serialization to and from a sequence of bytes.

public interface IJsonRpcMessageFormatter

Methods

Deserialize(ReadOnlySequence<byte>)

Deserializes a JsonRpcMessage.

JsonRpcMessage Deserialize(ReadOnlySequence<byte> contentBuffer)

Parameters

contentBuffer ReadOnlySequence<byte>

A sequence of bytes to deserialize.

Returns

JsonRpcMessage

The deserialized JsonRpcMessage.

GetJsonText(JsonRpcMessage)

Gets a JSON representation for a given message for tracing purposes.

[Obsolete("Tracing is now done via the IJsonRpcTracingCallbacks and IJsonRpcFormatterTracingCallbacks interfaces. Formatters may throw NotSupportedException from this method.")]
object GetJsonText(JsonRpcMessage message)

Parameters

message JsonRpcMessage

The message to be traced.

Returns

object

Any object whose ToString() method will produce a human-readable JSON string, suitable for tracing.

Serialize(IBufferWriter<byte>, JsonRpcMessage)

Serializes a JsonRpcMessage.

void Serialize(IBufferWriter<byte> bufferWriter, JsonRpcMessage message)

Parameters

bufferWriter IBufferWriter<byte>

The receiver of the serialized bytes.

message JsonRpcMessage

The message to serialize.