Is there a way to get the file name from a FileOutputStream or from FileInputStream?
This feature is not provided by the out-of-the-box File-Input/Output-Stream, but nothing stops you from writing your own subclass that stores the File (or fileName) and provides a getter for it.
I would suggest implementing some FileNameAware interface for this), as I/O Streams are usually referenced with the InputStream / OutputStream abstract classes to avoid coupling your application with specific implementations.