什么是最通用的描述数据的方法(没有逻辑附加),这些数据可以在不同的平台、数据库上共享,这些数据都是用不同的语言编写的?
到目前为止我的观点是:
JSON
优点:
大多数系统的实现
人类可读性
合理快速
- Cons:
- Hard to scale up (too much data!)
- No standard way to validate semantics
- No standard way to present for non-technical user
XML
优点:
大多数系统的实现
我使用类型为unsigned short的向量在RAM中分配了一大块连续的字节。
vector<unsigned short> testDump(204800000);
for(int k = 0; k<204800000; k++)
testDump[k] = 9; \\ This is different in my real program
现在,我想将这个向量保存到我的硬盘驱动器中。怎么做,最快的方法是什么?数据的大小相当大(约1/2 GB)。我尝试了以下几种方法:
ofstream outfile("allMyNumbers.txt", i