• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

visgl / loaders.gl / 24139120841

08 Apr 2026 01:53PM UTC coverage: 65.319% (+30.2%) from 35.137%
24139120841

push

github

web-flow
chore: Replace puppeteer with playwright (#3350)

14216 of 18890 branches covered (75.26%)

Branch coverage included in aggregate %.

3 of 3 new or added lines in 1 file covered. (100.0%)

3248 existing lines in 369 files now uncovered.

73509 of 115413 relevant lines covered (63.69%)

5763.45 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

58.14
/modules/gis/src/lib/utils/binary-reader.ts
1
// loaders.gl
1✔
2
// SPDX-License-Identifier: MIT
16✔
3
// Copyright (c) vis.gl contributors
16✔
4

16✔
5
/** A DataView that tracks byte offset when reading. */
16✔
6
export class BinaryReader {
16✔
7
  arrayBuffer: ArrayBuffer;
16✔
8
  dataView: DataView;
16✔
9
  byteOffset: number;
16✔
10
  littleEndian: boolean;
16✔
11

16✔
12
  constructor(arrayBuffer: ArrayBuffer, isBigEndian: boolean = false) {
16✔
13
    this.arrayBuffer = arrayBuffer;
16✔
14
    this.dataView = new DataView(arrayBuffer);
32✔
15
    this.byteOffset = 0;
32✔
16
    this.littleEndian = !isBigEndian;
16✔
17
  }
×
UNCOV
18

×
UNCOV
19
  readUInt8() {
✔
20
    const value = this.dataView.getUint8(this.byteOffset);
32✔
21
    this.byteOffset += 1;
32✔
22
    return value;
×
23
  }
×
UNCOV
24
  readUInt16() {
×
25
    const value = this.dataView.getUint16(this.byteOffset, this.littleEndian);
×
26
    this.byteOffset += 2;
×
27
    return value;
×
28
  }
×
UNCOV
29
  readUInt32() {
×
30
    const value = this.dataView.getUint32(this.byteOffset, this.littleEndian);
×
31
    this.byteOffset += 4;
×
32
    return value;
×
33
  }
×
UNCOV
34
  readInt8() {
×
35
    const value = this.dataView.getInt8(this.byteOffset);
×
36
    this.byteOffset += 1;
×
37
    return value;
×
38
  }
×
UNCOV
39
  readInt16() {
×
40
    const value = this.dataView.getInt16(this.byteOffset, this.littleEndian);
×
41
    this.byteOffset += 2;
×
42
    return value;
×
43
  }
×
UNCOV
44
  readInt32() {
×
45
    const value = this.dataView.getInt32(this.byteOffset, this.littleEndian);
×
46
    this.byteOffset += 4;
×
47
    return value;
×
48
  }
×
UNCOV
49
  readFloat() {
×
50
    const value = this.dataView.getFloat32(this.byteOffset, this.littleEndian);
✔
51
    this.byteOffset += 4;
139✔
52
    return value;
359✔
53
  }
359✔
54
  readDouble() {
359✔
55
    const value = this.dataView.getFloat64(this.byteOffset, this.littleEndian);
×
56
    this.byteOffset += 8;
×
57
    return value;
×
58
  }
×
59

139✔
60
  readVarInt() {
139✔
61
    let result = 0;
139✔
62
    let bytesRead = 0;
139✔
63

139✔
64
    let nextByte;
139✔
65
    do {
139✔
66
      // TODO - this needs to be accessed via data view?
359✔
67
      nextByte = this.dataView.getUint8(this.byteOffset + bytesRead);
359✔
68
      result += (nextByte & 0x7f) << (7 * bytesRead);
359✔
69
      bytesRead++;
359✔
70
    } while (nextByte >= 0x80);
139✔
71

139✔
72
    this.byteOffset += bytesRead;
139✔
73

139✔
74
    return result;
139✔
75
  }
139✔
76
}
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc