Generic Binary Keyed Format (*.gbkf)
This format is a generic solution for reading and writing data in a binary mode. It is designed to reduce the data size between server and clients, and also to be simple of usage and flexible for adding on-top specifications.
Work in progress, the first version is not yet released.
Core Structure
Header 12 Bytes
Keyed-Values 1
Keyed-Values 2
Keyed-Values n
The data must start with a header and be followed by an unlimited quantity of Keyed-Values.
Header
g 1 Byte
b 1 Byte
k 1 Byte
f 1 Byte
Version Nb 1 Byte
Specification ID 3 Bytes
Keys Nb 3 Bytes
Keys Size 1 Byte
- gbkf: The four letters decoded in ASCII (1 byte each).
- Version: The (gbkf) format version decoded as an unsigned integer of one byte. The maximum value is 255.
- Specification ID: The definition number decoded as an unsigned integer of 3 bytes. The maximum value is 16,777,215.
- Keys Size: The number of characters used to define the keys, decoded as an ASCII characters of 1 byte each. The maximum value is 255.
- Keys Nb: The total number of keys in the file, decoded as an unsigned integer of 3 bytes. The maximum value is 16,777,215.
Keyed-Values
Key 1 to 255 Bytes
Values Type 1 Byte
Values Size 3 Bytes
Values Nb 3 Bytes
Value 1 1 to 16,777,215 Bytes
Value 2 1 to 16,777,215 Bytes
Value n 1 to 16,777,215 Bytes
- Key: The identifier of the values, decoded in ASCII (1 byte each) and with a constant size defined by the headers Keys Size.
- Values Type: The type of the values, decoded as an unsigned integer of one byte.
- Values Size: The number of bytes of each value, decoded as an unsigned integer of 3 bytes. The maximum size per value is then 16,777,215 bytes.
- Values Nb: The number of values, decoded as an unsigned integer of 3 bytes. The maximum number of values per key, is then 16,777,215.