UnmanagedMemoryAccessor.Write Method

Definition

Writes a value into the accessor.

Overloads

Write(Int64, UInt64)

Writes an unsigned 64-bit integer into the accessor.

Write(Int64, UInt32)

Writes an unsigned 32-bit integer into the accessor.

Write(Int64, UInt16)

Writes an unsigned 16-bit integer into the accessor.

Write(Int64, Single)

Writes a Single into the accessor.

Write(Int64, SByte)

Writes an 8-bit integer into the accessor.

Write(Int64, Int64)

Writes a 64-bit integer into the accessor.

Write(Int64, Double)

Writes a Double value into the accessor.

Write(Int64, Int16)

Writes a 16-bit integer into the accessor.

Write(Int64, Decimal)

Writes a decimal value into the accessor.

Write(Int64, Char)

Writes a character into the accessor.

Write(Int64, Byte)

Writes a byte value into the accessor.

Write(Int64, Boolean)

Writes a Boolean value into the accessor.

Write(Int64, Int32)

Writes a 32-bit integer into the accessor.

Write<T>(Int64, T)

Writes a structure into the accessor.

Write(Int64, UInt64)

Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs

Important

This API is not CLS-compliant.

CLS-compliant alternative
System.Decimal

Writes an unsigned 64-bit integer into the accessor.

[System.CLSCompliant(false)]
public void Write (long position, ulong value);

Parameters

position
Int64

The number of bytes into the accessor at which to begin writing.

value
UInt64

The value to write.

Attributes

Exceptions

There are not enough bytes after position to write a value.

position is less than zero or greater than the capacity of the accessor.

The accessor does not support writing.

The accessor has been disposed.

Applies to

.NET 9 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1
UWP 10.0

Write(Int64, UInt32)

Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs

Important

This API is not CLS-compliant.

CLS-compliant alternative
System.Int64

Writes an unsigned 32-bit integer into the accessor.

[System.CLSCompliant(false)]
public void Write (long position, uint value);

Parameters

position
Int64

The number of bytes into the accessor at which to begin writing.

value
UInt32

The value to write.

Attributes

Exceptions

There are not enough bytes after position to write a value.

position is less than zero or greater than the capacity of the accessor.

The accessor does not support writing.

The accessor has been disposed.

Applies to

.NET 9 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1
UWP 10.0

Write(Int64, UInt16)

Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs

Important

This API is not CLS-compliant.

CLS-compliant alternative
System.Int32

Writes an unsigned 16-bit integer into the accessor.

[System.CLSCompliant(false)]
public void Write (long position, ushort value);

Parameters

position
Int64

The number of bytes into the accessor at which to begin writing.

value
UInt16

The value to write.

Attributes

Exceptions

There are not enough bytes after position to write a value.

position is less than zero or greater than the capacity of the accessor.

The accessor does not support writing.

The accessor has been disposed.

Applies to

.NET 9 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1
UWP 10.0

Write(Int64, Single)

Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs

Writes a Single into the accessor.

public void Write (long position, float value);

Parameters

position
Int64

The number of bytes into the accessor at which to begin writing.

value
Single

The value to write.

Exceptions

There are not enough bytes after position to write a value.

position is less than zero or greater than the capacity of the accessor.

The accessor does not support writing.

The accessor has been disposed.

Applies to

.NET 9 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1
UWP 10.0

Write(Int64, SByte)

Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs

Important

This API is not CLS-compliant.

CLS-compliant alternative
System.Int16

Writes an 8-bit integer into the accessor.

[System.CLSCompliant(false)]
public void Write (long position, sbyte value);

Parameters

position
Int64

The number of bytes into the accessor at which to begin writing.

value
SByte

The value to write.

Attributes

Exceptions

There are not enough bytes after position to write a value.

position is less than zero or greater than the capacity of the accessor.

The accessor does not support writing.

The accessor has been disposed.

Applies to

.NET 9 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1
UWP 10.0

Write(Int64, Int64)

Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs

Writes a 64-bit integer into the accessor.

public void Write (long position, long value);

Parameters

position
Int64

The number of bytes into the accessor at which to begin writing.

value
Int64

The value to write.

Exceptions

There are not enough bytes after position to write a value.

position is less than zero or greater than the capacity of the accessor.

The accessor does not support writing.

The accessor has been disposed.

Applies to

.NET 9 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1
UWP 10.0

Write(Int64, Double)

Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs

Writes a Double value into the accessor.

public void Write (long position, double value);

Parameters

position
Int64

The number of bytes into the accessor at which to begin writing.

value
Double

The value to write.

Exceptions

There are not enough bytes after position to write a value.

position is less than zero or greater than the capacity of the accessor.

The accessor does not support writing.

The accessor has been disposed.

Applies to

.NET 9 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1
UWP 10.0

Write(Int64, Int16)

Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs

Writes a 16-bit integer into the accessor.

public void Write (long position, short value);

Parameters

position
Int64

The number of bytes into the accessor at which to begin writing.

value
Int16

The value to write.

Exceptions

There are not enough bytes after position to write a value.

position is less than zero or greater than the capacity of the accessor.

The accessor does not support writing.

The accessor has been disposed.

Applies to

.NET 9 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1
UWP 10.0

Write(Int64, Decimal)

Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs

Writes a decimal value into the accessor.

public void Write (long position, decimal value);

Parameters

position
Int64

The number of bytes into the accessor at which to begin writing.

value
Decimal

The value to write.

Exceptions

There are not enough bytes after position to write a value.

-or-

The decimal is invalid.

position is less than zero or greater than the capacity of the accessor.

The accessor does not support writing.

The accessor has been disposed.

Applies to

.NET 9 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1
UWP 10.0

Write(Int64, Char)

Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs

Writes a character into the accessor.

public void Write (long position, char value);

Parameters

position
Int64

The number of bytes into the accessor at which to begin writing.

value
Char

The value to write.

Exceptions

There are not enough bytes after position to write a value.

position is less than zero or greater than the capacity of the accessor.

The accessor does not support writing.

The accessor has been disposed.

Applies to

.NET 9 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1
UWP 10.0

Write(Int64, Byte)

Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs

Writes a byte value into the accessor.

public void Write (long position, byte value);

Parameters

position
Int64

The number of bytes into the accessor at which to begin writing.

value
Byte

The value to write.

Exceptions

There are not enough bytes after position to write a value.

position is less than zero or greater than the capacity of the accessor.

The accessor does not support writing.

The accessor has been disposed.

Applies to

.NET 9 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1
UWP 10.0

Write(Int64, Boolean)

Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs

Writes a Boolean value into the accessor.

public void Write (long position, bool value);

Parameters

position
Int64

The number of bytes into the accessor at which to begin writing.

value
Boolean

The value to write.

Exceptions

There are not enough bytes after position to write a value.

position is less than zero or greater than the capacity of the accessor.

The accessor does not support writing.

The accessor has been disposed.

Applies to

.NET 9 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1
UWP 10.0

Write(Int64, Int32)

Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs

Writes a 32-bit integer into the accessor.

public void Write (long position, int value);

Parameters

position
Int64

The number of bytes into the accessor at which to begin writing.

value
Int32

The value to write.

Exceptions

There are not enough bytes after position to write a value.

position is less than zero or greater than the capacity of the accessor.

The accessor does not support writing.

The accessor has been disposed.

Applies to

.NET 9 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1
UWP 10.0

Write<T>(Int64, T)

Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs
Source:
UnmanagedMemoryAccessor.cs

Writes a structure into the accessor.

public void Write<T> (long position, ref T structure) where T : struct;
[System.Security.SecurityCritical]
public void Write<T> (long position, ref T structure) where T : struct;

Type Parameters

T

The type of structure.

Parameters

position
Int64

The number of bytes into the accessor at which to begin writing.

structure
T

The structure to write.

Attributes

Exceptions

There are not enough bytes in the accessor after position to write a structure of type T.

position is less than zero or greater than the capacity of the accessor.

The accessor does not support writing.

The accessor has been disposed.

Remarks

Use this method to write medium to large structures that are not easily accommodated by the other Write methods in this class.

Applies to

.NET 9 and other versions
Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1