UnmanagedMemoryAccessor.Write UnmanagedMemoryAccessor.Write UnmanagedMemoryAccessor.Write UnmanagedMemoryAccessor.Write Method

Definition

Writes a value into the accessor.

Overloads

Write(Int64, UInt64) Write(Int64, UInt64) Write(Int64, UInt64) Write(Int64, UInt64)

Writes an unsigned 64-bit integer into the accessor.

Write(Int64, UInt32) Write(Int64, UInt32) Write(Int64, UInt32) Write(Int64, UInt32)

Writes an unsigned 32-bit integer into the accessor.

Write(Int64, UInt16) Write(Int64, UInt16) Write(Int64, UInt16) Write(Int64, UInt16)

Writes an unsigned 16-bit integer into the accessor.

Write(Int64, Single) Write(Int64, Single) Write(Int64, Single) Write(Int64, Single)

Writes a Single into the accessor.

Write(Int64, SByte) Write(Int64, SByte) Write(Int64, SByte) Write(Int64, SByte)

Writes an 8-bit integer into the accessor.

Write(Int64, Int64) Write(Int64, Int64) Write(Int64, Int64) Write(Int64, Int64)

Writes a 64-bit integer into the accessor.

Write(Int64, Double) Write(Int64, Double) Write(Int64, Double) Write(Int64, Double)

Writes a Double value into the accessor.

Write(Int64, Int16) Write(Int64, Int16) Write(Int64, Int16) Write(Int64, Int16)

Writes a 16-bit integer into the accessor.

Write(Int64, Decimal) Write(Int64, Decimal) Write(Int64, Decimal) Write(Int64, Decimal)

Writes a decimal value into the accessor.

Write(Int64, Char) Write(Int64, Char) Write(Int64, Char) Write(Int64, Char)

Writes a character into the accessor.

Write(Int64, Byte) Write(Int64, Byte) Write(Int64, Byte) Write(Int64, Byte)

Writes a byte value into the accessor.

Write(Int64, Boolean) Write(Int64, Boolean) Write(Int64, Boolean) Write(Int64, Boolean)

Writes a Boolean value into the accessor.

Write(Int64, Int32) Write(Int64, Int32) Write(Int64, Int32) Write(Int64, Int32)

Writes a 32-bit integer into the accessor.

Write<T>(Int64, T) Write<T>(Int64, T) Write<T>(Int64, T) Write<T>(Int64, T)

Writes a structure into the accessor.

Write(Int64, UInt64) Write(Int64, UInt64) Write(Int64, UInt64) Write(Int64, UInt64)

Important

This API is not CLS-compliant.

CLS-compliant alternative
System.Decimal

Writes an unsigned 64-bit integer into the accessor.

public:
 void Write(long position, System::UInt64 value);
[System.CLSCompliant(false)]
public void Write (long position, ulong value);
member this.Write : int64 * uint64 -> unit
Public Sub Write (position As Long, value As ULong)

Parameters

position
Int64 Int64 Int64 Int64

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

value
UInt64 UInt64 UInt64 UInt64

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.

Write(Int64, UInt32) Write(Int64, UInt32) Write(Int64, UInt32) Write(Int64, UInt32)

Important

This API is not CLS-compliant.

CLS-compliant alternative
System.Int64

Writes an unsigned 32-bit integer into the accessor.

public:
 void Write(long position, System::UInt32 value);
[System.CLSCompliant(false)]
public void Write (long position, uint value);
member this.Write : int64 * uint32 -> unit
Public Sub Write (position As Long, value As UInteger)

Parameters

position
Int64 Int64 Int64 Int64

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

value
UInt32 UInt32 UInt32 UInt32

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.

Write(Int64, UInt16) Write(Int64, UInt16) Write(Int64, UInt16) Write(Int64, UInt16)

Important

This API is not CLS-compliant.

CLS-compliant alternative
System.Int32

Writes an unsigned 16-bit integer into the accessor.

public:
 void Write(long position, System::UInt16 value);
[System.CLSCompliant(false)]
public void Write (long position, ushort value);
member this.Write : int64 * uint16 -> unit
Public Sub Write (position As Long, value As UShort)

Parameters

position
Int64 Int64 Int64 Int64

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

value
UInt16 UInt16 UInt16 UInt16

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.

Write(Int64, Single) Write(Int64, Single) Write(Int64, Single) Write(Int64, Single)

Writes a Single into the accessor.

public:
 void Write(long position, float value);
public void Write (long position, float value);
member this.Write : int64 * single -> unit
Public Sub Write (position As Long, value As Single)

Parameters

position
Int64 Int64 Int64 Int64

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

value
Single Single Single 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.

Write(Int64, SByte) Write(Int64, SByte) Write(Int64, SByte) Write(Int64, SByte)

Important

This API is not CLS-compliant.

CLS-compliant alternative
System.Int16

Writes an 8-bit integer into the accessor.

public:
 void Write(long position, System::SByte value);
[System.CLSCompliant(false)]
public void Write (long position, sbyte value);
member this.Write : int64 * sbyte -> unit
Public Sub Write (position As Long, value As SByte)

Parameters

position
Int64 Int64 Int64 Int64

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

value
SByte SByte SByte SByte

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.

Write(Int64, Int64) Write(Int64, Int64) Write(Int64, Int64) Write(Int64, Int64)

Writes a 64-bit integer into the accessor.

public:
 void Write(long position, long value);
public void Write (long position, long value);
member this.Write : int64 * int64 -> unit
Public Sub Write (position As Long, value As Long)

Parameters

position
Int64 Int64 Int64 Int64

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

value
Int64 Int64 Int64 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.

Write(Int64, Double) Write(Int64, Double) Write(Int64, Double) Write(Int64, Double)

Writes a Double value into the accessor.

public:
 void Write(long position, double value);
public void Write (long position, double value);
member this.Write : int64 * double -> unit
Public Sub Write (position As Long, value As Double)

Parameters

position
Int64 Int64 Int64 Int64

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

value
Double Double Double 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.

Write(Int64, Int16) Write(Int64, Int16) Write(Int64, Int16) Write(Int64, Int16)

Writes a 16-bit integer into the accessor.

public:
 void Write(long position, short value);
public void Write (long position, short value);
member this.Write : int64 * int16 -> unit
Public Sub Write (position As Long, value As Short)

Parameters

position
Int64 Int64 Int64 Int64

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

value
Int16 Int16 Int16 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.

Write(Int64, Decimal) Write(Int64, Decimal) Write(Int64, Decimal) Write(Int64, Decimal)

Writes a decimal value into the accessor.

public:
 void Write(long position, System::Decimal value);
public void Write (long position, decimal value);
member this.Write : int64 * decimal -> unit
Public Sub Write (position As Long, value As Decimal)

Parameters

position
Int64 Int64 Int64 Int64

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

value
Decimal Decimal Decimal 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.

Write(Int64, Char) Write(Int64, Char) Write(Int64, Char) Write(Int64, Char)

Writes a character into the accessor.

public:
 void Write(long position, char value);
public void Write (long position, char value);
member this.Write : int64 * char -> unit
Public Sub Write (position As Long, value As Char)

Parameters

position
Int64 Int64 Int64 Int64

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

value
Char Char Char 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.

Write(Int64, Byte) Write(Int64, Byte) Write(Int64, Byte) Write(Int64, Byte)

Writes a byte value into the accessor.

public:
 void Write(long position, System::Byte value);
public void Write (long position, byte value);
member this.Write : int64 * byte -> unit
Public Sub Write (position As Long, value As Byte)

Parameters

position
Int64 Int64 Int64 Int64

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

value
Byte Byte Byte 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.

Write(Int64, Boolean) Write(Int64, Boolean) Write(Int64, Boolean) Write(Int64, Boolean)

Writes a Boolean value into the accessor.

public:
 void Write(long position, bool value);
public void Write (long position, bool value);
member this.Write : int64 * bool -> unit
Public Sub Write (position As Long, value As Boolean)

Parameters

position
Int64 Int64 Int64 Int64

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

value
Boolean Boolean Boolean 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.

Write(Int64, Int32) Write(Int64, Int32) Write(Int64, Int32) Write(Int64, Int32)

Writes a 32-bit integer into the accessor.

public:
 void Write(long position, int value);
public void Write (long position, int value);
member this.Write : int64 * int -> unit
Public Sub Write (position As Long, value As Integer)

Parameters

position
Int64 Int64 Int64 Int64

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

value
Int32 Int32 Int32 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.

Write<T>(Int64, T) Write<T>(Int64, T) Write<T>(Int64, T) Write<T>(Int64, T)

Writes a structure into the accessor.

public:
generic <typename T>
 where T : value class void Write(long position, T % structure);
[System.Security.SecurityCritical]
public void Write<T> (long position, ref T structure) where T : struct;
member this.Write : int64 *  -> unit (requires 'T : struct)
Public Sub Write(Of T As Structure) (position As Long, ByRef structure As T)

Type Parameters

T

The type of structure.

Parameters

position
Int64 Int64 Int64 Int64

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

structure

The structure to write.

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.

Remarks

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

Security

SecurityCriticalAttribute
requires full trust for the immediate caller. This member cannot be used by partially trusted or transparent code.

Applies to