Integrate stream filters into io.streams#359
Conversation
|
Would |
What about InputConversion or InputTransformation? Those are interesting but I'd lean against both, for a couple of reasons: They don't read as streams. The rest of your API uses the InputStream/OutputStream suffix consistently, and these names break that pattern. Someone browsing the codebase would have a harder time recognising them as streams at a glance — InputConversion sounds more like a utility class or a value object describing a conversion operation. They're nominalisations of the action, not descriptions of the thing. Conversion and Transformation describe what happens to the data, but the class is a stream — that's its primary identity. The name should reflect what it is first, and what it does second. https://claude.ai/share/7ae14c8e-4766-4e68-b977-98d3ded47708 |
This pull request integrates with PHP's stream filters.
Example
Decode base64 from an input stream:
Performance
For smaller input, memory usage and time taken will be roughly the same:
For larger files, significant performance improvements can be seen with this approach:
See also