Support for `ReadOnlySequence<byte>` and `IBufferWriter<byte>`
See original GitHub issueI’m happy to see support for ReadOnlySpan<byte> already in the library.
I want to be able to effectively stream compression/decompression, but without using the Stream class. That is, I don’t want to have to allocate contiguous memory for the input and output of the algorithm.
If the algorithm would accept a ReadOnlySequence<byte> as input, and write its output to a given IBufferWriter<byte> instance, then I can for instance process 1GB of data without having to have found 2 blocks of 1GB of contiguous memory to allocate arrays. Instead, these two types allow for breaking up the input/output into much more conveniently sized blocks.
Can such support be added? I can already do this on top of your Stream APIs, but doing it natively would presumably be at least a bit more efficient, and possibly(?) avoid the extra dependency you have on your stream-supporting package.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:31 (9 by maintainers)

Top Related StackOverflow Question
I’m closing this issue at addressed with 1.3.3. This ticket was very valuable, and I guess it can spawn a discussion about rewrite. But for now: it does support
ReadOnlySequence<byte>andIBufferWriter<byte>as source/target on encoding/decoding, so goal has been achieved.Year, exactly. That was my point. @MiloszKrajewski is it ok if I come with a proposal for this that we can use as a basis for a discussion? I think that work from here on is better in a draft pr than a gist.