public static MemoryStream Save(this IBinarySerializable @this) { var stream = new MemoryStream(); @this.Save(stream); stream.Position = 0; return(stream); }
public static void WriteNullableObject(IBinarySerializable obj, BinaryWriter w) { if (obj != null) { w.Write(BinarySerializable.IsNormal); obj.Save(w); } else { w.Write(BinarySerializable.IsNull); } }