0

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.

Edited by happygeek: fixed formatting

3
Contributors
3
Replies
5
Views
7 Years
Discussion Span
Last Post by peter_budo
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 options

  1. Record Management System - RMS that is essentially mini database
  2. PDA Optional Packages is JSR 75 that late you use FileConnection object, but this is often used for remote access (URL/OBEX/Bluetooth)
-1

Have you found the answer yet??

Thanx

Edited by Nick Evan: Fixed formatting

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.