| author | |
| committer | |
| log | 76f87cdd966f23106684bb38c127f6bd3f4e9fa3 |
| tree | 6d9afb94c5c02cb96782cff4d91d12d13b36a212 |
| parent | 78d4fb20c44488117cc450177d92c44a19d97c91 |
1 files changed, 6 insertions(+), 0 deletions(-)
std/io.zig+6| ... | ... | @@ -63,6 +63,12 @@ pub struct OutStream { |
| 63 | 63 | buffer: [buffer_size]u8, |
| 64 | 64 | index: isize, |
| 65 | 65 | |
| 66 | pub fn write_byte(os: &OutStream, b: u8) -> %void { | |
| 67 | if (os.buffer.len == os.index) %return os.flush(); | |
| 68 | os.buffer[os.index] = b; | |
| 69 | os.index += 1; | |
| 70 | } | |
| 71 | ||
| 66 | 72 | pub fn write(os: &OutStream, bytes: []const u8) -> %isize { |
| 67 | 73 | var src_bytes_left = bytes.len; |
| 68 | 74 | var src_index: @typeof(bytes.len) = 0; |