public async static Task <TransactData> ReadFromFile(string fileName) { byte[] sourceArray = await FileUtil.ReadFromFile(fileName, 0, 0x40); byte[] destinationArray = new byte[4]; Array.Copy(sourceArray, 2, destinationArray, 0, 4); int count = BitConverter.ToInt32(destinationArray, 0); TransactDataP protoObj = TransactDataP.ParseFrom((await FileUtil.ReadFromFile(fileName, 0x40, count))); TransactData data = new TransactData(); data.FromProto(protoObj); return(data); }
public static TransactData ReadFromFile(string filePath) { byte[] array = FileUtil.readFromFile(filePath, 0, 64); byte[] array2 = new byte[4]; Array.Copy(array, 2, array2, 0, 4); int count = BitConverter.ToInt32(array2, 0); byte[] data = FileUtil.readFromFile(filePath, 64, count); TransactDataP protoObj = TransactDataP.ParseFrom(data); TransactData transactData = new TransactData(); transactData.FromProto(protoObj); return(transactData); }
public async static Task<TransactData> ReadFromFile(string fileName) { byte[] sourceArray = await FileUtil.ReadFromFile(fileName, 0, 0x40); byte[] destinationArray = new byte[4]; Array.Copy(sourceArray, 2, destinationArray, 0, 4); int count = BitConverter.ToInt32(destinationArray, 0); TransactDataP protoObj = TransactDataP.ParseFrom((await FileUtil.ReadFromFile(fileName, 0x40, count))); TransactData data = new TransactData(); data.FromProto(protoObj); return data; }