posted 18 years ago
Hello All,
Is there any formula for finding a byte value, if the following example is like this.
1) Short a = new Short("7000"); a.byteValue() = 88 and a.shortValue() % 128 = 88
2) Short a = new Short("6100"); a.byteValue() = -44 and a.shortValue() % 128 = 84
3) Short a = new Short("6200"); a.byteValue() = 56 and a.shortValue() % 128 = 56
I found for some values if i add -128 to the result of "a.shortValue() % 128" i am getting the byte values.
But it is not working in all the cases.
So if anybody knows any formula for this please give a reply.
regards,
sri.