first commit
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
# ArrayConfigPackingStrategy
|
||||
|
||||
Packs/unpacks arrays described by an explicit configuration object.
|
||||
|
||||
<!-- begin:auto-docs -->
|
||||
_(no submodules)_
|
||||
<!-- end:auto-docs -->
|
||||
|
||||
## Schema shape
|
||||
|
||||
```ts
|
||||
{
|
||||
type: "array",
|
||||
maxLength: number,
|
||||
elementType: "integer" | "float" | "string" | "boolean" | "schema",
|
||||
elementMax?: number, // for integer / float / string
|
||||
elementSchema?: BitPackerSchema // for elementType "schema"
|
||||
}
|
||||
```
|
||||
|
||||
## Behaviour
|
||||
|
||||
- Writes the array length using the minimum bits required for `maxLength`.
|
||||
- Each element is packed according to its `elementType`.
|
||||
- `float` elements are encoded as unsigned integers up to `elementMax`.
|
||||
- `string` elements are encoded as fixed-length byte sequences (padded with null bytes).
|
||||
- `schema` elements are recursively packed via the strategy chain.
|
||||
Reference in New Issue
Block a user