Android RandomAccessFile usage from resource
- by lacas
my code is
String fileIn = resources.getResourceName(resourceID);
Log.e("fileIn", fileIn);
//BufferedReader buffer = new BufferedReader(new InputStreamReader(fileIn));
RandomAccessFile buffer = null;
try {
buffer = new RandomAccessFile(fileIn, "r");
} catch (FileNotFoundException e) {
Log.e("err", ""+e);
}
/fileIn(6062): ls3d.gold.paper:raw/wwe_obj
i get
11-26 15:06:35.027: ERROR/err(6062): java.io.FileNotFoundException: /ls3d.gold.paper:raw/wwe_obj (No such file or directory)
How can I access a file using randomaccessfile in java? How can I load from a resource?
(R.raw.wwe_obj)