Closed Zeugma440 closed 1 year ago
In case you missed it - someone had done it in the thread you referenced, although I don't know if it will work and has what you'll need. https://github.com/ronnieoverby/AsyncBinaryReaderWriter
Yup, I've seen it (5 years old, unanswered issues, no release...)
I got more than enough in StreamUtils
to make my own, tbh. If I do go that way, I'll have to benchmark a couple variants to see which one performs better.
Right now I'm reducing the library's dependency to BinaryWriter
by replacing it with Stream
when possible. Results are very encouraging.
After refactoring, Stream
is available where we need it most, i.e. where the file is being resized.
BinaryWriter
is only used locally when needed to write bytes where they belong, which is much less I/O-hungry.
=> Writing a custom, async
-compatible BinaryWriter
is no longer required to implement async
support.
Try writing a custom, async-compatible BinaryWriter with the same API as the standard one