Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support System.IO.Stream in Yarhl.IO classes #158

Closed
pleonex opened this issue Dec 23, 2020 · 0 comments · Fixed by #161
Closed

Support System.IO.Stream in Yarhl.IO classes #158

pleonex opened this issue Dec 23, 2020 · 0 comments · Fixed by #161
Assignees
Milestone

Comments

@pleonex
Copy link
Member

pleonex commented Dec 23, 2020

Is your feature request related to a problem? Please describe.

In order to improve the compatibility of Yarhl with other frameworks, we should make easier to work with Stream and DataStream. Right now, if you start using DataStream, it's hard to use any framework that requires a Stream (including BCL). This will help users to start using Yarhl in their projects.

Describe the solution you'd like
We should make DataStream inherit Stream. It makes sense as it behaves like a Stream and implements already almost all its methods. At the end, a DataStream is just a virtual Stream that allows to read and write only segments of them and abstract for more generic types like MemoryMappedStream and LazyFileStream.

Also, other classes like DataReader, DataWriter, TextWriter and TextReader should work with the generic Stream. This way they will work with DataStream or any existing Stream.

Describe alternatives you've considered
None.

Additional context
This was needed to interact with some external compression libraries as well as xdelta-sharp. Requested also by @Kaplas80.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant