public void Serialize <TBufferWriter>(ref Writer <TBufferWriter> writer, SubType obj) where TBufferWriter : IBufferWriter <byte> { _baseTypeSerializer.Serialize(ref writer, obj); writer.WriteEndBase(); // the base object is complete. _stringCodec.WriteField(ref writer, 0, typeof(string), obj.String); _intCodec.WriteField(ref writer, 1, typeof(int), obj.Int); _objectCodec.WriteField(ref writer, 1, typeof(object), obj.Ref); _intCodec.WriteField(ref writer, 1, typeof(int), obj.Int); _intCodec.WriteField(ref writer, 409, typeof(int), obj.Int); /*writer.WriteFieldHeader(session, 1025, typeof(Guid), Guid.Empty.GetType(), WireType.Fixed128); * writer.WriteFieldHeader(session, 1020, typeof(object), typeof(Program), WireType.Reference);*/ }
public void Serialize <TBufferWriter>(ref Writer <TBufferWriter> writer, TField value) where TBufferWriter : IBufferWriter <byte> => _codec.Serialize(ref writer, value);