Remove usages of BinaryFormatter.

This commit is contained in:
Huo Yaoyuan
2022-04-12 20:28:14 +08:00
parent e901857610
commit bf677ad0ac
2 changed files with 2 additions and 100 deletions

View File

@ -5,8 +5,6 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters;
using System.Runtime.Serialization.Formatters.Binary;
using System.Text;
// ReSharper disable ConditionIsAlwaysTrueOrFalse (we're allowing nulls to be passed to the writer where the underlying class doesn't).
@ -218,14 +216,7 @@ namespace osu.Game.IO.Legacy
break;
default:
Write((byte)ObjType.otherType);
BinaryFormatter b = new BinaryFormatter
{
// AssemblyFormat = FormatterAssemblyStyle.Simple,
TypeFormat = FormatterTypeStyle.TypesWhenNeeded
};
b.Serialize(BaseStream, obj);
break;
throw new IOException("Serialization of arbitrary type is not supported.");
} // switch
} // if obj==null
} // WriteObject