Function writeLeb128 [src]
Write a single integer as LEB128 to the given writer.
Prototype
pub fn writeLeb128(w: *Writer, value: anytype) Error!void
Parameters
w: *Writer
Possible Errors
See the Writer
implementation for detailed diagnostics.
Source
pub fn writeLeb128(w: *Writer, value: anytype) Error!void {
const value_info = @typeInfo(@TypeOf(value)).int;
try w.writeMultipleOf7Leb128(@as(@Type(.{ .int = .{
.signedness = value_info.signedness,
.bits = @max(std.mem.alignForwardAnyAlign(u16, value_info.bits, 7), 7),
} }), value));
}