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

◆ WriteArray< T >()

void System.IO.UnmanagedMemoryAccessor.WriteArray< T > ( long position,
T[] array,
int offset,
int count )
inlineinherited
Type Constraints
T :struct 

Definition at line 520 of file UnmanagedMemoryAccessor.cs.

520 : struct
521 {
522 if (array == null)
523 {
524 throw new ArgumentNullException("array", SR.ArgumentNull_Buffer);
525 }
526 if (offset < 0)
527 {
528 throw new ArgumentOutOfRangeException("offset", SR.ArgumentOutOfRange_NeedNonNegNum);
529 }
530 if (count < 0)
531 {
532 throw new ArgumentOutOfRangeException("count", SR.ArgumentOutOfRange_NeedNonNegNum);
533 }
534 if (array.Length - offset < count)
535 {
536 throw new ArgumentException(SR.Argument_InvalidOffLen);
537 }
538 if (position < 0)
539 {
540 throw new ArgumentOutOfRangeException("position", SR.ArgumentOutOfRange_NeedNonNegNum);
541 }
542 if (position >= Capacity)
543 {
544 throw new ArgumentOutOfRangeException("position", SR.ArgumentOutOfRange_PositionLessThanCapacityRequired);
545 }
546 if (!_isOpen)
547 {
548 throw new ObjectDisposedException("UnmanagedMemoryAccessor", SR.ObjectDisposed_ViewAccessorClosed);
549 }
550 if (!_canWrite)
551 {
552 throw new NotSupportedException(SR.NotSupported_Writing);
553 }
554 _buffer.WriteArray((ulong)(_offset + position), array, offset, count);
555 }

References System.IO.UnmanagedMemoryAccessor._buffer, System.IO.UnmanagedMemoryAccessor._canWrite, System.IO.UnmanagedMemoryAccessor._isOpen, System.IO.UnmanagedMemoryAccessor._offset, System.SR.Argument_InvalidOffLen, System.SR.ArgumentNull_Buffer, System.SR.ArgumentOutOfRange_NeedNonNegNum, System.SR.ArgumentOutOfRange_PositionLessThanCapacityRequired, System.array, System.IO.UnmanagedMemoryAccessor.Capacity, System.count, System.SR.NotSupported_Writing, System.SR.ObjectDisposed_ViewAccessorClosed, and System.offset.