[Solved] Check data is coming from external source is positive or negative & fetch it’s value


That would depend on what you mean by “negative” and how you convert your 3 bytes to a long value. If you store the three bytes in the three least significant bytes of the long and if “negative” means that the highest bit is set, then you should be able to use:

if ((longData & (1L<<23)) != 0) {
    System.out.print(i+"negative");
}
else {
    System.out.print(i+"positive");
}

4

solved Check data is coming from external source is positive or negative & fetch it’s value