write

Writes any D array, or a D style chunck in a Stream.

void
write
@nogc
(
,
const(void)[] value
)
in { assert (str); assert (value.length); assert (value.ptr); }

Parameters

str
Type: Stream

The target Stream.

value
Type: const(void)[]

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

Examples

1 static immutable uint[] a = [0u,1u];
2 MemoryStream str = construct!MemoryStream;
3 write(str, a);
4 assert(str.size == 8);
5 destruct(str);

Meta