Is there any possibility to change the location of data?

Disembleergon 48 :

I want to make a Program in java to change the location of data, for example into another file. Is that possible?

Al G Johnston :

Depends on several factors. Is the location of data in a file or your program? I am assuming a file because you say 'another file'

In this case, you need to know the format of the file and parse the data with a 3rd party library or use Java's FileInputStream to parse it yourself.

Then, once you have the data, or if you already did, you can write it to another location with FileoutputStream if it is serializable. Otherwise, you will need to use a third party library to write the data, or to declare the data as transient and override writeObject().

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=344629&siteId=1