Browse Source

fix comments

pull/2301/head
Anton Firszov 4 years ago
parent
commit
d1c76e271a
  1. 6
      tests/ImageSharp.Tests/TestUtilities/PausedMemoryStream.cs
  2. 4
      tests/ImageSharp.Tests/TestUtilities/PausedStream.cs

6
tests/ImageSharp.Tests/TestUtilities/PausedMemoryStream.cs

@ -87,7 +87,7 @@ public class PausedMemoryStream : MemoryStream, IPausedStream
public override async Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken)
{
// To make sure the copy operation is buffered and pausable, we should override MemoryStream's strategy
// with the default Stream copy logic based of System.IO.Stream:
// with the default Stream copy logic of System.IO.Stream:
// https://github.com/dotnet/runtime/blob/4f53c2f7e62df44f07cf410df8a0d439f42a0a71/src/libraries/System.Private.CoreLib/src/System/IO/Stream.cs#L104-L116
byte[] buffer = ArrayPool<byte>.Shared.Rent(bufferSize);
try
@ -110,10 +110,6 @@ public class PausedMemoryStream : MemoryStream, IPausedStream
public override bool CanWrite => base.CanWrite;
//public override long Length => this.Await(() => base.Length);
//public override long Position { get => this.Await(() => base.Position); set => this.Await(() => base.Position = value); }
public override void Flush() => this.Await(() => base.Flush());
public override int Read(byte[] buffer, int offset, int count) => this.Await(() => base.Read(buffer, offset, count));

4
tests/ImageSharp.Tests/TestUtilities/PausedStream.cs

@ -89,8 +89,8 @@ public class PausedStream : Stream, IPausedStream
public override async Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken)
{
// To make sure the copy operation is buffered and pausable, we should override innerStream's strategy
// with the default Stream copy logic based from System.IO.Stream:
// To make sure the copy operation is buffered and pausable, we should override MemoryStream's strategy
// with the default Stream copy logic of System.IO.Stream:
// https://github.com/dotnet/runtime/blob/4f53c2f7e62df44f07cf410df8a0d439f42a0a71/src/libraries/System.Private.CoreLib/src/System/IO/Stream.cs#L104-L116
byte[] buffer = ArrayPool<byte>.Shared.Rent(bufferSize);
try

Loading…
Cancel
Save