Re: J2ME : fastest way to read lines from text resource into a string array ?

From: Roedy Green (see_at_mindprod.com.invalid)
Date: 04/26/04


Date: Mon, 26 Apr 2004 03:24:47 GMT

On Mon, 26 Apr 2004 02:40:59 GMT, "Darryl L. Pierce"
<mcpierce@myrealbox.com> wrote or quoted :

>Since he's creating the data before putting it into his JAR, he can easily
>create the file with Java. I used the same solution in my last project to
>put default i18n data into the MIDlet suite, and we supported several
>non-Latin character sets in this manner.

For that sort of thing, I just use ObjectStreams (which internally
uses writeUTF). There is then just a single line of code in the
Applet to restore the entire universe of data. It always works
perfectly no matter how complicated the data.

That's how the CurrCon currency converter app on my website works. See
http://mindprod.com/products.html#CURRCON and also the navigator if
you turn on frames that lets you jump anywhere in the glossary
directly. I also use that in the Replicator. see
http://mindprod.com/products.html#REPLICATOR. The manifest.ser file
is a serialised copy of everything your client needs to know.

This keeps the Applet or JWS client small since you have no baggage in
there to deal with parsing or even individual fields.

For sample code on how to do that see http://mindprod.com/fileio.html

Serialisation was pretty rocky at first. Now we know where the rocks
are and it has been fixed up. Look into it. It saves a TON of boring
hard to maintain code.

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming. 
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.


Relevant Pages

  • Re: Serialization
    ... It reads a preparsed Java source code as as stream of serialised ... Serialisation is great because you can dump an entire collection, ... The applet itself is just a few lines. ... * param window controls target window. ...
    (comp.lang.java.help)
  • Technical information about the vulnerabilities fixed by MS-02-52
    ... The patch doesn't fix all of the vulnerabilities we reported, ... Java support in the Internet Zone even after applying the patch gives the ... possibility for a malicious Java Applet to gain control over the system. ... Our original report and information regarding the remaining Java ...
    (NT-Bugtraq)
  • Technical information about the vulnerabilities fixed by MS-02-52
    ... The patch doesn't fix all of the vulnerabilities we reported, ... Java support in the Internet Zone even after applying the patch gives the ... possibility for a malicious Java Applet to gain control over the system. ... Our original report and information regarding the remaining Java ...
    (Bugtraq)
  • [Full-Disclosure] Technical information about the vulnerabilities fixed by MS-02-52
    ... The patch doesn't fix all of the vulnerabilities we reported, ... Java support in the Internet Zone even after applying the patch gives the ... possibility for a malicious Java Applet to gain control over the system. ... Our original report and information regarding the remaining Java ...
    (Full-Disclosure)
  • Re: Java Question
    ... if the anfy applet works for you then I don't know why the game ... I'm a little unclear about part of your instructions to go to my Java ... message that I need to download and install Macromedia Flash Player (which I ...
    (microsoft.public.windowsxp.general)