1

I want to get a FileChannel from the AssetManager in Android, is there any way to do this? I want to map some raw custom binary files to some buffers. (If you have a better solution than using the AssetManager, please feel free to mention.

Rolf ツ
  • 8,611
  • 6
  • 47
  • 72
Ryan
  • 2,755
  • 16
  • 30

1 Answers1

2

Figured it out:

FileChannel fc = manager.openFd(file).createInputStream().getChannel();

not sure if it works yet. I will confirm if it does.

Edit:

This only works if the files are uncompressed. You have to use the right file extension or add the -0 flag on aapt. Looking for how to do this on eclipse...

Ryan
  • 2,755
  • 16
  • 30