For an application I need to have an unsigned data-type with 24 bits.
Unfortunately such a data type is not available in Java. I’m planning to implement it as a new class.But I’m not sure about the performance of such an implementation.
Is it advisable to write my own class?
If it is advisable, is it possible to good performance?
If you want to save space, you could use int for caluclation and map the least significant 3 bytes to a byte[] or just three bytes:
(can’t verify if it is bug free but at least it should give an idea)