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.

XBin data is often encoded in segments, which are defined by an initial signed integer byte length, then that number of bytes. These are referred to in this document as seg1 (up to 127 bytes), seg2 (up to 32,767 bytes), seg4 (up to 2,147,483,647 bytes) and seg8 (up to 9,223,372,036,854,775,807 bytes). If the initial value is zero there is no following data and the value is considered empty.

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,seg4, which contains a single JSON object with UTF-8 encoding. The valueIt may be 0,empty. indicatingThis is currently a placeholder with no headerdefined is present.parameters.

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

Code Value Description
0 null literal null / empty string
1 string value referencesee below
2true literal
3false literal
41 byte signed integer
25 2 byte signed integer
36 4 byte signed integer
47 8 byte signed integer
58 4 byte floating point
69 8 byte floating point
710 stringstring1 followed by 2 byte integer string length n, then n bytesseg1 UTF-8 encoded string
11string2seg2 UTF-8 encoded string
12string4seg4 UTF-8 encoded string
13string8seg8 UTF-8 encoded string
14json1seg1 UTF-8 encoded JSON
15json2seg2 UTF-8 encoded JSON
16json4seg4 UTF-8 encoded JSON
17json8seg8 UTF-8 encoded JSON