t1497f35
September 12th, 2011, 08:35 PM
Hi,
Since Java only has signed numbers (byte, short, int) what do programmers do when say they have to create a Java binding to a C API and there's a function that works with "unsigned char" values?
Do they
1) use "short" and waste memory?
2) use "byte" and hope the function will never produce any values above 128?
3) if some other solution - which one?
Since Java only has signed numbers (byte, short, int) what do programmers do when say they have to create a Java binding to a C API and there's a function that works with "unsigned char" values?
Do they
1) use "short" and waste memory?
2) use "byte" and hope the function will never produce any values above 128?
3) if some other solution - which one?