当前位置:网站首页>kotlin位运算的坑(bytes[i] and 0xff 报错)
kotlin位运算的坑(bytes[i] and 0xff 报错)
2022-07-01 05:56:00 【lplj717】
java中位运算
bytes是byte数组
bytes[i] & 0xff (无异常)
kotlin中不能替换成
bytes[i] and 0xff (报错如图,按照提示修为下面)
(bytes[i] and 0xff.toByte()).toInt() (这样依旧是有符号数,没有达到预期)
因为kotlin位运算只针对int类型和long类型,需要改成
bytes[i].toInt() and 0xff
边栏推荐
- 喊我们大学生个人云服务特供商
- Brief description of activation function
- srpingboot security demo
- 如何添加葫芦儿派盘
- Preliminary level of C language -- selected good questions on niuke.com
- MySQL数据迁移遇到的一些错误
- PLA not pasted on the bed: 6 simple solutions
- Essay learning record essay multi label Global
- Excel dynamic chart
- In win10 and win11, the scroll direction of Elan touch panel is reversed, and "double finger click to open the right-click menu" and "double finger scroll" are started“
猜你喜欢
不是你脑子不好用,而是因为你没有找到对的工具
Seven major technical updates that developers should pay most attention to on build 2022
OpenGL es: (5) basic concepts of OpenGL, the process of OpenGL es generating pictures on the screen, and OpenGL pipeline
OpenGL ES: (3) EGL、EGL绘图的基本步骤、EGLSurface、ANativeWindow
论文学习记录随笔 多标签之LSML
这才是大学生必备软件 | 知识管理
Pla ne colle pas sur le lit: 6 solutions simples
表格中el-tooltip 实现换行展示
Why use huluer pie disk instead of U disk?
excel動態圖錶
随机推荐
jdbc 数据库操作
ONEFLOW source code parsing: automatic inference of operator signature
1034 Head of a Gang
OpenGL ES: (4) EGL API详解 (转)
C语言初阶——牛客网精选好题
Primary application case of Excel DuPont analyzer
PLA不粘贴在床上:6个简单的解决方案
穿越派·派盘 + Mountain Duck = 数据本地管理
[QT] QT after addition, subtraction, multiplication and division, two decimal places are reserved
Beauty of Mathematics - Application of Mathematics
Advanced cross platform application development (II): uni app practice
Thoughts on a "01 knapsack problem" expansion problem
restframework-simpleJWT重写认证机制
MySQL数据迁移遇到的一些错误
Through cooperation with the University of international trade, we can increase efficiency for college students
基于LabVIEW的计时器
Crossing pie · pie pan + Mountain duck = local data management
C语言初阶——实现扫雷游戏
这才是大学生必备软件 | 知识管理
Huluer app help