fromWire static method
Decodes a zenoh-c wire congestion-control value (0/1/2) into a CongestionControl.
Wire value 2 is the unstable Z_CONGESTION_CONTROL_BLOCK_FIRST and
decodes to CongestionControl.blockFirst. Only genuinely out-of-range
values (raw < 0 or raw >= values.length) fall back to
CongestionControl.block rather than crashing on an unbounded index.
Implementation
static CongestionControl fromWire(int raw) {
if (raw < 0 || raw >= CongestionControl.values.length) {
return CongestionControl.block;
}
return CongestionControl.values[raw];
}