I need to store data into files inside .jar file and read it again.
I know that I can use Class.getResourceAsStream()
method but it returns an Inp
You can manipulate any jar file using the package java.util.jar
(or indeed just java.util.zip
). As files inside a jar will be compressed, this isn't the most time efficient way for you to store data.
You should probably use a directory somewhere else (e.g. System.getProperty("user.home") + "/.myProgram"
) or see java.util.prefs
.