- if( $STREAM ) {
- my $bro = IO::Uncompress::Brotli->create();
- while( read $ifh, (my $buf), $STREAM ) {
- $decoded = $bro->decompress($buf);
- $total_size += bytes::length( $decoded );
- print $ofh $decoded;
- }
- }
- else {
- $encoded = read_file( $ifh );
- $decoded = unbro( $encoded );
+ $STREAM //= 4 * 1024 * 1024;
+ my $bro = IO::Uncompress::Brotli->create();
+ while( read $ifh, (my $buf), $STREAM ) {
+ $decoded = $bro->decompress($buf);