[ELI5] What exactly is a buffer in Computer Science?

801 views

I’ve always been confused with buffer for I’ve heard the term in many realms including programming (nodejs) and operating systems; plus, “buffering” in video players.

So, is it the same “buffer” everywhere? I mean is it a standard of some kind because it’s been used in many technologies related to computer science.

In: Technology

6 Answers

Anonymous 0 Comments

A buffer is temporary holding place for data before it is processed. When you type on your keyboard, the keystroke data is put into a buffer. Then depending on what program, text box, etc. you are using, the processor processes the data and makes the appropriate updates to where it is needed (like showing it on screen, applying any commands or special processes to it like copy and paste functions, storing the information in RAM/ROM, etc.) Typically each process has a separate buffer which your CPU can access, handle reading from, writing to, and processing, as well as share information between other buffers. i.e. your keyboard has one buffer, your mouse another, your display another, your web browser another etc. and your processor handles information sharing between all of them.

When a video or music buffers, it is similar. There is data being held for display/playback that then gets processed. However if the buffer empties without having an end-of-file marker (a special flag designed to tell the playback device that no more data is needed), the program won’t know what data to display/playback next. Thus in the context of video/audio, buffering is when the video/audio buffer is filled with data when it has processed all the data in the buffer without receiving an end-of-file marker. Streamed content has special markers to mark the end of a piece of content that act as end-of-file markers.

You are viewing 1 out of 6 answers, click here to view all answers.