久久久久久久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字節短java

        2 bytes to short java(2字節短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字節短java的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在從串行端口讀取 133 個長度的數據包,最后 2 個字節包含 CRC 值,2 個字節值我使用 java 制作單個(我認為是短的).這就是我所做的,

                  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);
                  

                  但我沒有得到正確的結果,是因為簽名值有問題嗎?我該如何解決這個問題,請幫助我遇到麻煩

                  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

                  推薦答案

                  請記住,如果您對細節不太熟悉,則不必為位移而糾結.您可以使用 ByteBuffer 來幫助您:

                  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);
                  

                  反之亦然,你可以先放一個短,然后再拉出字節.

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

                  順便說一下,按位運算會自動將操作數提升到至少一個 int 的寬度.真的沒有不允許將一個字節移動超過 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.

                  這篇關于2字節短java的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

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

                  <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>
                            主站蜘蛛池模板: 一级毛片网 | 精品国产伦一区二区三区观看方式 | 欧美日韩综合视频 | 中文在线а√在线8 | 老司机67194精品线观看 | 麻豆av免费观看 | 91爱啪啪 | 夜夜av | 国产精品美女在线观看 | 日韩不卡一区二区三区 | 亚洲免费一区 | 亚洲精品久久久久久一区二区 | 一级黄色毛片子 | 久久男女视频 | 午夜综合 | 黄色片免费看 | 天堂av资源| 四虎成人在线播放 | 婷婷色在线播放 | 国产一区二区a | 国产精品久久久久一区二区三区 | 欧美四虎 | 成人av免费 | 亚洲综合一区二区三区 | 99精品视频一区二区三区 | 国产一区二区三区在线免费观看 | 岛国av免费在线观看 | 粉嫩一区二区三区国产精品 | 亚洲精品久久久蜜桃 | 国产激情片在线观看 | 欧美一级久久 | 国产精品成人一区二区 | 国产精品日韩在线 | 97国产一区二区精品久久呦 | 亚洲在线 | 青青草原综合久久大伊人精品 | 中文字幕精品视频 | 亚洲精品一区二区三区在线 | 成人精品鲁一区一区二区 | 日韩免费av网站 | 欧美又大粗又爽又黄大片视频 |