in hessian2/basic_codec/number_codec.cc [165:186]
bool Encoder::encode(const int32_t &data) {
if (data >= -0x10 && data <= 0x2f) {
writer_->writeByte(data + 0x90);
return true;
}
if (data >= -0x800 && data <= 0x7ff) {
writer_->writeByte(0xc8 + (data >> 8));
writer_->writeByte(data);
return true;
}
if (data >= -0x40000 && data <= 0x3ffff) {
writer_->writeByte(0xd4 + (data >> 16));
writer_->writeByte(data >> 8);
writer_->writeByte(data);
return true;
}
writer_->writeByte(0x49);
writer_->writeBE<uint32_t>(data);
return true;
}