<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>I/O on Nalar</title>
    <link>https://nalar.dev/tags/i/o/</link>
    <description>Recent content in I/O on Nalar</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Wed, 02 Sep 2026 00:00:00 +0700</lastBuildDate>
    <atom:link href="https://nalar.dev/tags/i/o/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Short Reads and Exact-Length I/O in Go</title>
      <link>https://nalar.dev/short-reads-and-exact-length-io-in-go/</link>
      <pubDate>Wed, 02 Sep 2026 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/short-reads-and-exact-length-io-in-go/</guid>
      <description>&lt;p&gt;Reading bytes in Go looks simple: allocate a buffer, call &lt;code&gt;Read&lt;/code&gt;, and inspect the error. The subtlety is that &lt;code&gt;io.Reader&lt;/code&gt; does not promise to fill the buffer in one call. A valid reader may return fewer bytes than requested even when more data will arrive later.&lt;/p&gt;&#xA;&lt;p&gt;That behavior matters for network protocols, binary file formats, framed messages, and any code that expects an exact number of bytes. Correct stream handling starts by matching the API to the requirement: use ordinary &lt;code&gt;Read&lt;/code&gt; when partial progress is acceptable, and use helpers such as &lt;code&gt;io.ReadFull&lt;/code&gt; when a fixed-size field must be complete.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
