Note that there are some explanatory texts on larger screens.

plurals
  1. POFile random access in J2ME
    text
    copied!<p>does J2ME have something similar to <a href="http://download.oracle.com/javase/1.4.2/docs/api/java/io/RandomAccessFile.html" rel="nofollow"><code>RandomAccessFile</code></a> class, or is there any way to emulate this particular (random access) functionality?</p> <p>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:</p> <ol> <li>Read 2 bytes for index key (<code>K</code>), another 2 for index value (<code>V</code>) for the data type needed</li> <li>Skip <code>V</code> bytes from the start of the file to seek to a file position there the data for index key <code>K</code> starts</li> <li>Read the data</li> <li>Profit :)</li> </ol> <p>This happens many times during the program flow.</p> <p>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 <a href="http://java.sun.com/javame/reference/apis/jsr118/java/io/InputStream.html" rel="nofollow"><code>InputStream</code></a> (<a href="http://java.sun.com/javame/reference/apis/jsr118/java/io/DataInputStream.html" rel="nofollow"><code>DataInputStream</code></a>) classes which don't have the basic seeking/skipping to byte/returning position functions I need.</p> <p>So, what are my chances?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload