Share via


XFileManager.FromStream(Stream,Int32) Method (Microsoft.DirectX.Direct3D)

Creates an XFile object from a data stream.

Definition

Visual Basic Public Function FromStream( _
    ByVal data As StreamLeave Site, _
    ByVal length As Integer _
) As XFile
C# public XFile FromStream(
    StreamLeave Site data,
    int length
);
C++ public:
XFileFromStream(
    StreamLeave Sitedata,
    int length
);
JScript public function FromStream(
    data : StreamLeave Site,
    length : int
) : XFile;

Parameters

data System.IO.Stream
A StreamLeave Site that contains the .x file data.
length System.Int32
The length of the data stream.

Return Value

Microsoft.DirectX.Direct3D.XFile
A newly created XFile object.

Remarks

After using this method, use one of the XFile methods to retrieve a data object.

Exception GraphicsException.ErrorCode Cause
GraphicsException XFileErrorCodes.BadValue A variable is outside its expected range; typically returned when an object is invalid.
XFileErrorCodes.ParseError Data stream could not be parsed.
ArgumentOutOfRangeExceptionLeave Site N/A Length must be greater than zero.
NotSupportedExceptionLeave Site N/A The stream must support reading.