I have a code snippet as follows:
Dim fstream = new filestream(some file here)
dim bwriter = new binarywriter(fstream)
while not end of file
read from source file
bwriter.write()
bwriter.flush()
end while
My question is the following. When I call bwriter.flush (), does it also clear the fstream object? Or I need to explicitly call fstream.flush (), as indicated in the following example:
while not end of file
read from source file
bwriter.write()
bwriter.flush()
fstream.flush()
end while
Several people suggested that I explicitly call fstream.flush () to make sure the data was written to disk (or the device). However, my testing shows that the data is written to disk as soon as I call the flush () method of the bwriter object.
Can someone confirm this?
source
share