123456789101112131415161718192021222324 |
- using System.Collections.Generic;
- using System.IO;
- using System.Text;
- namespace SongCore.Arcache
- {
- public static class LengthPack
- {
- public static Dictionary<string, float> Read(string filePath)
- {
- var bufLz4 = File.ReadAllBytes(filePath);
- var bufRaw = Lz4ArchiveBase.DecompressPickle(bufLz4);
- var dic = new Dictionary<string, float>();
- var ms = new MemoryStream(bufRaw);
- var reader = new BinaryReader(ms, Encoding.UTF8);
- while (ms.Position < ms.Length)
- {
- var ar = reader.ReadString().ToLower();
- dic[ar] = reader.ReadSingle();
- }
- return dic;
- }
- }
- }
|