Hi all,
does J2ME have something similar to RandomAccessFile
class, or is there any way to emulate this particular (random access) functionality?
The problem is this: I have a rather large binary data file (~600 KB) and would like to create a mobile application for using that data. Format of that data is home-made and contains many index blocks and data blocks. Reading the data on other platforms (like PHP or C) usually goes like this:
- Read 2 bytes for index key (
K
), another 2 for index value (V
) for the data type needed - Skip
V
bytes from the start of the file to seek to a file position there the data for index keyK
starts - Read the data
- Profit :)
This happens many times during the program flow.
Um, and I'm investigating possibility of doing the very same on J2ME, and while I admit I'm quite new to the whole Java thing, I can't seem to be able to find anything beyond InputStream
(DataInputStream
) classes which don't have the basic seeking/skipping to byte/returning position functions I need.
So, what are my chances?