Editare

Partajați prin


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.

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

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

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.

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

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

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.

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

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

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);
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

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

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.

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

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

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);
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

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

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);
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

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

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);
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

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

Write(Int64, Decimal)

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

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

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

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);
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

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

Write(Int64, Byte)

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

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

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

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);
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

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

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);
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

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

Write<T>(Int64, T)

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

Writes a structure into the accessor.

public:
generic <typename T>
 where T : value class void Write(long position, T % structure);
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;
member this.Write : int64 * 'T -> unit (requires 'T : struct)
[<System.Security.SecurityCritical>]
member this.Write : int64 * 'T -> 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

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