MCPcopy Create free account
hub / github.com/CoderLine/alphaTab / writeVariableInt

Method writeVariableInt

packages/alphatab/src/midi/MidiFile.ts:170–185  ·  view source on GitHub ↗
(s: IWriteable, value: number)

Source from the content-addressed store, hash-verified

168 }
169
170 public static writeVariableInt(s: IWriteable, value: number): void {
171 const array: Uint8Array = new Uint8Array(4);
172 let n: number = 0;
173 do {
174 array[n++] = value & 0x7f;
175 value >>= 7;
176 } while (value > 0);
177 while (n > 0) {
178 n--;
179 if (n > 0) {
180 s.writeByte(array[n] | 0x80);
181 } else {
182 s.writeByte(array[n]);
183 }
184 }
185 }
186}

Callers 3

writeToMethod · 0.80
writeToFunction · 0.80
writeToMethod · 0.80

Calls 1

writeByteMethod · 0.65

Tested by

no test coverage detected