pub fn appendExact( r: *Reader, gpa: Allocator, list: *ArrayList(u8), n: usize, ) AppendExactError!void
Transfers exactly n bytes from the reader to the ArrayList.
n
ArrayList
See also:
appendRemaining
r: *Reader
gpa: Allocator
list: *ArrayList(u8)
n: usize
326 327 328 329 330 331 332 333 334 335 336 337 338 339
pub fn appendExact( r: *Reader, gpa: Allocator, list: *ArrayList(u8), n: usize, ) AppendExactError!void { try list.ensureUnusedCapacity(gpa, n); var a = std.Io.Writer.Allocating.fromArrayList(gpa, list); defer list.* = a.toArrayList(); streamExact(r, &a.writer, n) catch |err| switch (err) { error.ReadFailed, error.EndOfStream => |e| return e, error.WriteFailed => unreachable, }; }
Transfers exactly
nbytes from the reader to theArrayList.See also:
appendRemaining