【问题标题】:How to convert byte[4] to int (Android) [closed]如何将字节 [4] 转换为 int (Android) [关闭]
【发布时间】:2013-10-24 13:00:37
【问题描述】:

我有一个结构,其中有 4 个字节指出我接下来应该在哪里阅读。 字节似乎是:50, -121, 5, 0(只是一个示例)

我一直在寻找如何转换byte[] to int,但没有找到任何解决方案。

【问题讨论】:

标签: java android bytearray


【解决方案1】:
ByteBuffer.wrap(bytes).getInt();

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-03-01
    • 2011-02-19
    • 1970-01-01
    • 2018-07-04
    • 2019-11-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多