UpdateBufferIfNeeded function currently doesn't match its name, because it simply adds free space at the end of file needed for buffering write.
UpdateBufferIfNeeded function currently doesn't match its name, because it simply adds free space at the end of file needed for buffering write.