Buffer
noun
say it: “BUF-er” /ˈbʌfər/
A bit of memory where data is collected before being sent on in bigger pieces.
What is Buffer in C#?
Buffer — A bit of memory where a writer collects what you write and sends it to the file in bigger pieces, which is much faster. Until the writer is flushed or closed, the last lines may not be in the file yet, which is one reason to create writers with using.
using StreamWriter writer = new("orders.log");
writer.WriteLine("Order 42 shipped"); // in the buffer
writer.Flush(); // now in the file
In a sentence
- “The last line was missing because it was still in the buffer when the program stopped.”
Level: Journeyman · More C# terms at this level
Updated