Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Review tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
marek-safar committed May 30, 2018
1 parent d5f16a2 commit 78fbc8e
Showing 1 changed file with 12 additions and 39 deletions.
51 changes: 12 additions & 39 deletions src/System.Private.CoreLib/shared/System/IO/Stream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public abstract partial class Stream : MarshalByRefObject, IDisposable
//We pick a value that is the largest multiple of 4096 that is still smaller than the large object heap threshold (85K).
// The CopyTo/CopyToAsync buffer is short-lived and is likely to be collected at Gen0, and it offers a significant
// improvement in Copy performance.
private const int _DefaultCopyBufferSize = 81920;
private const int DefaultCopyBufferSize = 81920;

// To implement Async IO operations on streams that don't support async IO

Expand Down Expand Up @@ -184,7 +184,7 @@ public virtual void CopyTo(Stream destination, int bufferSize)

private int GetCopyBufferSize()
{
int bufferSize = _DefaultCopyBufferSize;
int bufferSize = DefaultCopyBufferSize;

if (CanSeek)
{
Expand Down Expand Up @@ -871,25 +871,13 @@ private sealed class NullStream : Stream
{
internal NullStream() { }

public override bool CanRead
{
get { return true; }
}
public override bool CanRead => true;

public override bool CanWrite
{
get { return true; }
}
public override bool CanWrite => true;

public override bool CanSeek
{
get { return true; }
}
public override bool CanSeek => true;

public override long Length
{
get { return 0; }
}
public override long Length => 0;

public override long Position
{
Expand Down Expand Up @@ -1024,7 +1012,7 @@ public override void SetLength(long length)


/// <summary>Used as the IAsyncResult object when using asynchronous IO methods on the base Stream class.</summary>
internal sealed class SynchronousAsyncResult : IAsyncResult
private sealed class SynchronousAsyncResult : IAsyncResult
{
private readonly Object _stateObject;
private readonly bool _isWrite;
Expand Down Expand Up @@ -1117,7 +1105,7 @@ internal static void EndWrite(IAsyncResult asyncResult)

// SyncStream is a wrapper around a stream that takes
// a lock for every operation making it thread safe.
internal sealed class SyncStream : Stream, IDisposable
private sealed class SyncStream : Stream, IDisposable
{
private Stream _stream;

Expand All @@ -1128,28 +1116,13 @@ internal SyncStream(Stream stream)
_stream = stream;
}

public override bool CanRead
{
get { return _stream.CanRead; }
}
public override bool CanRead => _stream.CanRead;

public override bool CanWrite
{
get { return _stream.CanWrite; }
}
public override bool CanWrite => _stream.CanWrite;

public override bool CanSeek
{
get { return _stream.CanSeek; }
}
public override bool CanSeek => _stream.CanSeek;

public override bool CanTimeout
{
get
{
return _stream.CanTimeout;
}
}
public override bool CanTimeout => _stream.CanTimeout;

public override long Length
{
Expand Down

0 comments on commit 78fbc8e

Please sign in to comment.