I am trying to read in data from files created using the blitzbasic language on PC. Blitz is meant to write 2 bytes at a time for int values, which is all the file contains, however when I try to read these values using the randomaccessfile library in B4A I get garbage coming out.
The first integer value in the file is the number of trees on a level, blitzbasic says it uses 2 bytes amounts for int values, which is great, as the randomaccessfile library does too, except this doesn't seem to be working. The number of trees b4a is reporting that it's finding is 1073741824, which is slightly higher than the 50 or 60 I was expecting. So then the next stage of level loading is to carry on and load the position of these trees, each one stores the x value then the y value of the coordinate in the file, these values are also all read in as garbage until the file runs out and I get a bufferunderrun exception.
Any ideas?
I've attached the file.
The first integer value in the file is the number of trees on a level, blitzbasic says it uses 2 bytes amounts for int values, which is great, as the randomaccessfile library does too, except this doesn't seem to be working. The number of trees b4a is reporting that it's finding is 1073741824, which is slightly higher than the 50 or 60 I was expecting. So then the next stage of level loading is to carry on and load the position of these trees, each one stores the x value then the y value of the coordinate in the file, these values are also all read in as garbage until the file runs out and I get a bufferunderrun exception.
Any ideas?
I've attached the file.