Get filename from an inputstream (Java)

后端 未结 1 1243
抹茶落季
抹茶落季 2021-01-18 08:52

if I have this code, how could I keep the filename of the original file or reassign it to the new one?:

    InputStream input= assetInfo.openStream();
    Fi         


        
相关标签:
1条回答
  • 2021-01-18 09:36

    An input stream can be created to read from a file or from any other source of data. Therefore it makes no sense to have a filename attached to an input stream. Look in assetInfo to see if that class exposes that data (you can even look inside the class using reflection). Note that the creator or assetInfo made a design mistake not exposing this information, OR you are trying to make one now.

    0 讨论(0)
提交回复
热议问题