Thread: what different between stream and buffer

  1. #1
    Registered User
    Join Date
    Nov 2010
    Posts
    42

    what different between stream and buffer

    till now i still don understand the different between stream and buffer. can anyone help to put light on that for me? thanks in advanced.

  2. #2
    Registered User
    Join Date
    Dec 2010
    Posts
    25
    A stream is a flow of continuous data. A buffer is a pool of data waiting to be read/wrote.

    For example you stream video or audio over the internet. You can also buffer the stream by allowing a pool of the data to build up before "playing" it.

    This is the same in programming. You can set up a buffer called "words." You can have two processes, one called reader and one called writer. You can write up to N number of characters to the buffer, and then reader can read up to how many characters were wrote by writer.

    It's good to use a buffer because you can transfer blocks of data instead of transferring byte by byte or word by word.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. zlib stream buffer problem
    By Scramble in forum C Programming
    Replies: 1
    Last Post: 07-01-2010, 08:53 PM
  2. flushall()
    By salvadoravi in forum C Programming
    Replies: 21
    Last Post: 12-24-2007, 12:39 PM
  3. Problem with empty stream
    By sshahar1 in forum C Programming
    Replies: 8
    Last Post: 09-03-2007, 05:00 PM
  4. Buffer Overrun Project, Problem Entering NULL in to stream
    By Peter5897 in forum C++ Programming
    Replies: 2
    Last Post: 07-10-2006, 05:12 PM
  5. Does anyone Know How to..?
    By kwigibo in forum C Programming
    Replies: 12
    Last Post: 09-20-2001, 08:16 AM