Retrieves Asset Stream with provided location and file extension.
Namespace: Cartella.InterfacesAssembly: AssetManagementSystem (in AssetManagementSystem.dll) Version: 4.1.0.171 (4.1.0.171)
Syntax
C# |
---|
Stream GetAssetStream( string location, string extension ) |
Visual Basic |
---|
Function GetAssetStream ( _ location As String, _ extension As String _ ) As Stream |
Visual C++ |
---|
Stream^ GetAssetStream( String^ location, String^ extension ) |
Parameters
- location
- Type: System..::..String
Location of the Asset Binary. This location was originally given by the CreateAssetBinary method in the Storage Provider.
- extension
- Type: System..::..String
File Extension
Return Value
Stream of the Binary; Null if location doesn't existRemarks
Please make sure to close the stream after using it, otherwise the resource will be tied up,
causing references to the specific binary impossible due to mutual exclusivity. We suggest using the using
(Using in VisualBasic.NET) statement to wrap up the usage of this property.
all the time.
Examples
CopyC#
using(Stream assetStream = storage.GetAssetStream(location, ext)) { //tasks done here }
Exceptions
Exception | Condition |
---|---|
System..::..ArgumentNullException | Thrown when null or empty location passed in |