-
Notifications
You must be signed in to change notification settings - Fork 169
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
Some classes that perform Input/Output (LengthOf, BytesOf, ...) close the stream #1449
Comments
@fabriciofx
edit: see #1449 (comment) |
@victornoel I think not close after the manipulation better. As say the golden rule: *"Who allocated the resource is the responsible to deallocated it". A try-with-resourced kind of class is a good idea too. :) |
@fabriciofx actually, after some thought, I'm not sure, because when you call Then, it means your first proposal was actually best indeed: i.e., it is the |
@0crat in |
@fabriciofx some extra requirements for this job for the DEV that will take it: we must find all the classes that closes the stream like this, document them about this behaviour and refer to the existence of the new classes we should introduce that prevent stream closing |
@victornoel Let's me find first all the classes that close the stream like mentioned by @fabriciofx, document them properly and add a todo. Isn't it ? |
@baudoliver7 you can do it either order you want yes: first document then todo for implementing the new decorators, or first implement the new decorators and then todo to document the classes. |
@victornoel Ok. Let's us implement the new decorators :) |
@victornoel What names could you suggest me ? |
@baudoliver7 hehe, no idea actually, @fabriciofx would you have an idea? Could you propose a name and we discuss it in the PR maybe? |
@victornoel Yes, I will do it. |
@fabriciofx First invocation of Also |
@andreoss |
@andreoss Also, if someone want |
@andreoss @baudoliver7 it is normal that using This also applies to ouput: when I am producing a Zip with ZipOutputStream, I dont want to close the stream inbetween writing each file for example. The whole point is to give more power to the code that composes the various objects together, because that code may know better than the code consuming the stream. |
@fabriciofx the puzzle #1577 is still not solved. |
@fabriciofx sorry, this was automatically closed because the "closed" keyword was in the commit message ^^ I hope the solution is good for you, if not please reopen a ticket :) |
@rultor/z the issue is closed not by @fabriciofx/z (its creator); I won't close the order; please, re-open it and ask @fabriciofx/z to close it |
@0crat out |
@sereshqua/z please review this job completed by @baudoliver7/z, as in §30; the job will be fully closed and all payments will be made when the quality review is completed |
@victornoel Job |
@0crat quality good |
@0crat status |
@fabriciofx the puzzle #unknown is still not solved. |
Some classes as
LengthOf
closes theInput
after performed the operation. But often we need keep theInput
stream opened even after it. So, let's create a decorator toInput
andOutput
that allows keep these streams opened.The text was updated successfully, but these errors were encountered: