-
Notifications
You must be signed in to change notification settings - Fork 2
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
Pondering implementing InputStream
and OutputStream
#5
Comments
All the stuff I am writing right now has I could see enough reasons to add support for stream classes:
Off the top of my head all the |
I guess the implementation could simply reify reading and writing, not needing all that positioning stuff since those are unreliable on streams (most don't have that, some only provide an estimation for some features such as the number of available bytes, etc) However, remains the problem of which class/interface to implement. Something like |
Just to note I have another branch that reads and writes clojure data structures to/from a stream based on some layout generated by stuff in the cabi namespace. A pr should be imminent. I was already doing something very similar to whats going on in the cabi namespace so I figured I may as well port it over and see how it feels there. I would think that it would be best to just implement |
See #6. |
@sh54 Following your comment in #2.
I did consider adding support for
InputStream
andOutputStream
some time ago. The protocols are split in different categories so that in theory it is expected that a type might not implement everything (eg. a stream which does not have absolute positioning). However in the end I've decided not to do it since those interfaces are indeed limited. It is not the same thing but for some IO problems you can used memory-mapping. And with NIOByteBuffer
is first-class so I didn't feel it was urgent to implement streams.However I keep an open mind. Do you envision a useful case for those interfaces? Given that they could implement only a small portions of the protocols.
The text was updated successfully, but these errors were encountered: