function GPBWire::varint32Size
4 calls to GPBWire::varint32Size()
- GPBWire::sint32Size in vendor/
google/ protobuf/ src/ Google/ Protobuf/ Internal/ GPBWire.php - GPBWire::tagSize in vendor/
google/ protobuf/ src/ Google/ Protobuf/ Internal/ GPBWire.php - Message::fieldByteSize in vendor/
google/ protobuf/ src/ Google/ Protobuf/ Internal/ Message.php - @ignore
- Message::fieldDataOnlyByteSize in vendor/
google/ protobuf/ src/ Google/ Protobuf/ Internal/ Message.php - @ignore
File
-
vendor/
google/ protobuf/ src/ Google/ Protobuf/ Internal/ GPBWire.php, line 384
Class
Namespace
Google\Protobuf\InternalCode
public static function varint32Size($value, $sign_extended = false) {
if ($value < 0) {
if ($sign_extended) {
return 10;
}
else {
return 5;
}
}
if ($value < 1 << 7) {
return 1;
}
if ($value < 1 << 14) {
return 2;
}
if ($value < 1 << 21) {
return 3;
}
if ($value < 1 << 28) {
return 4;
}
return 5;
}