| 66 | } |
| 67 | |
| 68 | bool MemoryWriteStream::SaveToFile(const StringView& path) const |
| 69 | { |
| 70 | // Open file for writing |
| 71 | auto file = File::Open(path, FileMode::CreateAlways, FileAccess::Write, FileShare::Read); |
| 72 | if (file == nullptr) |
| 73 | { |
| 74 | return true; |
| 75 | } |
| 76 | |
| 77 | // Write data |
| 78 | uint32 bytesWritten; |
| 79 | file->Write(GetHandle(), GetPosition(), &bytesWritten); |
| 80 | |
| 81 | Delete(file); |
| 82 | return false; |
| 83 | } |
| 84 | |
| 85 | void MemoryWriteStream::Flush() |
| 86 | { |