Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ValidateHandle() [1/2]

static void System.IO.FileStream.ValidateHandle ( SafeFileHandle handle,
FileAccess access,
int bufferSize )
inlinestaticprivateinherited

Definition at line 107 of file FileStream.cs.

108 {
109 if (handle.IsInvalid)
110 {
111 throw new ArgumentException(SR.Arg_InvalidHandle, "handle");
112 }
113 if (access < FileAccess.Read || access > FileAccess.ReadWrite)
114 {
115 throw new ArgumentOutOfRangeException("access", SR.ArgumentOutOfRange_Enum);
116 }
117 if (bufferSize < 0)
118 {
119 ThrowHelper.ThrowArgumentOutOfRangeException_NeedNonNegNum("bufferSize");
120 }
121 else if (handle.IsClosed)
122 {
123 ThrowHelper.ThrowObjectDisposedException_FileClosed();
124 }
125 }

References System.SR.Arg_InvalidHandle, System.SR.ArgumentOutOfRange_Enum, System.handle, System.ThrowHelper.ThrowArgumentOutOfRangeException_NeedNonNegNum(), and System.ThrowHelper.ThrowObjectDisposedException_FileClosed().

Referenced by System.IO.FileStream.FileStream(), System.IO.FileStream.FileStream(), System.IO.FileStream.FileStream(), and System.IO.FileStream.ValidateHandle().