PHPackages                             componenta/stream-iterator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. componenta/stream-iterator

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

componenta/stream-iterator
==========================

Stream iterator for line-based resource traversal

v1.0.0(1mo ago)00MITPHPPHP ^8.4

Since Jun 16Pushed 1mo agoCompare

[ Source](https://github.com/componenta/stream-iterator)[ Packagist](https://packagist.org/packages/componenta/stream-iterator)[ RSS](/packages/componenta-stream-iterator/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

Componenta Stream Iterator
==========================

[](#componenta-stream-iterator)

Iterator for reading PSR-7 streams in fixed-size chunks.

Use it for uploads, downloads, hashing, conversion, and other streaming workflows where loading the full body into memory is unnecessary.

Installation
------------

[](#installation)

```
composer require componenta/stream-iterator
```

Requires `psr/http-message`.

Related Packages
----------------

[](#related-packages)

PackageWhy it matters here`psr/http-message``StreamIterator` reads PSR-7 `StreamInterface`.`psr/http-message`Uploads, downloads, and request bodies can expose PSR-7 streams.`componenta/iterator`Use it when replayable iteration is needed; stream iteration keeps only the current chunk.`componenta/image-converter`Upload streams can be read before media processing.Usage
-----

[](#usage)

```
use Componenta\Stdlib\StreamIterator;

$iterator = new StreamIterator($stream, bytesPerIteration: 1024);

foreach ($iterator as $offset => $chunk) {
    // $offset is the stream position where the chunk started.
}
```

Contract
--------

[](#contract)

`StreamIterator` implements `Iterator` and `Stringable`.

Important behavior:

- `current()` is idempotent
- reading happens during `rewind()` and `next()`
- repeated calls to `current()` do not consume more bytes
- `key()` returns the chunk start offset
- `withStream()` and `withBytes()` return cloned iterators
- `setBytes()` mutates bytes-per-iteration on the current instance

Memory Model
------------

[](#memory-model)

The iterator keeps only the current chunk. It does not cache previous chunks and does not make a one-shot stream replayable. Use `componenta/iterator` if you need replayable iteration.

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance91

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

43d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/20490712?v=4)[Andrey Shelamkoff](/maintainers/Shelamkoff)[@Shelamkoff](https://github.com/Shelamkoff)

---

Top Contributors

[![Shelamkoff](https://avatars.githubusercontent.com/u/20490712?v=4)](https://github.com/Shelamkoff "Shelamkoff (1 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/componenta-stream-iterator/health.svg)

```
[![Health](https://phpackages.com/badges/componenta-stream-iterator/health.svg)](https://phpackages.com/packages/componenta-stream-iterator)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.2k543.5M2.7k](/packages/aws-aws-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k48](/packages/neuron-core-neuron-ai)[google/cloud-core

Google Cloud PHP shared dependency, providing functionality useful to all components.

345132.9M113](/packages/google-cloud-core)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[anthropic-ai/sdk

Anthropic PHP SDK

163583.3k20](/packages/anthropic-ai-sdk)[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

36789.4k2](/packages/telnyx-telnyx-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
