commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Antwort: Re: [IO] encapsulating open/close
Date Fri, 06 Aug 2010 08:54:34 GMT
>Not sure if this is exactly what you're looking for, but have you
>seen the AutoCloseInputStream [1] class?

No, I haven't, because IO does not use this itself.

My suggestion is providing an interface and a convenience method, which an
expression of this interface als argument. In this method opening and
closing will be done. I think, this would be the natural way in java. When
closures came, the client code will look short.

I have explained this here:

Sorry, this is in german, but you could see the code, specially from the
example "praktisches Beispiel". This is just the idea, closing has to be
worked out.

Sebastian Petzelberger

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message