diff --git a/src/Foundatio/Storage/InMemoryFileStorage.cs b/src/Foundatio/Storage/InMemoryFileStorage.cs index c9631177..b744ba54 100644 --- a/src/Foundatio/Storage/InMemoryFileStorage.cs +++ b/src/Foundatio/Storage/InMemoryFileStorage.cs @@ -71,7 +71,7 @@ public async Task GetFileStreamAsync(string path, StreamMode streamMode, // Copied from SaveFileAsync _logger.LogTrace("Saving {Path}", normalizedPath); - byte[] contents = ReadBytes(stream); + byte[] contents = stream.ToArray(); if (contents.Length > MaxFileSize) throw new ArgumentException($"File size {contents.Length.ToFileSizeDisplay()} exceeds the maximum size of {MaxFileSize.ToFileSizeDisplay()}.");