public class BooleanUtil extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
static List<Boolean> |
byteArrayToList(int quantity,
byte[] src)
提取指定数量的boolean值
|
static boolean |
getValue(byte data,
int bit)
获取字节指定位的状态
|
static int |
getValueToInt(byte data,
int bit)
获取字节指定位的状态
|
static byte[] |
listToByteArray(List<Boolean> list)
将boolean列表转换为字节数组
|
static byte |
setBit(byte data,
int bit,
boolean res)
对字节的指定位设置1或0
|
static byte |
setBit(int bit,
boolean res)
对字节的指定位设置1或0
|
static byte |
toByte(boolean data) |
public static byte toByte(boolean data)
public static byte setBit(int bit,
boolean res)
bit - 位数res - true:1,false:0public static byte setBit(byte data,
int bit,
boolean res)
data - 字节数据bit - 位数res - true:1,false:0public static boolean getValue(byte data,
int bit)
data - 字节数据bit - 位数 0-7public static int getValueToInt(byte data,
int bit)
data - 字节数据bit - 位数 0-7public static List<Boolean> byteArrayToList(int quantity, byte[] src)
quantity - 数量src - 数据源Copyright © 2024. All rights reserved.