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

◆ SetLength()

unsafe override void System.IO.UnmanagedMemoryStream.SetLength ( long value)
inlineinherited

Definition at line 455 of file UnmanagedMemoryStream.cs.

456 {
457 if (value < 0)
458 {
459 throw new ArgumentOutOfRangeException("value", SR.ArgumentOutOfRange_NeedNonNegNum);
460 }
461 if (_buffer != null)
462 {
463 throw new NotSupportedException(SR.NotSupported_UmsSafeBuffer);
464 }
467 if (value > _capacity)
468 {
469 throw new IOException(SR.IO_FixedCapacity);
470 }
471 long num = Interlocked.Read(ref _position);
472 long num2 = Interlocked.Read(ref _length);
473 if (value > num2)
474 {
475 Buffer.ZeroMemory(_mem + num2, (nuint)(value - num2));
476 }
478 if (num > value)
479 {
481 }
482 }
static int Exchange(ref int location1, int value)
static long Read(ref long location)

References System.IO.UnmanagedMemoryStream._buffer, System.IO.UnmanagedMemoryStream._capacity, System.IO.UnmanagedMemoryStream._length, System.IO.UnmanagedMemoryStream._mem, System.IO.UnmanagedMemoryStream._position, System.SR.ArgumentOutOfRange_NeedNonNegNum, System.IO.UnmanagedMemoryStream.EnsureNotClosed(), System.IO.UnmanagedMemoryStream.EnsureWriteable(), System.Threading.Interlocked.Exchange(), System.SR.IO_FixedCapacity, System.SR.NotSupported_UmsSafeBuffer, System.Threading.Interlocked.Read(), System.value, and System.Buffer.ZeroMemory().