MCPcopy Create free account
hub / github.com/mapbox/pbf / realloc

Method realloc

index.js:242–254  ·  view source on GitHub ↗

@param {number} min

(min)

Source from the content-addressed store, hash-verified

240
241 /** @param {number} min */
242 realloc(min) {
243 let length = this.length || 16;
244
245 while (length < this.pos + min) length *= 2;
246
247 if (length !== this.length) {
248 const buf = new Uint8Array(length);
249 buf.set(this.buf);
250 this.buf = buf;
251 this.dataView = new DataView(buf.buffer);
252 this.length = length;
253 }
254 }
255
256 finish() {
257 this.length = this.pos;

Callers 12

writeFixed32Method · 0.95
writeSFixed32Method · 0.95
writeFixed64Method · 0.95
writeSFixed64Method · 0.95
writeVarintMethod · 0.95
writeStringMethod · 0.95
writeFloatMethod · 0.95
writeDoubleMethod · 0.95
writeBytesMethod · 0.95
writeBigVarintFunction · 0.80
makeRoomForExtraLengthFunction · 0.80
pbf.test.jsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected