wchar_t* loadFile(const wchar_t* fname) {
wifstream ifs(fname, ios::binary);
if (ifs.is_open()) {
ifs.seekg(0, ios::end);
size_t len = (size_t)ifs.tellg();
ifs.seekg(0, ios::beg);
wchar_t* data = new wchar_t[len];
ZeroMemory(data, len);
ifs.read(data, len);
ifs.close();
return data;
}
}
typedef std::basic_ofstream<BYTE, std::char_traits<BYTE>> bofstream;