Writes a value to the BinaryWriter as a value with the specified size.
Namespace: SharpAssembler.CoreAssembly: SharpAssembler Core (in SharpAssembler Core.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C# |
---|
public static int Write( this BinaryWriter writer, uint value, DataSize size ) |
Visual Basic |
---|
<ExtensionAttribute> _ Public Shared Function Write ( _ writer As BinaryWriter, _ value As UInteger, _ size As DataSize _ ) As Integer |
Visual C++ |
---|
[ExtensionAttribute] public: static int Write( BinaryWriter^ writer, unsigned int value, DataSize size ) |
Parameters
- writer
- Type: System.IO..::..BinaryWriter
The BinaryWriter to write to.
- value
- Type: System..::..UInt32
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
Exceptions
Exception | Condition |
---|---|
System..::..ArgumentNullException | writer == null |
System.ComponentModel..::..InvalidEnumArgumentException | !(Enum.IsDefined(typeof(DataSize), size)) |
System..::..ArgumentException | size == DataSize.None |
Contracts
Requires | ||
---|---|---|
writer != null
| ||
Enum.IsDefined(typeof(DataSize), size) | ||
size != DataSize.None
|
Ensures |
---|
Contract.Result<int>() >= 0 |