Re: Getting Applet into Flash ROM?
Mark Wolforth <[email protected]>
| Newsgroups | gmane.comp.hardware.microcontrollers.tini |
|---|---|
| Message-ID | <[email protected]> |
Hi,
I've done this entirely in Java by storing the data as a string and then
using the getBytes() method to extract the bytes back. A String is the
most data efficient way to do this in Java since all other array types
add code to set up the array itself. As an example, you could have a
class like:
class Web_applet {
public byte[] JARfile;
public web_applet() {
try {
JARfile = "-Þd;o³õÃݶ¡¸Ç6ï´ÍÀ»l'bض\u0".getBytes();
} catch (Throwable _) {}
}
}
and then extract the data with something like:
private static final void CreateAppletJAR() {
FileOutputStream jarfile;
try {
jarfile = new FileOutputStream (new File("Applet.jar"));
Web_applet applet = new Web_applet();
jarfile.write (applet.JARfile, 0, applet.JARfile.length);
jarfile.close();
} catch (Throwable t) {
System.out.println ("Error creating web applet JAR file.");
System.out.println (t);
}
} // End of CreateAppletJAR()
Watch out for the 64K class limit size. If you hit up against this
you'll need to create multiple classes to hold your data.
Good luck,
Mark.
_______________________________________________
TINI mailing list
TINI-6tN4nzCoH/[email protected]
To UNSUBSCRIBE, edit your profile, or see list archives:
http://lists.dalsemi.com/mailman/listinfo/tini