Binary log event definitions. This includes generic code common to all types of log events, as well as specific code for each type of log event. - All numbers, whether they are 16-, 24-, 32-, or 64-bit numbers, are stored in little endian, i.e., the least significant byte first, unless otherwise specified. representation of unsigned integers, called Packed Integer. A Packed Integer has the capacity of storing up to 8-byte integers, while small integers still can use 1, 3, or 4 bytes. The value of the first byte determines how to read the number, according to the following table:
Format of Packed Integer
|First byte ||Format |
|0-250 ||The first byte is the number (in the range 0-250), and no more bytes are used. |
|252 ||Two more bytes are used. The number is in the range 251-0xffff. |
|253 ||Three more bytes are used. The number is in the range 0xffff-0xffffff. |
|254 ||Eight more bytes are used. The number is in the range 0xffffff-0xffffffffffffffff. |
- Strings are stored in various formats. The format of each string is documented separately.