当前位置:网站首页>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
边栏推荐
- ONEFLOW source code parsing: automatic inference of operator signature
- SystemVerilog学习-07-类的继承和包的使用
- Preliminary level of C language -- selected good questions on niuke.com
- He struggled day and night to protect his data
- DEV XPO对比之XAF BO
- Brief description of activation function
- Build 2022 上开发者最应关注的七大方向主要技术更新
- 1034 Head of a Gang
- 【笔记】电商订单数据分析实战
- excel動態圖錶
猜你喜欢

CJC8988带2个立体声耳机驱动器的低功率立体声编解码器

FPGA - 7系列 FPGA内部结构之Clocking -01- 时钟架构概述

Essay learning record essay multi label Global

【笔记】电商订单数据分析实战

excel动态图表

Smartinstantiationawarebeanpostprocessor of the extension point series determines which construction method to execute - Chapter 432

喊我们大学生个人云服务特供商

SystemVerilog学习-08-随机约束和线程控制

excel初级应用案例——杜邦分析仪

LED lighting used in health lighting
随机推荐
Thesis learning record essay multi label lift
TIDB数据库特性总结
码蹄集 - MT3149 · AND - 数据不是很强,暴力剪枝就能骗AC
OpenGL ES: (5) OpenGL的基本概念、OpenGL ES 在屏幕产生图片的过程、OpenGL管线(pipeline)
My experience from technology to product manager
OpenGL es: (3) EGL, basic steps of EGL drawing, eglsurface, anativewindow
Flink实战--多流合并
[note] e-commerce order data analysis practice
excel动态图表
Huluer app help
freeswitch拨打分机号
Qt编写自定义控件-自绘电池
libpng12.so.0: cannot open shared object file: No such file or directory 亲测有效
DEV XPO对比之UOW
论文学习记录随笔 多标签之LSML
HCM 初学 ( 四 ) - 时间
Brief description of activation function
CJC8988带2个立体声耳机驱动器的低功率立体声编解码器
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