Skip to main content
A newer version of this page is available. .

IFileData.SaveToStream(Stream) Method

Saves the file stored within the current IFileData object to the specified stream.

Namespace: DevExpress.Persistent.Base

Assembly: DevExpress.Persistent.Base.v18.2.dll

Declaration

void SaveToStream(
    Stream stream
)

Parameters

Name Type Description
stream Stream

A Stream object to be used to save the file.

Remarks

You can use the SaveToStream method to save a file into a Stream from a FileData type property of a business object:

using(var stream = new MemoryStream()) {
    Resume fileDataHolder = (Resume)View.CurrentObject;
    if(fileDataHolder.File != null) {
        fileDataHolder.File.SaveToStream(stream);
         // Process the saved stream as required:
         // stream.Position = 0;
         // ...
    }
}

Here, FileData is a built-in class implementing the IFileData interface.

See Also