Writes a value to the BinaryWriter as a value with the specified size.

Namespace: SharpAssembler.Core
Assembly: SharpAssembler Core (in SharpAssembler Core.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

C#
public static int Write(
	this BinaryWriter writer,
	ulong value,
	DataSize size
)
Visual Basic
<ExtensionAttribute> _
Public Shared Function Write ( _
	writer As BinaryWriter, _
	value As ULong, _
	size As DataSize _
) As Integer
Visual C++
[ExtensionAttribute]
public:
static int Write(
	BinaryWriter^ writer, 
	unsigned long long value, 
	DataSize size
)

Parameters

writer
Type: System.IO..::..BinaryWriter
The BinaryWriter to write to.
value
Type: System..::..UInt64
The value to write.
size
Type: SharpAssembler.Core..::..DataSize
The size of the value to write.

Return Value

The number of written bytes.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type BinaryWriter. When you use instance method syntax to call this method, omit the first parameter. For more information, see or .

Exceptions

ExceptionCondition
System..::..ArgumentNullExceptionwriter == null
System.ComponentModel..::..InvalidEnumArgumentException!(Enum.IsDefined(typeof(DataSize), size))
System..::..ArgumentExceptionsize == DataSize.None

Contracts

Requires
writer != null
Enum.IsDefined(typeof(DataSize), size)
size != DataSize.None
Ensures
Contract.Result<int>() >= 0

See Also