After serialising the wrapped type, advance the cursor by offset bytes interpreted via the chosen strategy.
Since the offset is applied after the wrapped type runs, this node is useful to move the cursor around once the wrapped type has been processed. See preOffsetTypeNode for the opposite behaviour.
The strategies below are illustrated against the following buffer: the 99 byte represents the encoded value of the wrapped type and the FF byte represents the next bytes to be encoded after it, in order to show the post cursor position.
relative — the cursor is moved to the right by the provided offset. A negative offset moves it to the left instead.
offset = 2 0x000000990000FF00; └-- Post-offset
offset = -2 0x0000FF9900000000; └-- Post-offset
absolute — the cursor is moved to an absolute position in the buffer. A negative offset moves it backwards from the end of the buffer.
offset = 0 0xFF00009900000000; └-- Post-offset
offset = -2 0x000000990000FF00; └-- Post-offset
padded — the cursor is moved to the right by the provided offset and the buffer size is increased by the offset amount, allowing padding bytes to be added. Reciprocally, a negative offset moves the cursor to the left and decreases the buffer size.
preOffset — the cursor is moved to the right of the pre-offset — i.e. where the wrapped type started — by the provided offset. A negative offset moves it to the left of the pre-offset instead.
Some type nodes affect the buffer that is available to us: depending on where we are in the type tree, we may not have access to the entire buffer.
For instance, inside a fixedSizeTypeNode, the buffer is truncated or padded to match the provided fixed size once the wrapped content has been serialised — we are essentially "boxed" into a sub-buffer, and that sub-buffer is the one affected by the absolute strategy.
The type nodes that create sub-buffers are: fixedSizeTypeNode, sentinelTypeNode, and sizePrefixTypeNode.
After serialising the wrapped type, advance the cursor by
offsetbytes interpreted via the chosen strategy.Since the offset is applied after the wrapped type runs, this node is useful to move the cursor around once the wrapped type has been processed. See
preOffsetTypeNodefor the opposite behaviour.The strategies below are illustrated against the following buffer: the
99byte represents the encoded value of the wrapped type and theFFbyte represents the next bytes to be encoded after it, in order to show the post cursor position.relative— the cursor is moved to the right by the provided offset. A negative offset moves it to the left instead.absolute— the cursor is moved to an absolute position in the buffer. A negative offset moves it backwards from the end of the buffer.padded— the cursor is moved to the right by the provided offset and the buffer size is increased by the offset amount, allowing padding bytes to be added. Reciprocally, a negative offset moves the cursor to the left and decreases the buffer size.preOffset— the cursor is moved to the right of the pre-offset — i.e. where the wrapped type started — by the provided offset. A negative offset moves it to the left of the pre-offset instead.Some type nodes affect the buffer that is available to us: depending on where we are in the type tree, we may not have access to the entire buffer. For instance, inside a
fixedSizeTypeNode, the buffer is truncated or padded to match the provided fixed size once the wrapped content has been serialised — we are essentially "boxed" into a sub-buffer, and that sub-buffer is the one affected by theabsolutestrategy. The type nodes that create sub-buffers are:fixedSizeTypeNode,sentinelTypeNode, andsizePrefixTypeNode.