Skip to main content

XBin Format Reference

The XBin (XINA Binary) format provides a XINA standard binary format for mnemonic data source files. It uses the file extension xbin.

UUID

The file starts with a 16 byte binary encoded UUID.

Header

This is followed by a 4 byte unsigned integer denoting the byte length of the header, which contains a single JSON object with UTF-8 encoding. The value may be 0, indicating no header is present.

Header Definition

KeyValueDescription
mnemonicsJSON array of string(s)list of mnemonic text values

Rows

Each row starts with an 8 byte signed integer containing Unix time with microsecond precision. This is followed by a 4 byte unsigned integer denoting the length of the row in bytes.

Values

Each value starts with a 1 byte unsigned integer indicating the value reference type.

Value Reference Definition

CodeValueDescription
0mnemonic referencefollowed by 4 byte integer, lookup string by index from mnemonics in header
1mnemonic IDfollowed by 4 byte integer, literal mnemonic ID

This is followed by a 1 byte unsigned integer indicating the value type.

Value Type Definition

CodeValueDescription
0nullliteral null / empty string
11 byte signed integer
22 byte signed integer
34 byte signed integer
48 byte signed integer
54 byte floating point
68 byte floating point
7stringfollowed by 2 byte integer string length n, then n bytes UTF-8 encoded string