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
| Instantiates a DynamicContentStream that reads strings (which are converted to UTF-8)
and lets you configure whether it’s buffered or not. |
| Instantiates a DynamicContentStream that reads raw bytes
and lets you configure whether it’s buffered or not. |
Instance methods
void | | This member is not documented. |
int | Read(byte[] buffer, int offset, int count) |
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) | These members are not documented. |
void | |
void | Write(byte[] buffer, int offset, int count) |
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 | | These members are not documented. |
bool | |
bool | |
long | |
long | |