OMemStream.read

Read size bytes from the stream

  1. ubyte[] read(size_t size)
    struct OMemStream
    @safe @nogc nothrow
    ubyte[]
    read
    (
    size_t size
    )
  2. T read()

Examples

ubyte[4] data = [0, 1, 2, 3];
auto stream = OMemStream(data);
const res = stream.read(4);
assert(res == data);
assertThrown!AssertError(stream.read(1));

Meta