# Stream

*noun*

say it: **“STREEM”** **/striːm/**

A connection to a source of data, such as a file, that hands over its data a piece at a time.

## What is **Stream** in C#?

**Stream** — A connection to a source of data, such as a file or a network, that hands it over a piece at a time instead of all at once. A huge file can be read line by line without loading the whole thing into memory.

```csharp
using StreamReader reader = new("books.csv");
string? line;
while ((line = reader.ReadLine()) != null)
{
    Console.WriteLine(line);
}
```

## In a sentence

- “Reading the 2 GB log as a **stream** used almost no memory.”

Level: Journeyman · [More C# terms at this level](https://www.ask-codey.com/glossary?category=c-sharp&level=3)

Updated: October 28, 2026

## In other subjects

- [Stream in Java](https://www.ask-codey.com/glossary/stream)

Source: https://www.ask-codey.com/glossary/stream-c-sharp
