DataCollectionSink.SendStreamAsync Method (DataCollectionContext, Stream, String, String, Boolean)
Sends a stream to the DataCollectionSink by using the parameters that are specified for this method.
Namespace: Microsoft.VisualStudio.TestTools.Execution
Assembly: Microsoft.VisualStudio.QualityTools.ExecutionCommon (in Microsoft.VisualStudio.QualityTools.ExecutionCommon.dll)
Syntax
'Declaration
Public Sub SendStreamAsync ( _
context As DataCollectionContext, _
stream As Stream, _
fileName As String, _
description As String, _
closeStream As Boolean _
)
public void SendStreamAsync(
DataCollectionContext context,
Stream stream,
string fileName,
string description,
bool closeStream
)
public:
void SendStreamAsync(
DataCollectionContext^ context,
Stream^ stream,
String^ fileName,
String^ description,
bool closeStream
)
member SendStreamAsync :
context:DataCollectionContext *
stream:Stream *
fileName:string *
description:string *
closeStream:bool -> unit
public function SendStreamAsync(
context : DataCollectionContext,
stream : Stream,
fileName : String,
description : String,
closeStream : boolean
)
Parameters
context
Type: Microsoft.VisualStudio.TestTools.Execution.DataCollectionContextAn DataCollectionContext that describes the context within which the test is running. Cannot be nulla null reference (Nothing in Visual Basic).
stream
Type: StreamThe System.IO.Stream to send.
fileName
Type: StringThe file name to use for the data on the client. Must not be nulla null reference (Nothing in Visual Basic) or empty and cannot contain illegal characters. Do not include a complete path.
description
Type: StringA short description for the file.
closeStream
Type: Booleantrue to automatically close the stream when sending is completed; otherwise, false.
Exceptions
Exception | Condition |
---|---|
ArgumentException | The fileName is nulla null reference (Nothing in Visual Basic), is empty, is a reserved file name, or contains invalid characters. |
InvalidOperationException | The stream cannot be read. |
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.