parsePropertyValueArray static method

AsyncBag<PropertyValue> parsePropertyValueArray(
  1. DC data,
  2. int offset,
  3. int length,
  4. DistributedConnection connection,
)
Parse an array of PropertyValue. Array of bytes. Zero-indexed offset. Number of bytes to parse. DistributedConnection is required to fetch resources. Whether property age is represented in the data.

Implementation

static AsyncBag<PropertyValue> parsePropertyValueArray(DC data, int offset,
    int length, DistributedConnection connection) //, bool ageIncluded = true)
{
  //print("parsePropertyValueArray ${offset} ${length}");

  var rt = new AsyncBag<PropertyValue>();

  var sizeObject = new SizeObject();

  while (length > 0) {
    rt.add(parsePropertyValue(data, offset, sizeObject, connection));

    if (sizeObject.size > 0) {
      offset += sizeObject.size;
      length -= sizeObject.size;
    } else
      throw new Exception("Error while parsing ValueInfo structured data");
  }

  rt.seal();
  return rt;
}