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

◆ Seek()

override long System.IO.UnmanagedMemoryStream.Seek ( long offset,
SeekOrigin loc )
inlineinherited

Definition at line 417 of file UnmanagedMemoryStream.cs.

418 {
420 switch (loc)
421 {
422 case SeekOrigin.Begin:
423 if (offset < 0)
424 {
425 throw new IOException(SR.IO_SeekBeforeBegin);
426 }
428 break;
429 case SeekOrigin.Current:
430 {
431 long num2 = Interlocked.Read(ref _position);
432 if (offset + num2 < 0)
433 {
434 throw new IOException(SR.IO_SeekBeforeBegin);
435 }
437 break;
438 }
439 case SeekOrigin.End:
440 {
441 long num = Interlocked.Read(ref _length);
442 if (num + offset < 0)
443 {
444 throw new IOException(SR.IO_SeekBeforeBegin);
445 }
447 break;
448 }
449 default:
450 throw new ArgumentException(SR.Argument_InvalidSeekOrigin);
451 }
452 return Interlocked.Read(ref _position);
453 }
static int Exchange(ref int location1, int value)
static long Read(ref long location)

References System.IO.UnmanagedMemoryStream._length, System.IO.UnmanagedMemoryStream._position, System.SR.Argument_InvalidSeekOrigin, System.IO.UnmanagedMemoryStream.EnsureNotClosed(), System.Threading.Interlocked.Exchange(), System.SR.IO_SeekBeforeBegin, System.offset, and System.Threading.Interlocked.Read().

Referenced by System.Resources.ResourceReader._ReadResources(), System.Resources.ResourceReader.CompareStringEqualsName(), and System.IO.UnmanagedMemoryStreamWrapper.Seek().