stretchPut

Write length bytes of data to an output range, repeating data as necessary

package @safe
void
stretchPut
(
Out
)
(
ref Out output
,
const(ubyte)[] data
,
size_t length
)
if (
isOutputRange!(Out, ubyte)
)

Examples

import std.array : appender;
auto result_app = appender!(ubyte[]);
result_app.stretchPut([0, 1, 2], 7);
assert (result_app[] == [0, 1, 2, 0, 1, 2, 0]);

Meta