954,518 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Write File in J2ME

Hai Friends,

Iam using J2ME , i can read a text file from jar (in res folder) by using

InputStream is = getClass().getResourceAsStream("help.txt");
StringBuffer sb = new StringBuffer();
try{
int chars, i = 0;
while ((chars = is.read()) != -1){
sb.append((char) chars);
}
return sb.toString();
}catch (Exception e){}

but i want write a data to the text file, i doknow how to write please any one help me for this problem.

gitech
Newbie Poster
22 posts since Feb 2007
Reputation Points: 10
Solved Threads: 0
 

Writing to file in JAR archive is not possible, only reading is allowed. I'm not sure what you are doing, as what you trying to write/store, but you have generally two optionsRecord Management System - RMS that is essentially mini database
PDA Optional Packages is JSR 75 that late you use FileConnection object, but this is often used for remote access (URL/OBEX/Bluetooth)

peter_budo
Code tags enforcer
Moderator
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
 

Have you found the answer yet??

Thanx

Hai Friends,

Iam using J2ME , i can read a text file from jar (in res folder) by using

InputStream is = getClass().getResourceAsStream("help.txt"); StringBuffer sb = new StringBuffer(); try{ int chars, i = 0; while ((chars = is.read()) != -1){ sb.append((char) chars); } return sb.toString(); }catch (Exception e){}

but i want write a data to the text file, i doknow how to write please any one help me for this problem.

hawknz
Newbie Poster
1 post since Feb 2010
Reputation Points: 10
Solved Threads: 1
 

Have you found the answer yet??

Thanx


It is not possible!

peter_budo
Code tags enforcer
Moderator
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You