Apply f to the resource and return it after closing the resource If you don't wish to close the resource (e.g.
Apply f to the resource and return it after closing the resource If you don't wish to close the resource (e.g. if you are creating an iterator on file contents), use flatMap instead
This keeps the resource open during the context of this flatMap and closes when done
This will immediately apply f on the resource and close the resource
Dispose this resource and return it Note: If you are using map followed by get, consider using apply instead
This will apply f on the resource while it is open