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

◆ ValidateInput()

static void System.IO.RandomAccess.ValidateInput ( SafeFileHandle handle,
long fileOffset )
inlinestaticprivate

Definition at line 169 of file RandomAccess.cs.

170 {
171 if (handle == null)
172 {
173 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.handle);
174 }
175 else if (handle.IsInvalid)
176 {
177 ThrowHelper.ThrowArgumentException_InvalidHandle("handle");
178 }
179 else if (!handle.CanSeek)
180 {
181 if (handle.IsClosed)
182 {
183 ThrowHelper.ThrowObjectDisposedException_FileClosed();
184 }
185 ThrowHelper.ThrowNotSupportedException_UnseekableStream();
186 }
187 else if (fileOffset < 0)
188 {
189 ThrowHelper.ThrowArgumentOutOfRangeException_NeedNonNegNum("fileOffset");
190 }
191 }
static Memory< byte > long fileOffset

References System.IO.RandomAccess.fileOffset, System.handle, System.ThrowHelper.ThrowArgumentException_InvalidHandle(), System.ThrowHelper.ThrowArgumentNullException(), System.ThrowHelper.ThrowArgumentOutOfRangeException_NeedNonNegNum(), System.ThrowHelper.ThrowNotSupportedException_UnseekableStream(), and System.ThrowHelper.ThrowObjectDisposedException_FileClosed().

Referenced by System.IO.RandomAccess.GetLength(), System.IO.RandomAccess.Read(), System.IO.RandomAccess.Read(), System.IO.RandomAccess.ReadAsync(), System.IO.RandomAccess.ReadAsync(), System.IO.RandomAccess.Write(), System.IO.RandomAccess.Write(), System.IO.RandomAccess.WriteAsync(), and System.IO.RandomAccess.WriteAsync().