write given buffer to the file, overwriting the file, it doesn't append to it.*/
| 6054 | |
| 6055 | /*write given buffer to the file, overwriting the file, it doesn't append to it.*/ |
| 6056 | void save_file(const std::vector<unsigned char>& buffer, const std::string& filename) |
| 6057 | { |
| 6058 | std::ofstream file(filename.c_str(), std::ios::out|std::ios::binary); |
| 6059 | file.write(buffer.empty() ? 0 : (char*)&buffer[0], std::streamsize(buffer.size())); |
| 6060 | } |
| 6061 | #endif //LODEPNG_COMPILE_DISK |
| 6062 | |
| 6063 | #ifdef LODEPNG_COMPILE_ZLIB |