public unsafe void WriteObject(BinSerializer bs) { bs.Write(WaitHandle.ToInt64()); bs.Write(RaftGroupId); bs.Write(DataCF); bs.Write(KeySize); var span = new ReadOnlySpan <byte>(KeyPtr.ToPointer(), (int)KeySize); bs.Stream.Write(span); }
public unsafe void ReadObject(BinSerializer bs) { WaitHandle = new IntPtr(bs.ReadInt64()); RaftGroupId = bs.ReadUInt64(); DataCF = bs.ReadInt32(); KeySize = bs.ReadUInt32(); KeyPtr = Marshal.AllocHGlobal((int)KeySize); var span = new Span <byte>(KeyPtr.ToPointer(), (int)KeySize); bs.Stream.Read(span); }