Table of Contents

Class BinaryConverter

Namespace
ShapeShift.MsgPack
Assembly
ShapeShift.MsgPack.dll

Converts byte arrays using the MessagePack binary family.

public sealed class BinaryConverter : ShapeShiftConverter<byte[], MsgPackEncoder, MsgPackDecoder>
Inheritance
BinaryConverter
Inherited Members

Methods

GetContract(ContractContext<MsgPackEncoder, MsgPackDecoder>)

Describes the serialized form that this converter produces and accepts.

public override DataContract? GetContract(ContractContext<MsgPackEncoder, MsgPackDecoder> context)

Parameters

context ContractContext<MsgPackEncoder, MsgPackDecoder>

Services for describing other types that this converter composes with.

Returns

DataContract

The contract for the data this converter reads and writes, or null if this converter does not describe itself.

Remarks

The default implementation returns null, which causes ShapeShift to describe the type with an UndocumentedContract rather than guess at a representation. Override this method so that schema consumers can understand your converter's output.

The returned contract must describe exactly what WriteObject(ref TEncoder, object?, SerializationContext<TEncoder, TDecoder>) emits.

Read(ref MsgPackDecoder, SerializationContext<MsgPackEncoder, MsgPackDecoder>)

public override byte[]? Read(ref MsgPackDecoder decoder, SerializationContext<MsgPackEncoder, MsgPackDecoder> context)

Parameters

decoder MsgPackDecoder
context SerializationContext<MsgPackEncoder, MsgPackDecoder>

Returns

byte[]

Write(ref MsgPackEncoder, in byte[]?, SerializationContext<MsgPackEncoder, MsgPackDecoder>)

public override void Write(ref MsgPackEncoder encoder, in byte[]? value, SerializationContext<MsgPackEncoder, MsgPackDecoder> context)

Parameters

encoder MsgPackEncoder
value byte[]
context SerializationContext<MsgPackEncoder, MsgPackDecoder>