Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Sealed class: RT.Util.Streams.DynamicContentStream

Summary

Provides a read-only stream that can “read from” an IEnumerable<string> or IEnumerable<byte[]>. In particular, an intended application is to “read from” a method that uses yield return to return strings or data as execution proceeds. This enables generation of, for example, HTML for dynamic web pages.

Constructors

DynamicContentStream(IEnumerable<string> enumerable, bool buffered = true)
Instantiates a DynamicContentStream that reads strings (which are converted to UTF-8) and lets you configure whether it’s buffered or not.
DynamicContentStream(IEnumerable<byte[]> enumerable, bool buffered = true)
Instantiates a DynamicContentStream that reads raw bytes and lets you configure whether it’s buffered or not.

Instance methods

void
  • Overrides: Stream.Flush()
This member is not documented.
int
Read(byte[] buffer, int offset, int count)
  • Overrides: Stream.Read(byte[], int, int)
Reads some text or data into the specified buffer. The behaviour depends on the DynamicContentStream.Buffered property. The bytes returned respresent the text or data returned by the underlying enumerator. In the case of UTF-8-encoded text, DynamicContentStream may potentially return incomplete multi-byte sequences; however, all output will be valid UTF-8 when concatenated.
long
Seek(long offset, SeekOrigin origin)
  • Overrides: Stream.Seek(long, SeekOrigin)
These members are not documented.
void
SetLength(long value)
  • Overrides: Stream.SetLength(long)
void
Write(byte[] buffer, int offset, int count)
  • Overrides: Stream.Write(byte[], int, int)

Instance properties

bool If true, each call to DynamicContentStream.Read(byte[], int, int) will move the enumerator forward as far as necessary to fill the buffer. If false, each call to DynamicContentStream.Read(byte[], int, int) returns only the text produced by a single MoveNext() of the enumerator.
bool
  • Overrides: Stream.CanRead
These members are not documented.
bool
  • Overrides: Stream.CanSeek
bool
  • Overrides: Stream.CanWrite
long
  • Overrides: Stream.Length
long
  • Overrides: Stream.Position