Beispiel #1
0
        public void WriteField <TBufferWriter>(ref Writer <TBufferWriter> writer, uint fieldIdDelta, Type expectedType, SiloAddress value) where TBufferWriter : IBufferWriter <byte>
        {
            if (value is null)
            {
                ReferenceCodec.WriteNullReference(ref writer, fieldIdDelta, expectedType);
                return;
            }

            ReferenceCodec.MarkValueField(writer.Session);
            writer.WriteStartObject(fieldIdDelta, expectedType, _codecFieldType);
            IPEndPointCodec.WriteField(ref writer, 0U, _iPEndPointType, value.Endpoint);
            Int32Codec.WriteField(ref writer, 1U, _int32Type, value.Generation);
            writer.WriteEndObject();
        }