mirror of
https://github.com/danog/byte-stream.git
synced 2024-12-02 17:28:21 +01:00
434 B
434 B
InMemoryStream
An InMemoryStream
allows creating an InputStream
from a single known string chunk. This is helpful if the complete stream contents are already known.
$inputStream = new InMemoryStream("foobar");
It also allows creating a stream without any chunks by passing null
as chunk.
$inputStream = new InMemoryStream;
// The stream ends immediately
assert(null === yield $inputStream->read());