Hi, I have a byte[] and I'm trying to get out 1-2 bytes depending on whether it's 8bit or 16bit and to convert this to a short value. I'm not really sure how to do this as obviously I can't just add the bytes together, and I need to make sure that I know whether it is positive/negative (and little/big endian).
Can anybody explain how to do this?
edit: I am presuming that you can get out the first byte and shift it left by 8, and then add it to the other byte. But then how do I know whether the two bytes are positive or negative.
This surely must be a rather standard problem, so I wonder if there is any sample code anywhere that I can look at?
Depends on what you call an important windows service some windows services do nothing unless you're joined to a domain or a server if your not then these are a waste of resources having them run in the back ground.
I agree with the rest though especially the Official windows 11 24H2 ISO
If you like MS riffling through your personal files for their AI training then by all means use one drive.
Personally I wouldn't use it I'd rather use a 20TB external HDD where I control what happens to my data not MS
@margrave I'd say this is system specific; I've not heard anyone else complain about their desktop icons changing following a Windows Update, and it reads rather odd.
Have you checked display scaling, could that be the culprit?
Question
lhnz
Hi, I have a byte[] and I'm trying to get out 1-2 bytes depending on whether it's 8bit or 16bit and to convert this to a short value. I'm not really sure how to do this as obviously I can't just add the bytes together, and I need to make sure that I know whether it is positive/negative (and little/big endian).
Can anybody explain how to do this?
edit: I am presuming that you can get out the first byte and shift it left by 8, and then add it to the other byte. But then how do I know whether the two bytes are positive or negative.
This surely must be a rather standard problem, so I wonder if there is any sample code anywhere that I can look at?
Edited by lhnzLink to comment
https://www.neowin.net/forum/topic/709892-java-convert-1-2-bytes-into-a-short/Share on other sites
7 answers to this question
Recommended Posts