3 ms·
Just yesterday I've watched this: https://www.youtube.com/watch?v=88-szpeNfrU https://www.youtube.com/watch?v=88-szpeNfrU Long story short: keep the traditiona
by vrotaru 11y ago
Just yesterday I've watched this: https://www.youtube.com/watch?v=88-szpeNfrU https://www.youtube.com/watch?v=88-szpeNfrU
Long story short: keep the traditional getters and setters but have just a byte[] field to store the object state. For example If you need just the date (without the time) you can store it in 2 bytes, say 7 and 8, and in getDate() method you do
public Date getDate() {
int day = bytes[8] * 256 + bytes[9]
return new Date(day * MILLIS_PER_DAY);
}
Some of the improvements are amazing