Language

OpenedFileStream Class

Definition

A freshly opened, single-consumption byte stream plus the metadata resolved while opening it. Owns the underlying HttpResponseMessage; disposing this stream releases the response and connection. Read-only and non-seekable: it hands back the raw response body without leaking the response.

public sealed class OpenedFileStream : System.IO.Stream
type OpenedFileStream = class
    inherit Stream
Public NotInheritable Class OpenedFileStream
Inherits Stream
Inheritance
OpenedFileStream

Properties

Name Description
CanRead

When overridden in a derived class, gets a value indicating whether the current stream supports reading.

CanSeek

When overridden in a derived class, gets a value indicating whether the current stream supports seeking.

CanWrite

When overridden in a derived class, gets a value indicating whether the current stream supports writing.

ContentType

MIME type resolved from the response, falling back to the incoming file's.

Length

When overridden in a derived class, gets the length in bytes of the stream.

Position

When overridden in a derived class, gets or sets the position within the current stream.

SourceUrl

The URL the bytes were actually fetched from.

Methods

Name Description
DisposeAsync()

Asynchronously releases the unmanaged resources used by the Stream.

Flush()

When overridden in a derived class, clears all buffers for this stream and causes any buffered data to be written to the underlying device.

Read(Byte[], Int32, Int32)

When overridden in a derived class, reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.

Read(Span<Byte>)

When overridden in a derived class, reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.

ReadAsync(Byte[], Int32, Int32, CancellationToken)

Asynchronously reads a sequence of bytes from the current stream, advances the position within the stream by the number of bytes read, and monitors cancellation requests.

ReadAsync(Memory<Byte>, CancellationToken)

Asynchronously reads a sequence of bytes from the current stream, advances the position within the stream by the number of bytes read, and monitors cancellation requests.

Seek(Int64, SeekOrigin)

When overridden in a derived class, sets the position within the current stream.

SetLength(Int64)

When overridden in a derived class, sets the length of the current stream.

Write(Byte[], Int32, Int32)

When overridden in a derived class, writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.

Applies to