Below are the TypeScript API reference for the Sia serialization library.
Creates a new Sia instance. If content is provided, the Sia instance will be initialized with the provided content.
Name | Description |
---|---|
content | The current content of the Sia instance. |
offset | The current offset of the Sia instance pointer. |
size | The length of the content. |
dataView | The DataView of the Sia instance. |
Name | Description |
---|---|
seek | Changes the offset of the Sia instance pointer. |
skip | Changes the offset of the Sia instance pointer by the given amount. |
setContent | Replaces the content of the Sia instance with the given content. |
embedSia | Adds the content of the provided Sia instance to the current content. |
embedBytes | Adds the provided bytes to the current content. |
addUInt8 | Adds an unsigned 8-bit integer to the current content. |
addUInt16 | Adds an unsigned 16-bit integer to the current content. |
addUInt32 | Adds an unsigned 32-bit integer to the current content. |
addUInt64 | Adds an unsigned 64-bit integer to the current content. |
addInt8 | Adds a signed 8-bit integer to the current content. |
addInt16 | Adds a signed 16-bit integer to the current content. |
addInt32 | Adds a signed 32-bit integer to the current content. |
addInt64 | Adds a signed 64-bit integer to the current content. |
addUtfz | Adds a null-terminated UTF-8 string to the current content. |
addAscii | Adds an ASCII string to the current content. |
addString8 | Adds a string of 8-bit length to the current content. |
addString16 | Adds a string of 16-bit length to the current content. |
addString32 | Adds a string of 32-bit length to the current content. |
addString64 | Adds a string of 64-bit length to the current content. |
addByteArrayN | Adds a byte array of specified length to the current content. |
addByteArray8 | Adds a byte array of 8-bit length to the current content. |
addByteArray16 | Adds a byte array of 16-bit length to the current content. |
addByteArray32 | Adds a byte array of 32-bit length to the current content. |
addByteArray64 | Adds a byte array of 64-bit length to the current content. |
addBool | Adds a boolean value to the current content. |
addBigInt | Adds a BigInt value to the current content. |
addArray8 | Adds an array of items to the current content prefixed with an 8-bit length. The provided function is called for each item to serialize it. |
addArray16 | Adds an array of items to the current content prefixed with a 16-bit length. The provided function is called for each item to serialize it. |
addArray32 | Adds an array of items to the current content prefixed with a 32-bit length. The provided function is called for each item to serialize it. |
addArray64 | Adds an array of items to the current content prefixed with a 64-bit length. The provided function is called for each item to serialize it. |
readUInt8 | Reads an unsigned 8-bit integer from the current position. |
readUInt16 | Reads an unsigned 16-bit integer from the current position. |
readUInt32 | Reads an unsigned 32-bit integer from the current position. |
readUInt64 | Reads an unsigned 64-bit integer from the current position. |
readInt8 | Reads a signed 8-bit integer from the current position. |
readUtfz | Reads a null-terminated UTF-8 string from the current position. |
readAscii | Reads an ASCII string from the current position. |
readString8 | Reads a string of 8-bit length from the current position. |
readString16 | Reads a string of 16-bit length from the current position. |
readString32 | Reads a string of 32-bit length from the current position. |
readString64 | Reads a string of 64-bit length from the current position. |
readByteArrayN | Reads a byte array of specified length from the current position. |
readByteArray8 | Reads a byte array of 8-bit length from the current position. |
readByteArray16 | Reads a byte array of 16-bit length from the current position. |
readByteArray32 | Reads a byte array of 32-bit length from the current position. |
readByteArray64 | Reads a byte array of 64-bit length from the current position. |
readBool | Reads a boolean value from the current position. |
readBigInt | Reads a BigInt value from the current position. |
readArray8 | Reads an array of items from the current position using the 8-bit length prefix. The provided function is called for each item to deserialize it. |
readArray16 | Reads an array of items from the current position using the 16-bit length prefix. The provided function is called for each item to deserialize it. |
readArray32 | Reads an array of items from the current position using the 32-bit length prefix. The provided function is called for each item to deserialize it. |
readArray64 | Reads an array of items from the current position using the 64-bit length prefix. The provided function is called for each item to deserialize it. |
Changes the offset of the Sia instance pointer.
Changes the offset of the Sia instance pointer by the given amount.
Replaces the content of the Sia instance with the given content.
Adds the contents of the provided Sia instance to the current Sia instance.
Adds the provided bytes to the current content.
Adds an unsigned 8-bit integer to the current content.
Adds an unsigned 16-bit integer to the current content.
Adds an unsigned 32-bit integer to the current content.
Adds an unsigned 64-bit integer to the current content.
Adds a signed 8-bit integer to the current content.
Adds a signed 16-bit integer to the current content.
Adds a signed 32-bit integer to the current content.
Adds a signed 64-bit integer to the current content.
Adds a null-terminated UTF-8 string to the current content.
Adds an ASCII string to the current content.
Adds a string of 8 bytes to the current content.
Adds a string of 16 bytes to the current content.
Adds a string of 32 bytes to the current content.
Adds a string of 64 bytes to the current content.
Adds a byte array of specified length to the current content.
Adds a byte array of specified length to the current content.
Adds a byte array of specified length to the current content.
Adds a byte array of specified length to the current content.
Adds a byte array of specified length to the current content.
Adds a boolean value to the current content.
Adds a BigInt value to the current content.
Adds an array of items to the current content, prefixed with an 8-bit length. The provided function is called for each item to serialize it.
Adds an array of items to the current content, prefixed with a 16-bit length. The provided function is called for each item to serialize it.
Adds an array of items to the current content, prefixed with a 32-bit length. The provided function is called for each item to serialize it.
Adds an array of items to the current content, prefixed with a 64-bit length. The provided function is called for each item to serialize it.
Reads an unsigned 8-bit integer from the current position.
Reads an unsigned 16-bit integer from the current position.
Reads an unsigned 32-bit integer from the current position.
Reads an unsigned 64-bit integer from the current position.
Reads a signed 8-bit integer from the current position.
Reads a signed 16-bit integer from the current position.
Reads a signed 32-bit integer from the current position.
Reads a signed 64-bit integer from the current position.
Reads a null-terminated UTF-8 string from the current position.
Reads an ASCII string from the current position.
Reads a string of 8 bytes from the current position.
Reads a string of 16 bytes from the current position.
Reads a string of 32 bytes from the current position.
Reads a string of 64 bytes from the current position.
Reads a byte array of specified length from the current position. If asReference is true, returns a view into the underlying buffer instead of copying the data.
Reads a byte array of specified length from the current position. If asReference is true, returns a view into the underlying buffer instead of copying the data.
Reads a byte array of specified length from the current position. If asReference is true, returns a view into the underlying buffer instead of copying the data.
Reads a byte array of specified length from the current position. If asReference is true, returns a view into the underlying buffer instead of copying the data.
Reads a boolean value from the current position.
Reads a BigInt value from the current position.
Reads an array of items from the current position, using the 8-bit length prefix. The provided function is called for each item to deserialize it.
Reads an array of items from the current position, using the 16-bit length prefix. The provided function is called for each item to deserialize it.
Reads an array of items from the current position, using the 32-bit length prefix. The provided function is called for each item to deserialize it.
Reads an array of items from the current position, using the 64-bit length prefix. The provided function is called for each item to deserialize it.
Pl. de l'Industrie 2, 1180 Rolle, Switzerland