Thread: Stream

  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Rep Power


    Can anyone shed some light on what a stream is as it applies to i/o in C? I am having trouble getting my arms around this construct.
  2. #2
  3. Contributing User
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2003
    Rep Power

    Basically, a stream would be a source of data that has no definite size and the elements of which could arrive at any time. Stream I/O would process such a data source.

    In contrast. block I/O would read data in fixed-sized groupings called a "block"; blocks typically range from 128 bytes to 16 KB or more. All the data is present when you read it in or write it out. A typical example would be a disk file, which in the perspective of the disk involves the reading and writing of entire sectors at a time -- your program might only read one byte from a disk file, but that requires the reading in of the entire disk sector that that one byte is contained in.

    After you have read that Wikipedia article and followed some of the links it provides (including some of the "See also" links), if you still have questions or difficulties, then come back with those specific questions. That'll garner you better answers than broad general questions.

IMN logo majestic logo threadwatch logo seochat tools logo