久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <legend id='iptI1'><style id='iptI1'><dir id='iptI1'><q id='iptI1'></q></dir></style></legend>
      <bdo id='iptI1'></bdo><ul id='iptI1'></ul>
    <tfoot id='iptI1'></tfoot>

    1. <small id='iptI1'></small><noframes id='iptI1'>

      1. <i id='iptI1'><tr id='iptI1'><dt id='iptI1'><q id='iptI1'><span id='iptI1'><b id='iptI1'><form id='iptI1'><ins id='iptI1'></ins><ul id='iptI1'></ul><sub id='iptI1'></sub></form><legend id='iptI1'></legend><bdo id='iptI1'><pre id='iptI1'><center id='iptI1'></center></pre></bdo></b><th id='iptI1'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='iptI1'><tfoot id='iptI1'></tfoot><dl id='iptI1'><fieldset id='iptI1'></fieldset></dl></div>
      2. 2字節(jié)短java

        2 bytes to short java(2字節(jié)短java)

              <tfoot id='3Xeaz'></tfoot>
                <tbody id='3Xeaz'></tbody>

                • <bdo id='3Xeaz'></bdo><ul id='3Xeaz'></ul>
                  <legend id='3Xeaz'><style id='3Xeaz'><dir id='3Xeaz'><q id='3Xeaz'></q></dir></style></legend>
                  <i id='3Xeaz'><tr id='3Xeaz'><dt id='3Xeaz'><q id='3Xeaz'><span id='3Xeaz'><b id='3Xeaz'><form id='3Xeaz'><ins id='3Xeaz'></ins><ul id='3Xeaz'></ul><sub id='3Xeaz'></sub></form><legend id='3Xeaz'></legend><bdo id='3Xeaz'><pre id='3Xeaz'><center id='3Xeaz'></center></pre></bdo></b><th id='3Xeaz'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='3Xeaz'><tfoot id='3Xeaz'></tfoot><dl id='3Xeaz'><fieldset id='3Xeaz'></fieldset></dl></div>

                  <small id='3Xeaz'></small><noframes id='3Xeaz'>

                  本文介紹了2字節(jié)短java的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

                  我正在從串行端口讀取 133 個(gè)長(zhǎng)度的數(shù)據(jù)包,最后 2 個(gè)字節(jié)包含 CRC 值,2 個(gè)字節(jié)值我使用 java 制作單個(gè)(我認(rèn)為是短的).這就是我所做的,

                  i'm reading 133 length packet from serialport,last 2 bytes contain CRC values,2 bytes value i've make single(short i think) using java. this what i have done,

                  short high=(-48 & 0x00ff);
                  short low=80;
                  
                  short c=(short) ((high<<8)+low);
                  

                  但我沒(méi)有得到正確的結(jié)果,是因?yàn)楹灻涤袉?wèn)題嗎?我該如何解決這個(gè)問(wèn)題,請(qǐng)幫助我遇到麻煩

                  but i'm not getting correct result,is it problem because signed valued? how can i solve this problem,plz help me i'm in trouble

                  推薦答案

                  請(qǐng)記住,如果您對(duì)細(xì)節(jié)不太熟悉,則不必為位移而糾結(jié).您可以使用 ByteBuffer 來(lái)幫助您:

                  Remember, you don't have to tie yourself in knots with bit shifting if you're not too familiar with the details. You can use a ByteBuffer to help you out:

                  ByteBuffer bb = ByteBuffer.allocate(2);
                  bb.order(ByteOrder.LITTLE_ENDIAN);
                  bb.put(firstByte);
                  bb.put(secondByte);
                  short shortVal = bb.getShort(0);
                  

                  反之亦然,你可以先放一個(gè)短,然后再拉出字節(jié).

                  And vice versa, you can put a short, then pull out bytes.

                  順便說(shuō)一下,按位運(yùn)算會(huì)自動(dòng)將操作數(shù)提升到至少一個(gè) int 的寬度.真的沒(méi)有不允許將一個(gè)字節(jié)移動(dòng)超過(guò) 7 位"的概念以及其他似乎正在流傳的謠言.

                  By the way, bitwise operations automatically promote the operands to at least the width of an int. There's really no notion of "not being allowed to shift a byte more than 7 bits" and other rumours that seem to be going round.

                  這篇關(guān)于2字節(jié)短java的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  quot;Char cannot be dereferencedquot; error(“Char 不能被取消引用錯(cuò)誤)
                  Java Switch Statement - Is quot;orquot;/quot;andquot; possible?(Java Switch 語(yǔ)句 - 是“或/“和可能的?)
                  Java Replace Character At Specific Position Of String?(Java替換字符串特定位置的字符?)
                  What is the type of a ternary expression with int and char operands?(具有 int 和 char 操作數(shù)的三元表達(dá)式的類型是什么?)
                  Read a text file and store every single character occurrence(讀取文本文件并存儲(chǔ)出現(xiàn)的每個(gè)字符)
                  Why do I need to explicitly cast char primitives on byte and short?(為什么我需要在 byte 和 short 上顯式轉(zhuǎn)換 char 原語(yǔ)?)

                  <small id='RPiIU'></small><noframes id='RPiIU'>

                • <i id='RPiIU'><tr id='RPiIU'><dt id='RPiIU'><q id='RPiIU'><span id='RPiIU'><b id='RPiIU'><form id='RPiIU'><ins id='RPiIU'></ins><ul id='RPiIU'></ul><sub id='RPiIU'></sub></form><legend id='RPiIU'></legend><bdo id='RPiIU'><pre id='RPiIU'><center id='RPiIU'></center></pre></bdo></b><th id='RPiIU'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='RPiIU'><tfoot id='RPiIU'></tfoot><dl id='RPiIU'><fieldset id='RPiIU'></fieldset></dl></div>

                  <legend id='RPiIU'><style id='RPiIU'><dir id='RPiIU'><q id='RPiIU'></q></dir></style></legend>

                    1. <tfoot id='RPiIU'></tfoot>
                      • <bdo id='RPiIU'></bdo><ul id='RPiIU'></ul>
                            <tbody id='RPiIU'></tbody>
                            主站蜘蛛池模板: 91精品国产乱码久久久久久久久 | 毛片一区二区三区 | 亚洲精久 | 国产不卡在线播放 | 欧美一区二区三区日韩 | 欧美日韩亚洲国产综合 | 可以看黄的视频 | 九九久久国产 | 在线日韩视频 | 成人欧美一区二区三区黑人孕妇 | 麻豆成人在线视频 | 亚洲精品欧美一区二区三区 | 伊人伊人伊人 | 日韩在线观看一区 | a级片在线观看 | 在线观看视频一区二区三区 | 欧美日韩一区二区三区在线观看 | 一区二区视频在线观看 | 欧美一区2区三区4区公司二百 | 免费亚洲视频 | 一区视频在线播放 | 成人欧美一区二区三区在线观看 | 亚洲男人的天堂网站 | 一区二区免费视频 | 国产精品成人在线播放 | 视频一区中文字幕 | 一区二区福利视频 | 超碰日韩 | 做a的各种视频 | 国产成人久久精品 | 国产精品久久久亚洲 | 蜜桃日韩 | 性福视频在线观看 | 91免费版在线观看 | 精品美女久久久久久免费 | 五月婷婷丁香 | 毛片一级片| 亚洲精品久久久久国产 | 玖玖精品 | 在线视频亚洲 | 中文在线一区二区 |