<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Hossein Naseri</title>
    <description>The latest articles on DEV Community by Hossein Naseri (@ho3na3).</description>
    <link>https://dev.to/ho3na3</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3947473%2F82c08dd7-c4a7-4c2a-8028-bef2f43e959f.jpg</url>
      <title>DEV Community: Hossein Naseri</title>
      <link>https://dev.to/ho3na3</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ho3na3"/>
    <language>en</language>
    <item>
      <title>What Are Buffers, Really?</title>
      <dc:creator>Hossein Naseri</dc:creator>
      <pubDate>Sat, 23 May 2026 11:47:56 +0000</pubDate>
      <link>https://dev.to/ho3na3/what-are-buffers-290m</link>
      <guid>https://dev.to/ho3na3/what-are-buffers-290m</guid>
      <description>&lt;p&gt;Buffers are &lt;strong&gt;temporary memory spaces&lt;/strong&gt; used to hold data while it is being moved from one place to another.&lt;/p&gt;

&lt;p&gt;Think of it like eating rice.&lt;/p&gt;

&lt;p&gt;You cannot move the entire plate of rice into your stomach at once.&lt;br&gt;
So you use a spoon.&lt;/p&gt;

&lt;p&gt;The spoon temporarily holds a small piece of rice,&lt;br&gt;
moves it,&lt;br&gt;
Then it gets filled again.&lt;/p&gt;

&lt;p&gt;In computers, buffers work similarly.&lt;/p&gt;

&lt;p&gt;Instead of moving huge amounts of data all at once, computers usually &lt;em&gt;move data in smaller chunks&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;A buffer temporarily stores those chunks while data is being:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;copied&lt;/li&gt;
&lt;li&gt;read&lt;/li&gt;
&lt;li&gt;written&lt;/li&gt;
&lt;li&gt;uploaded&lt;/li&gt;
&lt;li&gt;downloaded&lt;/li&gt;
&lt;li&gt;streamed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;while reading a file&lt;/li&gt;
&lt;li&gt;while streaming a video&lt;/li&gt;
&lt;li&gt;while receiving internet packets&lt;/li&gt;
&lt;li&gt;while copying data between memory and disk&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Buffers help data &lt;strong&gt;move smoothly and efficiently&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Is a Buffer Technically?
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;Buffer 4C A1 33 00 00 ...&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A buffer is a block of raw binary data stored in memory.&lt;/p&gt;

&lt;p&gt;You can think of it as a list of very small memory units called bytes.&lt;/p&gt;

&lt;p&gt;Each item inside a buffer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;has exactly &lt;strong&gt;8 bits&lt;/strong&gt; (1 byte)&lt;/li&gt;
&lt;li&gt;stores a small piece of data&lt;/li&gt;
&lt;li&gt;can be read, changed, copied, or written&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;4C A1 33 00&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
Each pair represents &lt;strong&gt;one byte&lt;/strong&gt; of data written in **hexadecimal **format.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why and What Is Hexadecimal?
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;We will learn more about hexadecimal later, but for now, here is the basic idea.&lt;/em&gt;&lt;br&gt;
Computers internally work with binary numbers:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;01001100 01001100 01001100 01001100&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
But binary is difficult for humans to read and understand quickly.&lt;/p&gt;

&lt;p&gt;Imagine looking at thousands of bytes written only with 0s and 1s.&lt;br&gt;
It becomes confusing very fast.&lt;/p&gt;

&lt;p&gt;So programmers use hexadecimal instead.&lt;/p&gt;

&lt;p&gt;Hexadecimal is simply a shorter and cleaner way to represent binary data.&lt;/p&gt;

&lt;p&gt;For example, instead of writing:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;01001100&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
we can write:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;4C&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
Both represent the same data.&lt;/p&gt;

&lt;h2&gt;
  
  
  Simple Mental Model
&lt;/h2&gt;

&lt;p&gt;Think of a buffer like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;[ byte ][ byte ][ byte ][ byte ]&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
Each box:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;contains 8 bits&lt;/li&gt;
&lt;li&gt;stores a tiny piece of data&lt;/li&gt;
&lt;li&gt;together forms larger information&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is the core idea behind buffers.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>codenewbie</category>
      <category>computerscience</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
