0

I'm reading a big raw file into a bytes array and converting it into a string and then split them using a delimiter.

is = ctx.getResources().openRawResource(fileid);
bytes[] b = new byte[is.available()];
is.read(b);
str = new String(b);

Android documentation says is.available() method returns only an approximate value. Also my file is too big. Is this a good way to read this file and convert it into string? Or is there any other good method to accomplish this? It will be helpful if you can provide an example.

thavan
  • 2,409
  • 24
  • 32
  • http://stackoverflow.com/questions/4369218/android-reading-a-large-file – silly Feb 27 '12 at 15:34
  • @silly I can use readline. but I want to store the start position of a byte of particular line in sqlite, so that I can seek to that position instantly. otherwise I need to go to that line by reading line by line and it will take time. – thavan Feb 27 '12 at 15:40

0 Answers0