public static void MarshalSP <T>(T obj, Stream stream) { var output = new OutputStream(stream, 11); var writer = new SimpleBinaryWriter <OutputStream>(output); Marshal.To(writer, obj); output.Flush(); }
public static ArraySegment <byte> MarshalCB <T>(T obj) { var output = new OutputBuffer(new byte[11]); var writer = new CompactBinaryWriter <OutputBuffer>(output); Marshal.To(writer, obj); return(output.Data); }
public static ArraySegment <byte> MarshalFB <T>(T obj) { var output = new OutputBuffer(); var writer = new FastBinaryWriter <OutputBuffer>(output); Marshal.To(writer, obj); return(output.Data); }
public static void MarshalCB2 <T>(T obj, Stream stream) { var output = new OutputStream(stream, 11); var writer = new CompactBinaryWriter <OutputStream>(output, 2); Marshal.To(writer, obj); output.Flush(); }