pub fn splatBytesAll(w: *Writer, bytes: []const u8, splat: usize) Error!void w: *Writerbytes: []const u8splat: usizeWriteFailedSee the Writer implementation for detailed diagnostics.
927
928
929
930
931
932
933
934
935
936pub fn splatBytesAll(w: *Writer, bytes: []const u8, splat: usize) Error!void {
var remaining_bytes: usize = bytes.len * splat;
remaining_bytes -= try w.splatBytes(bytes, splat);
while (remaining_bytes > 0) {
const leftover_splat = remaining_bytes / bytes.len;
const leftover_bytes = remaining_bytes % bytes.len;
const buffers: [2][]const u8 = .{ bytes[bytes.len - leftover_bytes ..], bytes };
remaining_bytes -= try w.writeSplat(&buffers, leftover_splat);
}
}
Writes the same slice many times, performing the underlying write call as many times as necessary.