Protocol buffer

http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/proto.html

Scalar Value Type

.proto Type

Notes

C++ Type

Java Type

double


double

double

float


float

float

int32

使用可变长度的编码。对负数编码无效,如果有负数域,可以用sint32代替。

int32

int

int64

使用可变长度的编码。对负数编码无效,如果有负数域,可以用sint64代替。

int64

long

uint32

使用可变长度的编码。

uint32

int[1]

uint64

使用可变长度的编码。

uint64

long[1]

sint32

使用可变长度的编码。有符号整数类型。 相较于int32s,对负数编码有效。

int32

int

sint64

使用可变长度的编码。有符号整数类型。 相较于int64s,对负数编码有效。

int64

long

fixed32

始终是4 bytes.如果值通常大于 228 比uint32有效。

uint32

int[1]

fixed64

始终是8 bytes.如果值通常大于 256 比uint32有效。

uint64

long[1]

sfixed32

始终是4 bytes.

int32

int

sfixed64

始终是8 bytes.

int64

long

bool


bool

boolean

string

总是包含UTF-8编码或7位ASCII文字的字符串。

string

String

bytes

可能包含任意顺序的序列。

string

ByteString




相关文章:

  • 2022-12-23
  • 2021-06-09
  • 2021-12-23
  • 2021-12-27
  • 2022-02-26
  • 2021-12-30
猜你喜欢
  • 2021-08-30
  • 2022-02-14
  • 2021-07-13
  • 2022-01-03
相关资源
相似解决方案