diff --git a/MediaBrowser.Common.Implementations/IO/CommonFileSystem.cs b/MediaBrowser.Common.Implementations/IO/CommonFileSystem.cs index ea4a61e25a..e9ef846634 100644 --- a/MediaBrowser.Common.Implementations/IO/CommonFileSystem.cs +++ b/MediaBrowser.Common.Implementations/IO/CommonFileSystem.cs @@ -234,10 +234,10 @@ namespace MediaBrowser.Common.Implementations.IO { if (_supportsAsyncFileStreams && isAsync) { - return new FileStream(path, mode, access, share, 4096, true); + return new FileStream(path, mode, access, share, StreamDefaults.DefaultFileStreamBufferSize, true); } - return new FileStream(path, mode, access, share); + return new FileStream(path, mode, access, share, StreamDefaults.DefaultFileStreamBufferSize); } /// diff --git a/MediaBrowser.Common.Implementations/Serialization/JsonSerializer.cs b/MediaBrowser.Common.Implementations/Serialization/JsonSerializer.cs index b49551ea99..f194b334a8 100644 --- a/MediaBrowser.Common.Implementations/Serialization/JsonSerializer.cs +++ b/MediaBrowser.Common.Implementations/Serialization/JsonSerializer.cs @@ -61,7 +61,7 @@ namespace MediaBrowser.Common.Implementations.Serialization private Stream OpenFile(string path) { - return new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read); + return new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read, 131072); } /// diff --git a/MediaBrowser.Common/IO/StreamDefaults.cs b/MediaBrowser.Common/IO/StreamDefaults.cs index 0cbf1643fb..450d293d4b 100644 --- a/MediaBrowser.Common/IO/StreamDefaults.cs +++ b/MediaBrowser.Common/IO/StreamDefaults.cs @@ -9,11 +9,11 @@ namespace MediaBrowser.Common.IO /// /// The default copy to buffer size /// - public const int DefaultCopyToBufferSize = 81920; + public const int DefaultCopyToBufferSize = 262144; /// /// The default file stream buffer size /// - public const int DefaultFileStreamBufferSize = 4096; + public const int DefaultFileStreamBufferSize = 262144; } } diff --git a/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs b/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs index da37cfa8bf..961d58eb6e 100644 --- a/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs +++ b/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs @@ -335,7 +335,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer /// Stream. private Stream GetFileStream(string path, FileShare fileShare) { - return _fileSystem.GetFileStream(path, FileMode.Open, FileAccess.Read, fileShare, true); + return _fileSystem.GetFileStream(path, FileMode.Open, FileAccess.Read, fileShare); } public object GetStaticResult(IRequest requestContext,