MCPcopy Create free account
hub / github.com/apache/cassandra-nodejs-driver / readValues

Function readValues

lib/encoder.js:339–355  ·  view source on GitHub ↗
(callback, thisArg)

Source from the content-addressed store, hash-verified

337 let offset = this.collectionLengthSize;
338 const self = this;
339 function readValues(callback, thisArg) {
340 for (let i = 0; i < totalItems; i++) {
341 const keyLength = self.decodeCollectionLength(bytes, offset);
342 offset += self.collectionLengthSize;
343 const key = self.decode(bytes.slice(offset, offset + keyLength), subtypes[0]);
344 offset += keyLength;
345 const valueLength = self.decodeCollectionLength(bytes, offset);
346 offset += self.collectionLengthSize;
347 if (valueLength < 0) {
348 callback.call(thisArg, key, null);
349 continue;
350 }
351 const value = self.decode(bytes.slice(offset, offset + valueLength), subtypes[1]);
352 offset += valueLength;
353 callback.call(thisArg, key, value);
354 }
355 }
356 if (this.encodingOptions.map) {
357 const mapConstructor = this.encodingOptions.map;
358 map = new mapConstructor();

Callers 1

defineInstanceMembersFunction · 0.85

Calls 1

sliceMethod · 0.45

Tested by

no test coverage detected