public void Store(BuildKey builder, IDependencyFingerprint fingerprint, IEnumerable<TargetRelativePath> outputs, IFileSystemDirectory targetRoot)
{
MemoryCacheItem item = GetOrCreate(builder);
var map = new ConcurrentDictionary<TargetRelativePath, byte[]>();
Parallel.ForEach(outputs, outputPath =>
{
if (targetRoot.Exists(outputPath))
{
using (var stream = targetRoot.ReadBinaryFile(outputPath))
{
var buf = new byte[stream.Length];
stream.Read(buf, 0, buf.Length);
map.TryAdd(outputPath, buf);
}
}
else
{
map.TryAdd(outputPath, null);
}
});
item.Update(fingerprint, map);
}