Data types
Int32
-
Integer 32-bits
In some cases — e.g. object handles, and some lengths — this is actually a 16-bit “short” encoded as a 32-bit integer with the high bits zero.
Whether the number should be interpreted as signed or unsigned may depend on the context;when we are sure it’s unsigned, we’ll generally specify
UInt32
documented next. UInt32
-
Unsigned integer 32-bits
Int64
-
Integer 64-bits
Alternatively, especially for blob and arrays ids, can be interpreted as two
Int32
, a.k.a. a “quad”.Interpretation as a 64-bit integer — even for blob and array ids — is generally simpler, and should not make a difference.Whether the number should be interpreted as signed or unsigned may depend on the context.
Buffer
-
Composed of
Int32
-
Length of buffer data without padding
Byte[]
-
Buffer data
Byte[]
-
Padding of 0 to 3 bytes to align the message to a multiple of 4 (e.g. calculated as
(4 - length) & 3)
).That is, for some
N >= 0
, when the buffer length is:-
N * 4
bytes → no padding -
N * 4 + 1
bytes → 3 bytes padding -
N * 4 + 2
bytes → 2 bytes padding -
N * 4 + 3
bytes → 1 byte padding
-
Byte[]
-
An array of bytes
Length follows from another field in the message, from correct parsing of the value, or from other specifics of the message.
String
-
A text string, read or written as a
Buffer
, encoded in the connection character set or some message or context specific character set