Data
Data
¶
Data represents a block of raw binary data, with an optional structure. This data is built using the provided uri that may either point to an external file, or be a data URI that encodes the binary data directly in the JSON file. When an uri is provided, data will is fetched just in time and stored locally. If no uri has been provided, an empty data is created ex-nihilo, just in time. Data can be modified and is tracked for any modification.
Example
Data represents a block of raw binary data, with an optional structure.
Parameters:
Name | Type | Description | Default | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
uri |
str
|
Uniform Resource Identifier from where to fetch data. |
''
|
||||||||||||||
nbytes |
int
|
Number of bytes in the data. This is used to create data ex-nihilo if no uri has been provided. If a dtype is provided, the nbytes is discarded in favor of the size of the provided structure. |
0
|
||||||||||||||
dtype |
list
|
Description of the internal structure of the data as a
list of ( with:
|
None
|
set_data
¶
Update data content at given offset with new data.
Example
Parameters:
Name | Type | Description | Default |
---|---|---|---|
offset |
int
|
Offset in bytes where to start update |
required |
data |
bytes
|
Content to update with. |
required |