Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/treetrek.git

Uses stream reader interface

AuthorDave Jarvis <email>
Date2026-02-21 17:23:04 GMT-0800
Commitc3d1db9c191793f03c0f554eaf290a8ed7ed6e77
Parent1074112
git/CompressionStream.php
<?php
require_once __DIR__ . '/StreamReader.php';
+
class CompressionStream {
private Closure $pumper;
}
- public function stream( StreamReader $handle, int $chunkSize = 8192 ): Generator {
+ public function stream(
+ StreamReader $stream,
+ int $chunkSize = 8192
+ ): Generator {
$done = false;
- while( !$done && !$handle->eof() ) {
- $chunk = $handle->read( $chunkSize );
+ while( !$done && !$stream->eof() ) {
+ $chunk = $stream->read( $chunkSize );
$done = $chunk === '';
Delta7 lines added, 3 lines removed, 4-line increase