Click or drag to resize

ConversionsToStructureT Method

Converts a byte array into a structure.

Namespace:  ShellBoost.Core.Utilities
Assembly:  ShellBoost.Core (in ShellBoost.Core.dll) Version: 1.8.3.0
Syntax
C#
public static T ToStructure<T>(
	this byte[] bytes,
	int offset = 0,
	bool throwOnError = true
)
where T : struct, new()

Parameters

bytes
Type: SystemByte
The bytes input.
offset (Optional)
Type: SystemInt32
The offset.
throwOnError (Optional)
Type: SystemBoolean
if set to true errors may be throw.

Type Parameters

T
The structure type.

Return Value

Type: T
A structure marshaled from the bytes.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type . When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions
ExceptionCondition
ArgumentNullExceptionbytes is null.
See Also