

The first order figure (below) illustrates how the streams that make up a small watershed would be categorized by stream order. When two "first order streams" intersect, they form a "second order" stream when two "second order" streams intersect, they form a third order stream and so on. "First order" streams are the uppermost perennial tributaries in the watershed and have not yet intersected another perennial stream. One way of categorizing stream size is by "stream order". The "geomorphology" (or size and shape) of the channel reflects all of these factors. Other factors which affect channel size and stream flow are land use, soil types, topography, and climate. The size and flow of a stream are directly related to its watershed area and geology. Further downstream where baseflow is large enough to sustain stream flow throughout the year, "perennial" streams are formed. Intermittent streams dry up periodically as ground water levels decline in drier seasons. These streams are partially supplied by ground water rising to the surface as stream baseflow. Downstream from ephemeral channels are "intermittent" streams, which carry water during wet periods of the year.

These are referred to as "ephemeral" channels that only carry water during rainfall runoff. As surface runoff moves downslope, it concentrates in low areas and forms small stream channels. When rain falls in a watershed, it either runs off the land surface into streams or lakes, infiltrates into the soil or evaporates. Thus, it is important to understand how streams work so that watershed management and land use decisions can support the natural characteristics of the receiving streams and maintain their "dynamic equilibrium". Instead they experience extensive - and undesirable - erosion and sedimentation that sets off a sequence of undesired consequences. When that "dynamic equilibrium" is upset, such as by rapid changes in development patterns, streams cannot respond quickly enough to adjust the other physical processes to accommodate increased runoff or sediment loads. Healthy streams migrate laterally over time and maintain a "dynamic equilibrium" with their contributing watershed. It has no meaning to seek some streams, or get the length of an open socket.Streams and rivers are integral parts of the landscape that carry water and sediment from high elevations to downstream lakes, estuaries, and oceans. Of course, most file systems also provide random access, so streams do offer things like Seek, Position, Length etc - but not all implementations support such. A file is also generally accessed (at some level) as a stream you can access blocks of sequential data. But again - the underlying metaphor here is a hose of data. Streams can also manipulate data passing through them compression streams, encryption streams, etc. For example, TCP data over a network is a stream you can send (or receive) chunks of data, but only in connection with the other computer, and usually only once - you can't rewind the Internet. You can pull data from a stream, or push data into a stream - but normally only once and only in one direction (there are exceptions of course).

But not a stream if a list is a bucket, then a stream is a hose. Many data-structures (lists, collections, etc) act as containers - they hold a set of objects. There are more thorough ones out there, For example, as Marc Gravell puts it: This is just a barebones explanation, though. Depending on the size of the source and the amount of available memory, though, a buffer containing the entire file might not be an option.
UNDISTURBED STREAM BUFFER FREE
This is handy for when you need to manipulate the entire file at once, or keep a "local copy" for your program to hold onto so the file can be free for other uses. Reads all the bytes of a file into memory. Streams also benefit from being a connection rather than a discrete set of data, so you don't need to know the size of the data beforehand.Ĭonversely: byte fileContents = File.ReadAllBytes("filepath.txt") As it doesn't require any additional memory, it's lightweight and fast, but arbitrarily referencing a particular set of data in the source can be cumbersome. That stream can be read from, written to, or both. For example: FileStream stream = new FileStream("filepath.txt", FileMode.OpenOrCreate) As I said in my comment, the nutshell difference between a buffer and a stream is that a stream is a sequence that transfers information from or to a specified source, whereas a buffer is a sequence of bytes that is stored in memory.
