I have a function that accepts File as an argument. I don\'t want to create/write a new File (I don\'t have write access to filesystem) in order to pass my string data to th
The File class represents the "idea" of a file, not an actual handle to use for I/O. This is why the File class has a .exists() method, to tell you if the file exists or not. (How can you have a File object that doesn't exist?)
By contrast, constructing a new FileInputStream(new File("/my/file")) gives you an actual stream to read bytes from.