using System.IO; namespace OCES.Audio { /// /// 文件操作类 /// public static class FileManager { /// /// 从内存流中读取二进制 /// /// /// /// public static bool ReadBinaryDataFromBytes(byte[] bytes, ref IBinarySerializable data) { if (bytes == null) return false; using (MemoryStream memoryStream = new(bytes)) { using (var br = new BinaryReader(memoryStream)) { data.DeSerialize(br); br.Close(); } memoryStream.Close(); } return true; } } }