ISupportBinaryImageExtensionsBinaryImageAsync Method

Asynchronously returns a binary image of an object that implements ISupportBinaryImage.

Definition

Namespace: Gemstone.IO.Parsing
Assembly: Gemstone.Common (in Gemstone.Common.dll) Version: 1.0.141 -- Release Build+8fc1477299d57116e2a4f3cb8dfe059f814b239b
public static Task<byte[]> BinaryImageAsync(
	this ISupportBinaryImage imageSource,
	bool clearArray = false,
	CancellationToken cancellationToken = default
)

Parameters

imageSource  ISupportBinaryImage
The ISupportBinaryImage source from which the binary image is generated.
clearArray  Boolean  (Optional)
Clears any rented buffers of their contents so that a subsequent consumer will not see the previous consumer's content. If false, default, the array's contents are left unchanged.
cancellationToken  CancellationToken  (Optional)
A token to monitor for cancellation requests.

Return Value

TaskByte
A task that represents the asynchronous operation. The task result contains the binary image of the object.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type ISupportBinaryImage. 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).

Remarks

This method provides an asynchronous alternative to BinaryImage(ISupportBinaryImage, Boolean). It is often optimal to use GenerateBinaryImage(Byte, Int32) directly with a common buffer instead of always allocating new buffers.

Exceptions

ArgumentNullExceptionThrown when imageSource is null.

See Also