当前位置:网站首页>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
边栏推荐
- Why use huluer pie disk instead of U disk?
- C language beginner level - realize the minesweeping game
- El tooltip in the table realizes line breaking display
- PLA not pasted on the bed: 6 simple solutions
- My experience from technology to product manager
- Don't put your notes and videos everywhere!
- Flink实战--多流合并
- Debug details under pycharm
- Oracle sequence + trigger
- Chip, an empire built on sand!
猜你喜欢

Through cooperation with the University of international trade, we can increase efficiency for college students

2022 年面向初学者的 10 大免费 3D 建模软件

Preliminary level of C language -- selected good questions on niuke.com

我从技术到产品经理的几点体会

C language beginner level - realize the minesweeping game

从诺奖知“边缘计算”的未来!

芯片,建立在沙粒上的帝国!

穿越派 你的数据云行

TIDB数据库特性总结

jdbc 数据库操作
随机推荐
穿越派·派盘 + Mountain Duck = 数据本地管理
Brief description of activation function
TiDB单机模拟部署生产环境集群(闭坑实践,亲测有效)
HCM 初学 ( 二 ) - 信息类型
OpenGL es: (3) EGL, basic steps of EGL drawing, eglsurface, anativewindow
excel高级绘图技巧100讲(一)-用甘特图来展示项目进度情况
码蹄集 - MT3149 · AND - 数据不是很强,暴力剪枝就能骗AC
Smartinstantiationawarebeanpostprocessor of the extension point series determines which construction method to execute - Chapter 432
Continue to learn MySQL
Huluer app help
HCM 初学 ( 三 ) - 快速输入PA70、PA71 浏览员工信息PA10
论文学习记录随笔 多标签之LIFT
不是你脑子不好用,而是因为你没有找到对的工具
Timer based on LabVIEW
TIDB数据库特性总结
Send you through the data cloud
Flink实战--多流合并
【笔记】电商订单数据分析实战
穿越派与贸大合作,为大学生增添效率
First defined here occurs during QT compilation. Causes and Solutions