<?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: Zach Maddox</title>
    <description>The latest articles on DEV Community by Zach Maddox (@zmad5306).</description>
    <link>https://dev.to/zmad5306</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%2F3657704%2Fed95fd3a-0b08-4588-8ed2-5504173e41bb.jpg</url>
      <title>DEV Community: Zach Maddox</title>
      <link>https://dev.to/zmad5306</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/zmad5306"/>
    <language>en</language>
    <item>
      <title>Chunking Java Streams the Right Way — A Collector That Feels Like It Should Be in the JDK</title>
      <dc:creator>Zach Maddox</dc:creator>
      <pubDate>Thu, 11 Dec 2025 15:46:06 +0000</pubDate>
      <link>https://dev.to/zmad5306/chunking-java-streams-the-right-way-a-collector-that-feels-like-it-should-be-in-the-jdk-4e53</link>
      <guid>https://dev.to/zmad5306/chunking-java-streams-the-right-way-a-collector-that-feels-like-it-should-be-in-the-jdk-4e53</guid>
      <description>&lt;h1&gt;
  
  
  &lt;strong&gt;Chunking Java Streams the Right Way — Finally, a Collector That Feels Like It Should Be in the JDK&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;If you've ever needed to split a large list or stream into evenly sized chunks, you already know the pain:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You write a loop.&lt;/li&gt;
&lt;li&gt;Or worse, nested loops.&lt;/li&gt;
&lt;li&gt;Maybe a counter.&lt;/li&gt;
&lt;li&gt;Maybe a temporary list.&lt;/li&gt;
&lt;li&gt;Maybe something that &lt;em&gt;almost&lt;/em&gt; works until one edge case blows it up.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Chunking elements is one of those &lt;strong&gt;everyday operations&lt;/strong&gt; that &lt;em&gt;somehow never made it into the JDK&lt;/em&gt;. So developers keep rewriting the same utility method in every project… slightly different each time.&lt;/p&gt;

&lt;p&gt;After doing this one too many times—and hitting a PostgreSQL driver limitation that forced me to batch thousands of &lt;code&gt;UUID&lt;/code&gt;s into smaller chunks—I finally decided:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;This should be a Collector.&lt;/strong&gt;&lt;br&gt;
Clean. Composable. Built for Streams.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So I built one.&lt;/p&gt;

&lt;p&gt;This is &lt;strong&gt;Chunking Collector&lt;/strong&gt; — a lightweight Java 8+ library that lets you express chunking in a way that &lt;em&gt;reads like it belongs in the standard library&lt;/em&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔥 The Old Way: Manual Chunking (A Bit of a Mess)
&lt;/h2&gt;

&lt;p&gt;Here’s what most of us end up writing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="no"&gt;T&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;chunks&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ArrayList&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&amp;gt;();&lt;/span&gt;
&lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="no"&gt;T&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;current&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ArrayList&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&amp;gt;();&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="no"&gt;T&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;current&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;add&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;current&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;size&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;chunkSize&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;chunks&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;add&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;current&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;current&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ArrayList&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&amp;gt;();&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(!&lt;/span&gt;&lt;span class="n"&gt;current&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;isEmpty&lt;/span&gt;&lt;span class="o"&gt;())&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;chunks&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;add&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;current&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It works… until it doesn’t:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Harder to read&lt;/li&gt;
&lt;li&gt;Easy to get wrong&lt;/li&gt;
&lt;li&gt;Not reusable&lt;/li&gt;
&lt;li&gt;Not parallel-friendly&lt;/li&gt;
&lt;li&gt;Not stream-friendly&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It also &lt;strong&gt;breaks the flow&lt;/strong&gt; of code that naturally wants to be expressed as a Stream pipeline.&lt;/p&gt;




&lt;h2&gt;
  
  
  ✨ The New Way: A Collector That Just Works
&lt;/h2&gt;

&lt;p&gt;With &lt;strong&gt;Chunking Collector&lt;/strong&gt;, you simply write:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Integer&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;chunks&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;stream&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;
    &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;collect&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Chunking&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;toChunks&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[[1, 2, 3], [4, 5, 6], [7, 8, 9], [10]]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That’s it.&lt;br&gt;
Readable. Safe. Predictable.&lt;/p&gt;

&lt;p&gt;This is how chunking &lt;em&gt;should&lt;/em&gt; feel.&lt;/p&gt;


&lt;h2&gt;
  
  
  🧩 Why a Collector?
&lt;/h2&gt;

&lt;p&gt;Because chunking is fundamentally a &lt;strong&gt;reduction operation&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A Stream goes in&lt;/li&gt;
&lt;li&gt;A List of Lists comes out&lt;/li&gt;
&lt;li&gt;No side effects&lt;/li&gt;
&lt;li&gt;No mutation leaking out&lt;/li&gt;
&lt;li&gt;Works naturally with &lt;strong&gt;ordered&lt;/strong&gt;, &lt;strong&gt;parallel&lt;/strong&gt;, or &lt;strong&gt;sequential&lt;/strong&gt; streams&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And importantly, this fits the Stream philosophy perfectly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="n"&gt;stream&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;collect&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Chunking&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;toChunks&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You immediately know what it does.&lt;/p&gt;




&lt;h2&gt;
  
  
  📦 Installation
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;dependency&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;groupId&amp;gt;&lt;/span&gt;dev.zachmaddox&lt;span class="nt"&gt;&amp;lt;/groupId&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;artifactId&amp;gt;&lt;/span&gt;chunking-collector&lt;span class="nt"&gt;&amp;lt;/artifactId&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;version&amp;gt;&lt;/span&gt;1.2.0&lt;span class="nt"&gt;&amp;lt;/version&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/dependency&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight groovy"&gt;&lt;code&gt;&lt;span class="n"&gt;implementation&lt;/span&gt; &lt;span class="s1"&gt;'dev.zachmaddox:chunking-collector:1.2.0'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🧠 Practical Examples That Come Up All the Time
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;1. Batch Processing&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;Chunking&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;chunk&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;records&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;forEach&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;batch&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;processBatch&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;batch&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;2. Database Paging&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;pages&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;results&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;stream&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;
    &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;collect&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Chunking&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;toChunks&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;3. Parallel Workloads&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;Chunking&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;chunk&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;parallelStream&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;
    &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;forEach&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;processChunk&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🔥 The Real Origin: Working Around PostgreSQL IN-Clause Limits
&lt;/h2&gt;

&lt;p&gt;PostgreSQL (and many JDBC drivers) limit how large an argument list can be in a single SQL statement.&lt;/p&gt;

&lt;p&gt;Chunking solves this cleanly and safely using parameterized SQL:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;NamedParameterJdbcTemplate&lt;/span&gt; &lt;span class="n"&gt;named&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;NamedParameterJdbcTemplate&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;jdbcTemplate&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

&lt;span class="nc"&gt;Chunking&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;chunk&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ids&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;parallelStream&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;
    &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;map&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;chunk&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;named&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;query&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;
        &lt;span class="s"&gt;"SELECT * FROM users WHERE id IN (:ids)"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
        &lt;span class="nc"&gt;Map&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;of&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"ids"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;chunk&lt;/span&gt;&lt;span class="o"&gt;),&lt;/span&gt;
        &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rs&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;mapRow&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rs&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="o"&gt;))&lt;/span&gt;
    &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;flatMap&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nl"&gt;List:&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="n"&gt;stream&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;toList&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No driver errors&lt;/li&gt;
&lt;li&gt;Smaller, faster queries&lt;/li&gt;
&lt;li&gt;Clear, maintainable code&lt;/li&gt;
&lt;li&gt;Parallelizable workloads&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This alone justified building the library.&lt;/p&gt;




&lt;h2&gt;
  
  
  ⚡ Advanced Capabilities (When You Need Them)
&lt;/h2&gt;

&lt;p&gt;Chunking Collector has grown into a flexible toolkit:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Remainder policies&lt;/strong&gt; (&lt;code&gt;INCLUDE_PARTIAL&lt;/code&gt;, &lt;code&gt;DROP_PARTIAL&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Custom list factories&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Lazy chunk streaming&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Sliding windows&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Boundary-based chunking&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Weighted chunking&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Primitive stream helpers&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But the core API remains dead simple.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧩 Design Philosophy
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;“If this API ever became part of the JDK, nobody should be surprised.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No dependencies&lt;/li&gt;
&lt;li&gt;No reflection&lt;/li&gt;
&lt;li&gt;No magic&lt;/li&gt;
&lt;li&gt;Just clean Java&lt;/li&gt;
&lt;li&gt;Very small surface area&lt;/li&gt;
&lt;li&gt;Behaves exactly how experienced Java devs expect&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  📚 Full Documentation
&lt;/h2&gt;

&lt;p&gt;JavaDoc: &lt;a href="https://zachmaddox.dev/ChunkingCollector/latest/" rel="noopener noreferrer"&gt;https://zachmaddox.dev/ChunkingCollector/latest/&lt;/a&gt;&lt;br&gt;
GitHub: &lt;a href="https://github.com/zmad5306/ChunkingCollector" rel="noopener noreferrer"&gt;https://github.com/zmad5306/ChunkingCollector&lt;/a&gt;&lt;br&gt;
Maven Central: &lt;a href="https://central.sonatype.com/artifact/dev.zachmaddox/chunking-collector" rel="noopener noreferrer"&gt;https://central.sonatype.com/artifact/dev.zachmaddox/chunking-collector&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🎉 Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Chunking is a &lt;strong&gt;universal problem&lt;/strong&gt;, and now there's finally a clean, reusable, stream-friendly solution for it.&lt;/p&gt;

&lt;p&gt;If you’ve ever thought:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Why isn’t there just a built-in way to do this?”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Well… now there is.&lt;/p&gt;

&lt;p&gt;Give it a try, star the repo, and drop feedback — I’d love to hear how you’re using it.&lt;/p&gt;

</description>
      <category>java</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
