J2ME File Write Access in the jar file
Hi,
I'm developing a Java application for S60 5th edition and I need to read and write files. If I access to files in the file system the user is requested to allow / denie the file access. This is not comfortable for the user and I want to discuss another options.
For instance, J2ME offers the the possibilty to read a stream from the jar file in the Java application via getClass().getResourceAsStream( String path). This method works very well. However, I want also to write into this file.
My question is how I can do this? If I use this method, I get an InputStream from which I only can read. Is it possible to convert the Inputstream into an Outputstream?
Many Thanks.
Re: J2ME File Write Access in the jar file
You cannot write to files in the JAR.
There is an article in the wiki about [url=http://wiki.forum.nokia.com/index.php/Persistent_Data_in_Java_ME]persistent data in Java ME[/url].
Graham.
Re: J2ME File Write Access in the jar file
[QUOTE] I need to read and write files. If I access to files in the file system the user is requested to allow / denie the file access.[/QUOTE]
Signing of the Midlet can be a solution for this problem.
OR
Use javax.microedition.rms.RecordStore, to store each line of text as a seperate record in RMS and you can do both read/write to it.
thanks,
~Amitabh