I know this might seem silly, but why does the following code only work if I Close() the file? If I don\'t close the file, the entire stream is not written.
Steps:
Because Write() is buffered and the buffer is explicitly flushed by Close().