Page 1 of 1

How to store java primitive types contents in RAM

Posted: Mon Mar 07, 2016 4:25 am
by Diorin
I have finished some java classes which contains some java primitive types(e.g. short, boolean). Because these contents are stored in EEPROM, it slows down my applet. I want to know how to store these contents in RAM in order to speed up my applet.

Re: How to store java primitive types contents in RAM

Posted: Wed Mar 16, 2016 5:00 am
by popmun09
In order to store volatile objects, you can put the attributes in a transient array.
There is support for different types, e.g. boolean, byte and short.
The usual technique is to map values in a single transient byte array.

See the documentation about makeTransientByteArray in the JCSytem class.