-
Notifications
You must be signed in to change notification settings - Fork 57
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
Easy way to implement limit? #37
Comments
I found that I need this feature as well in io-2. Current design gives fairly good idea how to use copy part of |
In new IO it's relatively easy to implement |
It is quite easy to do with copy. I have a working example with input to output copy. But the idea is that you seldom need to limit how many bytes could be read and report preliminary EOF, and making complete input copy for that is an overkill. It is not hard to add manual limitation to the Input class, but I am not sure it is strictly necessary. For now workarounds seems rather elegant. I will write again if I hit real problem with this. |
We're rebooting the kotlinx-io development (see #131), all issues related to the previous versions will be closed. Consider reopening it if the issue remains (or the feature is still missing) in a new version. |
I want to be able to
limit
anInput
, but it doesn't seem like the functionality exists. I attempted to implement it with a newAbstractInput
subclass, but I couldn't understand howhead
andremaining
are supposed to function. I want to know if it would be possible to add this functionality toInput
as an extension function, or -- if this is actual trivial to implement on my end -- some direction on howAbstractInput
functions.The text was updated successfully, but these errors were encountered: