You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to be able to limit an Input, but it doesn't seem like the functionality exists. I attempted to implement it with a new AbstractInput subclass, but I couldn't understand how head and remaining are supposed to function. I want to know if it would be possible to add this functionality to Input as an extension function, or -- if this is actual trivial to implement on my end -- some direction on how AbstractInput functions.
The text was updated successfully, but these errors were encountered:
I found that I need this feature as well in io-2. Current design gives fairly good idea how to use copy part of Input into new Input, but it seems not possible to make a zero-copy view of Input.
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: