read

Reads any D array, or a D style chunck from a Stream.

void
read
@nogc
()
in { assert (str); assert (value.length); assert (value.ptr); }

Parameters

str
Type: Stream

The source Stream.

value
Type: void[]

Any D array. Its size and its type determine how many bytes to read.

Examples

1 static uint[] b = [0,0];
2 static immutable uint[] a = [7u,8u];
3 MemoryStream str = construct!MemoryStream(a);
4 read(str, b);
5 assert(b[0] == 7);
6 assert(b[1] == 8);
7 destruct(str);

Meta