composeStructure static method
DC
composeStructure(
- Structure value,
- DistributedConnection connection, [
- bool includeKeys = true,
- bool includeTypes = true,
- bool prependLength = false,
Implementation
static DC composeStructure(Structure value, DistributedConnection connection,
[bool includeKeys = true,
bool includeTypes = true,
bool prependLength = false]) {
var rt = new BinaryList();
if (includeKeys) {
for (var k in value.keys) {
var key = DC.stringToBytes(k);
rt
..addUint8(key.length)
..addDC(key)
..addDC(compose(value[k], connection));
}
} else {
for (var k in value.keys)
rt.addDC(compose(value[k], connection, includeTypes));
}
if (prependLength) rt.insertInt32(0, rt.length);
return rt.toDC(); //.toArray();
}