Create a File object in memory from a string in Java

后端 未结 5 1246
独厮守ぢ
独厮守ぢ 2020-12-08 12:59

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

5条回答
  •  心在旅途
    2020-12-08 13:41

    No; instances of class File represent a path in a filesystem. Therefore, you can use that function only with a file. But perhaps there is an overload that takes an InputStream instead?

提交回复
热议问题