private void ReadMemViaUnion() { MemoryStream MS = new MemoryStream(Buffer); UnionBenefits y = new UnionBenefits(); BR = new BinaryReader(MS); y.DaysOff = BR.ReadDouble(); }
private void ReadViaUnion() { FS = new FileStream("UnionFile", FileMode.Open); UnionBenefits y = new UnionBenefits(); BR = new BinaryReader(FS); y.DaysOff = BR.ReadDouble(); }
private void WriteViaUnion() { UnionBenefits x = new UnionBenefits(); x.SickDays = 5; x.VacationDays = 15; FS = new FileStream("UnionFile", FileMode.OpenOrCreate); BW = new BinaryWriter(FS); BW.Write(x.DaysOff); BW.Flush(); BW.Close(); }
private void WriteMemViaUnion() { UnionBenefits x = new UnionBenefits(); x.SickDays = 33; x.VacationDays = 66; MemoryStream MS = new MemoryStream(Buffer); BW = new BinaryWriter(MS); BW.Write(x.DaysOff); BW.Flush(); BW.Close(); }