Android RandomAccessFile usage from resource

Posted by lacas on Stack Overflow See other posts from Stack Overflow or by lacas
Published on 2011-11-26T14:10:13Z Indexed on 2011/11/26 17:52 UTC
Read the original article Hit count: 346

Filed under:

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)

© Stack Overflow or respective owner

Related posts about android