Share via


MessagePackFragment Struct

Definition

A sequence of bytes serialized using MessagePack.

[MessagePack.MessagePackFormatter(typeof(Microsoft.VisualStudio.RpcContracts.RemoteUI.MessagePackFragment+MessagePackFragmentFormatter))]
[Newtonsoft.Json.JsonConverter(typeof(Microsoft.VisualStudio.RpcContracts.RemoteUI.MessagePackFragment+MessagePackFragmentConverter))]
[System.Runtime.CompilerServices.IsReadOnly]
public readonly struct MessagePackFragment
[<MessagePack.MessagePackFormatter(typeof(Microsoft.VisualStudio.RpcContracts.RemoteUI.MessagePackFragment+MessagePackFragmentFormatter))>]
[<Newtonsoft.Json.JsonConverter(typeof(Microsoft.VisualStudio.RpcContracts.RemoteUI.MessagePackFragment+MessagePackFragmentConverter))>]
[<System.Runtime.CompilerServices.IsReadOnly>]
type MessagePackFragment = struct
Public Structure MessagePackFragment
Inheritance
MessagePackFragment
Attributes
MessagePack.MessagePackFormatterAttribute Newtonsoft.Json.JsonConverterAttribute IsReadOnlyAttribute

Remarks

When a MessagePackFragment is serialized as part of a larger MessagePack payload, it is written as raw data prefixed by its length. This allows the larger payload to be logged as json showing the content of the fragment in a readable format. Upon deserialization the fragment is retrieved as-is allowing it to be deserialized separately from the payload containing it, possibly at a later time.

Constructors

MessagePackFragment(ReadOnlySequence<Byte>)

Initializes a new instance of the MessagePackFragment struct.

Properties

Data

Gets a sequence of bytes in MessagePack format.

Length

Gets the length in bytes of the fragment.

Applies to