Minor reformatting

pull/60/head
David Hall 2019-03-26 21:02:27 -07:00
parent 3c40989527
commit 0644bcedfb
1 changed files with 4 additions and 18 deletions

View File

@ -16,20 +16,14 @@ namespace System.IO
{ {
internal bool _isOpen; internal bool _isOpen;
private FileAccess _access; private FileAccess _access;
[SecurityCritical]
[SecurityCritical] // auto-generated
private SafeBuffer _buffer; private SafeBuffer _buffer;
private long _capacity; private long _capacity;
[NonSerialized] [NonSerialized]
private Task<int> _lastReadTask; private Task<int> _lastReadTask;
private long _length; private long _length;
[SecurityCritical] [SecurityCritical]
private unsafe byte* _mem; private unsafe byte* _mem;
private long _offset; private long _offset;
private long _position; private long _position;
@ -168,9 +162,7 @@ namespace System.IO
get get
{ {
if (_buffer != null) if (_buffer != null)
{
throw new NotSupportedException(ResourceHelper.GetString("NotSupported_UmsSafeBuffer")); throw new NotSupportedException(ResourceHelper.GetString("NotSupported_UmsSafeBuffer"));
}
// Use a temp to avoid a race // Use a temp to avoid a race
var pos = Interlocked.Read(ref _position); var pos = Interlocked.Read(ref _position);
@ -185,8 +177,8 @@ namespace System.IO
{ {
if (_buffer != null) if (_buffer != null)
throw new NotSupportedException(ResourceHelper.GetString("NotSupported_UmsSafeBuffer")); throw new NotSupportedException(ResourceHelper.GetString("NotSupported_UmsSafeBuffer"));
if (!_isOpen) ErrorStreamIsClosed(); if (!_isOpen)
ErrorStreamIsClosed();
if (value < _mem) if (value < _mem)
throw new IOException(ResourceHelper.GetString("IO.IO_SeekBeforeBegin")); throw new IOException(ResourceHelper.GetString("IO.IO_SeekBeforeBegin"));
@ -197,13 +189,7 @@ namespace System.IO
internal unsafe byte* Pointer internal unsafe byte* Pointer
{ {
[SecurityCritical] [SecurityCritical]
get get => _buffer == null ? _mem : throw new NotSupportedException(ResourceHelper.GetString("NotSupported_UmsSafeBuffer"));
{
if (_buffer != null)
throw new NotSupportedException(ResourceHelper.GetString("NotSupported_UmsSafeBuffer"));
return _mem;
}
} }
/// <summary>Clears all buffers for this stream and causes any buffered data to be written to the underlying device.</summary> /// <summary>Clears all buffers for this stream and causes any buffered data to be written to the underlying device.</summary>