Sunday, 15 September 2013

stdint.h for Java?

stdint.h for Java?

Is there a java library implementing the standard data types as they are
available in C?
In Java everything is signed, so using byte to store uint8_t comes with
some problems, for example:
byte test = (byte) 0xf3;
System.out.println("test = " + test);
prints
test = -13
instead of
test = 243
I think of something like this:
UInt8 test = new UInt8(0xf3);
System.out.println("test = " + test.toInt());

No comments:

Post a Comment