Gemstone Common Library
Show/Hide TOC

# ISupportBinaryImageExtensionsParseBinaryImageFromStream Method

Parses a binary image from the specified Stream into an object that implements ISupportBinaryImage.

## Definition

Namespace: Gemstone.IO.Parsing
Assembly: Gemstone.Common (in Gemstone.Common.dll) Version: 1.0.160 -- Release Build+19b74ac03cedad8575bb1ceb00051318b7421d0d
C#
View Source Request Example

    public static int ParseBinaryImageFromStream(
    	this ISupportBinaryImage imageSource,
    	Stream stream,
    	bool clearArray = false
    )

VB
View Source Request Example

    <ExtensionAttribute>
    Public Shared Function ParseBinaryImageFromStream (
    	imageSource As ISupportBinaryImage,
    	stream As Stream,
    	Optional clearArray As Boolean = false
    ) As Integer

C++
View Source Request Example

    public:
    [ExtensionAttribute]
    static int ParseBinaryImageFromStream(
    	ISupportBinaryImage^ imageSource,
    	Stream^ stream,
    	bool clearArray = false
    )

JavaScript
View Source Request Example

    Gemstone.IO.Parsing.ISupportBinaryImageExtensions.ParseBinaryImageFromStream = function(imageSource, stream, clearArray);

#### Parameters

imageSource ISupportBinaryImage
  The ISupportBinaryImage instance into which the binary image will be parsed.
stream Stream
  The Stream from which the binary image will be read.
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.

#### Return Value

Int32
The number of bytes successfully read and parsed from the stream.

#### 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 reads a binary image from the provided Stream and parses it into the specified ISupportBinaryImage instance. It uses a shared buffer pool to minimize memory allocations.

## Exceptions

ArgumentNullException | Thrown if imageSource or stream is null.

## See Also

#### Reference

ISupportBinaryImageExtensions Class
Gemstone.IO.Parsing Namespace