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

Key Value Description
mnemonics JSON 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

Code Value Description
0 mnemonic reference followed by 4 byte integer, lookup string by index from mnemonics in header
1 mnemonic ID followed by 4 byte integer, literal mnemonic ID

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

Value Type Definition

Code Value Description
0 null literal null / empty string
1 1 byte signed integer
2 2 byte signed integer
3 4 byte signed integer
4 8 byte signed integer
5 4 byte floating point
6 8 byte floating point
7 string followed by 2 byte integer string length n, then n bytes UTF-8 encoded string