diff --git a/src/Foundatio/Storage/InMemoryFileStorage.cs b/src/Foundatio/Storage/InMemoryFileStorage.cs index 26290b71..ab1a3aa3 100644 --- a/src/Foundatio/Storage/InMemoryFileStorage.cs +++ b/src/Foundatio/Storage/InMemoryFileStorage.cs @@ -65,7 +65,7 @@ public Task GetFileStreamAsync(string path, StreamMode streamMode, Cance var actionableStream = new ActionableStream(stream, () => { stream.Position = 0; - var 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()}.");