diff options
Diffstat (limited to 'Emby.Server.Implementations/IO/ThrottledStream.cs')
| -rw-r--r-- | Emby.Server.Implementations/IO/ThrottledStream.cs | 59 |
1 files changed, 10 insertions, 49 deletions
diff --git a/Emby.Server.Implementations/IO/ThrottledStream.cs b/Emby.Server.Implementations/IO/ThrottledStream.cs index 81760b639..3635ee1db 100644 --- a/Emby.Server.Implementations/IO/ThrottledStream.cs +++ b/Emby.Server.Implementations/IO/ThrottledStream.cs @@ -42,13 +42,7 @@ namespace Emby.Server.Implementations.IO /// Gets the current milliseconds. /// </summary> /// <value>The current milliseconds.</value> - protected long CurrentMilliseconds - { - get - { - return Environment.TickCount; - } - } + protected long CurrentMilliseconds => Environment.TickCount; /// <summary> /// Gets or sets the maximum bytes per second that can be transferred through the base stream. @@ -56,10 +50,7 @@ namespace Emby.Server.Implementations.IO /// <value>The maximum bytes per second.</value> public long MaximumBytesPerSecond { - get - { - return _maximumBytesPerSecond; - } + get => _maximumBytesPerSecond; set { if (MaximumBytesPerSecond != value) @@ -74,39 +65,21 @@ namespace Emby.Server.Implementations.IO /// Gets a value indicating whether the current stream supports reading. /// </summary> /// <returns>true if the stream supports reading; otherwise, false.</returns> - public override bool CanRead - { - get - { - return _baseStream.CanRead; - } - } + public override bool CanRead => _baseStream.CanRead; /// <summary> /// Gets a value indicating whether the current stream supports seeking. /// </summary> /// <value></value> /// <returns>true if the stream supports seeking; otherwise, false.</returns> - public override bool CanSeek - { - get - { - return _baseStream.CanSeek; - } - } + public override bool CanSeek => _baseStream.CanSeek; /// <summary> /// Gets a value indicating whether the current stream supports writing. /// </summary> /// <value></value> /// <returns>true if the stream supports writing; otherwise, false.</returns> - public override bool CanWrite - { - get - { - return _baseStream.CanWrite; - } - } + public override bool CanWrite => _baseStream.CanWrite; /// <summary> /// Gets the length in bytes of the stream. @@ -115,13 +88,7 @@ namespace Emby.Server.Implementations.IO /// <returns>A long value representing the length of the stream in bytes.</returns> /// <exception cref="T:System.NotSupportedException">The base stream does not support seeking. </exception> /// <exception cref="T:System.ObjectDisposedException">Methods were called after the stream was closed. </exception> - public override long Length - { - get - { - return _baseStream.Length; - } - } + public override long Length => _baseStream.Length; /// <summary> /// Gets or sets the position within the current stream. @@ -133,14 +100,8 @@ namespace Emby.Server.Implementations.IO /// <exception cref="T:System.ObjectDisposedException">Methods were called after the stream was closed. </exception> public override long Position { - get - { - return _baseStream.Position; - } - set - { - _baseStream.Position = value; - } + get => _baseStream.Position; + set => _baseStream.Position = value; } #endregion @@ -158,12 +119,12 @@ namespace Emby.Server.Implementations.IO { if (baseStream == null) { - throw new ArgumentNullException("baseStream"); + throw new ArgumentNullException(nameof(baseStream)); } if (maximumBytesPerSecond < 0) { - throw new ArgumentOutOfRangeException("maximumBytesPerSecond", + throw new ArgumentOutOfRangeException(nameof(maximumBytesPerSecond), maximumBytesPerSecond, "The maximum number of bytes per second can't be negative."); } |
