Sprites Binary Media Storage

A binary blob lives in the data store as one record with two fields: its id and a data object. The metadata is the meta record beside it under the same id. The data object holds the blob: a length, the count of bytes, and bytes, a flat list of that many byte values. Each byte is one integer from 0 to 255. The blob belongs to every machine, so it carries a machine, mode or palette.

{
  "id": "5e2a9c1740b84d6fa1c3e08b62d5f907",
  "data": {
    "length": 256,
    "bytes": [ "... 256 byte values, each 0 to 255 ..." ]
  }
}
The whole data record: the id and the data object. The bytes list holds length entries, in order from the first byte.

Data

The data object carries the byte count and the bytes themselves.

FieldTypeDescription
lengthNumberThe count of bytes, and the length of the bytes list.
bytesArrayThe byte values in order. Each is one integer from 0 to 255. The byte at address i is at index i.

Full example

A four byte blob: the letters H and i, then two zero bytes. The letter H is code 72, the letter i is code 105.

{
  "length": 4,
  "bytes": [ 72, 105, 0, 0 ]
}
The bytes in hex are 0x48, 0x69, 0x00, 0x00. Byte 0 holds 72, the letter H; byte 1 holds 105, the letter i; bytes 2 and 3 are zero.