alipay-bolt 1.5.3 - ProtocolSwitch
程序员文章站
2022-03-26 15:13:19
1、用于按《位》检查开关是否打开import com.alipay.remoting.config.switches.ProtocolSwitch;import lombok.extern.slf4j.Slf4j;/** */@Slf4jpublic class ProtocolSwitchTest { /** * com.alipay.remoting.rpc.protocol.RpcCommandDecoderV2#decode(...) * 检查某<...
1、用于按《位》检查开关是否打开
import com.alipay.remoting.config.switches.ProtocolSwitch;
import lombok.extern.slf4j.Slf4j;
/**
*/
@Slf4j
public class ProtocolSwitchTest {
/**
* com.alipay.remoting.rpc.protocol.RpcCommandDecoderV2#decode(...)
* 检查某<位>是否为true
*/
public static void main(String[] args) throws Exception {
{
// 0000 0100
byte value1 = (byte) 0b00000100; // 二进制
byte value2 = (byte) 0x04; // 十六进制
if (value1 == value2) {
log.info("value1 == value2");
}
boolean isOn = ProtocolSwitch.isOn(0, value1); // 第0位
log.info("isOn = {}", isOn); // false
isOn = ProtocolSwitch.isOn(2, value2); // 第2位
log.info("isOn = {}", isOn); // true
}
{
byte protocolSwitchValue = 1;
boolean crcSwitchOn = ProtocolSwitch.isOn(ProtocolSwitch.CRC_SWITCH_INDEX, protocolSwitchValue);
log.info("crcSwitchOn = {}", crcSwitchOn);
}
}
}
本文地址:https://blog.csdn.net/zhouzhiande/article/details/112024897
推荐阅读
-
/usr/local/lib/ruby/gems/2.4.0/gems/cocoapods-1.5.3/lib/cocoapods/command.rb:118:in `git_version': Failed to extract git version from `git --versi
-
alipay-bolt 1.5.3 - NettyServer
-
学习笔记 -- esri-loader 1.5.3 添加天地图
-
alipay-bolt 1.5.3 - ProtocolSwitch
-
SeasLog-1.5.3 发布,轻量高效的 PHP 日志扩展
-
/usr/local/lib/ruby/gems/2.4.0/gems/cocoapods-1.5.3/lib/cocoapods/command.rb:118:in `git_version': Failed to extract git version from `git --versi
-
stlport 5.2.1 + boost 1.5.3安装与 nullptr
-
alipay-bolt 1.5.3 - NettyServer
-
alipay-bolt 1.5.3 - ProtocolSwitch
-
stlport 5.2.1 + boost 1.5.3安装与 nullptr