StreamInputRange

Implements an input range interface on top of an InputStream using an internal buffer.

The buffer is GC allocated and is filled chunk wise. Thus an InputStream that has been wrapped in a StreamInputRange cannot be used reliably on its own anymore.

Reading occurs in a fully lazy fashion. The first call to either front, popFront or empty will potentially trigger waiting for the next chunk of data to arrive - but especially popFront will not wait if it was called after a call to front. This property allows the range to be used in request-response scenarios.

struct StreamInputRange (
InputStream
size_t buffer_size = 256
) if (
isInputStream!InputStream
) {}

Members

Functions

front
ubyte front()
Undocumented in source. Be warned that the author may not have intended to support it.
popFront
void popFront()
Undocumented in source. Be warned that the author may not have intended to support it.

Properties

empty
bool empty [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.

Meta