StreamedFileDataRequest StreamedFileDataRequest StreamedFileDataRequest StreamedFileDataRequest Class

Syntax

Declaration

public sealed class StreamedFileDataRequestpublic sealed class StreamedFileDataRequestPublic NotInheritable Class StreamedFileDataRequestpublic sealed class StreamedFileDataRequest

Remarks

This object is passed to the app's StreamedFileDataRequestedHandler function when a stream that is represented by a StorageFile is accessed. Define the StreamedFileDataRequestedHandler function if you use CreateStreamedFileAsync(String, StreamedFileDataRequestedHandler, IRandomAccessStreamReference) or ReplaceWithStreamedFileAsync(IStorageFile, StreamedFileDataRequestedHandler, IRandomAccessStreamReference) to get a StorageFile that represents the stream.

Methods summary

Releases system resources that are exposed by the current stream indicating that the data request is complete.

Indicates that the data can't be streamed and releases system resources that are exposed by the current stream indicating that the data request is complete.

Flushes the data in the current stream.

Writes data from a buffer to the current stream.

Methods

  • Close()
    Close()
    Close()
    Close()

    Releases system resources that are exposed by the current stream indicating that the data request is complete.

    public void Close()public void Close()Public Function Close() As voidpublic void Close()
  • FailAndClose(StreamedFileFailureMode)
    FailAndClose(StreamedFileFailureMode)
    FailAndClose(StreamedFileFailureMode)
    FailAndClose(StreamedFileFailureMode)

    Indicates that the data can't be streamed and releases system resources that are exposed by the current stream indicating that the data request is complete.

    public void FailAndClose(StreamedFileFailureMode failureMode)public void FailAndClose(StreamedFileFailureMode failureMode)Public Function FailAndClose(failureMode As StreamedFileFailureMode) As voidpublic void FailAndClose(StreamedFileFailureMode failureMode)

    Parameters

  • FlushAsync()
    FlushAsync()
    FlushAsync()
    FlushAsync()

    Flushes the data in the current stream.

    public IAsyncOperation<bool> FlushAsync()public IAsyncOperation<bool> FlushAsync()Public Function FlushAsync() As IAsyncOperation( Of bool )public IAsyncOperation<bool> FlushAsync()

    Returns

    • When this method completes, it returns true if the data was flushed successfully or false if the flush operation failed.

  • WriteAsync(IBuffer)
    WriteAsync(IBuffer)
    WriteAsync(IBuffer)
    WriteAsync(IBuffer)

    Writes data from a buffer to the current stream.

    public IAsyncOperationWithProgress<uint, uint> WriteAsync(IBuffer buffer)public IAsyncOperationWithProgress<uint, uint> WriteAsync(IBuffer buffer)Public Function WriteAsync(buffer As IBuffer) As IAsyncOperationWithProgress( Of uint, uint )public IAsyncOperationWithProgress<uint, uint> WriteAsync(IBuffer buffer)

    Parameters

    Returns

    • When this method completes, it returns the number of bytes (type UInt32) that were written to the stream. If the app specifies a function to monitor progress, that function receives the number of bytes (type UInt32) written so far.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute

Details

Assembly

Windows.Storage.dll