- In the extension bar, click the AdBlock Plus icon
- Click the large blue toggle for this website
- Click refresh
- In the extension bar, click the AdBlock icon
- Under "Pause on this site" click "Always"
- In the extension bar, click on the Adguard icon
- Click on the large green toggle for this website
- In the extension bar, click on the Ad Remover icon
- Click "Disable on This Website"
- In the extension bar, click on the orange lion icon
- Click the toggle on the top right, shifting from "Up" to "Down"
- In the extension bar, click on the Ghostery icon
- Click the "Anti-Tracking" shield so it says "Off"
- Click the "Ad-Blocking" stop sign so it says "Off"
- Refresh the page
- In the extension bar, click on the uBlock Origin icon
- Click on the big, blue power button
- Refresh the page
- In the extension bar, click on the uBlock icon
- Click on the big, blue power button
- Refresh the page
- In the extension bar, click on the UltraBlock icon
- Check the "Disable UltraBlock" checkbox
- Please disable your Ad Blocker
- Disable any DNS blocking tools such as AdGuardDNS or NextDNS
- Disable any privacy or tracking protection extensions such as Firefox Enhanced Tracking Protection or DuckDuckGo Privacy.
If the prompt is still appearing, please disable any tools or services you are using that block internet ads (e.g. DNS Servers, tracking protection or privacy extensions).
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