-
Notifications
You must be signed in to change notification settings - Fork 1
Disk Format
Andrew Berls edited this page Jun 1, 2015
·
2 revisions
BTables are a binary file format on disk. In general, labels are written as a delimited sequence of 2-byte UTF-16 characters (joined with the ASCII unit separator, ASCII # 31), and all cell values are 8-byte doubles.
Table format:
-
Integer format version (4 bytes). Currently
0. -
Integer character count of joined labels string, including delimiters (4 bytes)
- Note: Label characters are 2-byte UTF-16 chars, meaning the raw bytecount is 2 * character count
-
Label string as sequence of 2-byte UTF-16 characters
Then, for each row: - Integer number of nonzero values in row (4 bytes)
- Sequential 'pairs' of index/value for each nonzero cell (4 bytes integer index, 8 byte double value)
All numeric values are written big-endian.
An example row sequence of:
[[38.2 0.0 0.0 47.3 0.0]
[0.0 63.4 79.5 0.0 0.0]]
would be written to disk as:
2 0 38.2 3 47.3 2 1 63.4 2 79.6