| ... | @@ -57,6 +57,15 @@ pub fn Reader( | ... | @@ -57,6 +57,15 @@ pub fn Reader( |
| 57 | /// If the number of bytes appended would exceed `max_append_size`, `error.StreamTooLong` is returned | 57 | /// If the number of bytes appended would exceed `max_append_size`, `error.StreamTooLong` is returned |
| 58 | /// and the `std.ArrayList` has exactly `max_append_size` bytes appended. | 58 | /// and the `std.ArrayList` has exactly `max_append_size` bytes appended. |
| 59 | pub fn readAllArrayList(self: Self, array_list: *std.ArrayList(u8), max_append_size: usize) !void { | 59 | pub fn readAllArrayList(self: Self, array_list: *std.ArrayList(u8), max_append_size: usize) !void { |
| | 60 | return self.readAllArrayListAligned(null, array_list, max_append_size); |
| | 61 | } |
| | 62 | |
| | 63 | pub fn readAllArrayListAligned( |
| | 64 | self: Self, |
| | 65 | comptime alignment: ?u29, |
| | 66 | array_list: *std.ArrayListAligned(u8, alignment), |
| | 67 | max_append_size: usize |
| | 68 | ) !void { |
| 60 | try array_list.ensureCapacity(math.min(max_append_size, 4096)); | 69 | try array_list.ensureCapacity(math.min(max_append_size, 4096)); |
| 61 | const original_len = array_list.items.len; | 70 | const original_len = array_list.items.len; |
| 62 | var start_index: usize = original_len; | 71 | var start_index: usize = original_len; |