parsePropertyValue static method

AsyncReply<PropertyValue> parsePropertyValue(
  1. DC data,
  2. int offset,
  3. SizeObject sizeObject,
  4. DistributedConnection connection,
)
Parse property value. Array of bytes. Zero-indexed offset. DistributedConnection is required to fetch resources. Output content size.

Implementation

static AsyncReply<PropertyValue> parsePropertyValue(DC data, int offset,
    SizeObject sizeObject, DistributedConnection connection) {
  var reply = new AsyncReply<PropertyValue>();

  var age = data.getUint64(offset);
  offset += 8;

  DateTime date = data.getDateTime(offset);
  offset += 8;

  parse(data, offset, connection, sizeObject).then((value) {
    reply.trigger(new PropertyValue(value, age, date));
  });

  sizeObject.size += 16;

  return reply;
}