R
Rafal Suchowirski
hi
i'm writing a program for mobile phone, and i use
getResourceAsStream(String)
when i use:
readFile("/data/file/1");
i can read file, but when i use
readFile("/data/file/"+randomINT);
i get error
java.lang.NullPointerException
but the file exist...
it's my code
public final Enumeration readFile(String s) {
Vector v = new Vector();
try {
InputStream in = this.getClass().getResourceAsStream("/res/"+s);
StringBuffer data = new StringBuffer();
/*.....
.....*/
} catch (Exception _e) { _e.printStackTrace();}
return v.elements();
}
What could be wrong?
i'm writing a program for mobile phone, and i use
getResourceAsStream(String)
when i use:
readFile("/data/file/1");
i can read file, but when i use
readFile("/data/file/"+randomINT);
i get error
java.lang.NullPointerException
but the file exist...
it's my code
public final Enumeration readFile(String s) {
Vector v = new Vector();
try {
InputStream in = this.getClass().getResourceAsStream("/res/"+s);
StringBuffer data = new StringBuffer();
/*.....
.....*/
} catch (Exception _e) { _e.printStackTrace();}
return v.elements();
}
What could be wrong?