Beispiel #1
0
            private async Task WriteOneAssetAsync(ObjectWriter writer, PinnedRemotableDataScope scope, Checksum checksum)
            {
                var remotableData = scope.GetRemotableData(checksum, _source.Token) ?? RemotableData.Null;

                writer.WriteInt32(1);

                checksum.WriteTo(writer);
                writer.WriteInt32((int)remotableData.Kind);

                await remotableData.WriteObjectToAsync(writer, _source.Token).ConfigureAwait(false);
            }
Beispiel #2
0
            private async Task WriteMultipleAssetsAsync(ObjectWriter writer, PinnedRemotableDataScope scope, Checksum[] checksums)
            {
                var remotableDataMap = scope.GetRemotableData(checksums, _source.Token);

                writer.WriteInt32(remotableDataMap.Count);

                foreach (var kv in remotableDataMap)
                {
                    var checksum      = kv.Key;
                    var remotableData = kv.Value;

                    checksum.WriteTo(writer);
                    writer.WriteInt32((int)remotableData.Kind);

                    await remotableData.WriteObjectToAsync(writer, _source.Token).ConfigureAwait(false);
                }
            }