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 seg4, which contains a single JSON object with UTF-8 encoding. It may be empty. This is currently a placeholder with no defined parameters.

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.

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 reference see below
2 true literal
3 false literal
4 1 byte signed integer
5 2 byte signed integer
6 4 byte signed integer
7 8 byte signed integer
8 4 byte floating point
9 8 byte floating point
10 string1 seg1 UTF-8 encoded string
11 string2 seg2 UTF-8 encoded string
12 string4 seg4 UTF-8 encoded string
13 string8 seg8 UTF-8 encoded string
14 json1 seg1 UTF-8 encoded JSON
15 json2 seg2 UTF-8 encoded JSON
16 json4 seg4 UTF-8 encoded JSON
17 json8 seg8 UTF-8 encoded JSON