Table of Contents

Struct BinarySetElement

Namespace
DynaSharp.Serialization
Assembly
DynaSharp.dll

The elements of a binary set (BS): byte[], as base64.

public readonly struct BinarySetElement : IDynamoDbSetElementConverter<byte[]>
Implements
Inherited Members

Remarks

DynamoDB accepts a zero-length element. Arrays compare by reference, so a HashSet<T> of byte[] built with the default comparer holds two arrays with the same bytes as two elements, and DynamoDB rejects such a set. Leave the duplicates out before writing, or use a set type with a comparer of your own.

Explicit Interface Implementations

ReadElement(ref DynamoDbReader)

Reads the element the reader is positioned on, with the reader's getter for SetType. Reads nothing beyond the element.

static byte[] ReadElement(ref DynamoDbReader reader)

Parameters

reader DynamoDbReader

The reader, positioned on an element after TryReadSetElement() returned true.

Returns

byte[]

The element.

Exceptions

JsonException

The text is not valid base64.

SetType

Gets the kind of set the elements belong to: StringSet, NumberSet or BinarySet.

static AttributeType SetType { get; }

Returns

AttributeType

WriteElement(DynamoDbWriter, byte[])

Writes one element, with the writer's Write...SetElement method for SetType.

static void WriteElement(DynamoDbWriter writer, byte[] value)

Parameters

writer DynamoDbWriter

The writer, inside a set that SetType started.

value byte[]

The element.

Exceptions

ArgumentNullException

value is null.