Methods
read(optionsopt) → {Promise.<Buffer>}
Read the given amount of bytes from the network
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
Properties
|
- Source:
Example
// Assumes SAFEApp interface has been obtained
const asyncFn = async () => {
const readOptions =
{
offset: 0, // starts reading from this byte position
end: null // ends reading at this byte position
};
try {
const iDataReader = await app.immutableData.fetch(iDataAddress)
const data = await iDataReader.read(readOptions)
} catch(err) {
throw err;
}
};
size() → {Promise.<Number>}
The size of the immutable data on the network
- Source:
Example
// Assumes SAFEApp interface has been obtained
const asyncFn = async () => {
try {
const size = await iDataReader.size()
} catch(err) {
throw err;
}
};