StreamContent Class
A content provider that wraps a seekable stream.
Namespace
Statiq.Common
Interfaces
Base Types
graph BT Type-->Base0["LockingStreamWrapper"] click Base0 "/api/Statiq.Common/LockingStreamWrapper" Base0-->Base1["object"] Type-.->Interface0["IDisposable"] Type-.->Interface1["IContentProvider"] click Interface1 "/api/Statiq.Common/IContentProvider" Type-.->Interface2["ICacheCode"] click Interface2 "/api/Statiq.Common/ICacheCode" Type["StreamContent"] class Type type-node

Syntax

public class StreamContent : LockingStreamWrapper, IDisposable, IContentProvider, ICacheCode

Constructors

Properties

Name Property Type Summary
MediaType string
Gets the media type of the content.
Stream Stream
Inherited from LockingStreamWrapper

Methods

Name Return Value Summary
CloneWithMediaType(string) IContentProvider
Clones the current content provider with a new media type.
Dispose() void
Inherited from LockingStreamWrapper
GetCacheCodeAsync() Task<int>
Gets a deterministic hash appropriate for caching.
GetLength() long
Gets the length of the wrapped stream without locking it.
Inherited from LockingStreamWrapper
GetStream() Stream
Gets the wrapped stream and locks access until it's disposed. The returned stream should be disposed after use as soon as possible.
Inherited from LockingStreamWrapper
GetTextReader() TextReader
Gets an appropriate TextReader for the content. This is prefered over reading the stream as text since it might be optimized for text-based use cases. The returned TextReader should be disposed after use.

Extension Methods