bireader 3.0.1 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/README.md +91 -29
  2. package/dist/BiReader.d.ts +339 -0
  3. package/dist/BiReaderStream.d.ts +340 -0
  4. package/dist/BiWriter.d.ts +344 -0
  5. package/dist/BiWriterStream.d.ts +347 -0
  6. package/dist/aliases/BinaryAliasReader.d.ts +4678 -0
  7. package/dist/aliases/BinaryAliasWriter.d.ts +4648 -0
  8. package/dist/common.d.ts +90 -0
  9. package/{build/esm/common.d.ts → dist/core/BiBase.d.ts} +132 -221
  10. package/{build/cjs/common.d.ts → dist/core/BiBaseStream.d.ts} +197 -261
  11. package/dist/index.browser.d.ts +6738 -0
  12. package/dist/index.browser.js +11557 -0
  13. package/dist/index.browser.js.map +1 -0
  14. package/dist/index.cjs.d.ts +13439 -0
  15. package/dist/index.cjs.js +17364 -0
  16. package/dist/index.cjs.js.map +1 -0
  17. package/dist/index.d.ts +13439 -0
  18. package/dist/index.esm.d.ts +13439 -0
  19. package/dist/index.esm.js +17337 -0
  20. package/dist/index.esm.js.map +1 -0
  21. package/dist/indexBrowser.d.ts +19 -0
  22. package/dist/indexImport.d.ts +21 -0
  23. package/package.json +23 -14
  24. package/rollup.config.js +76 -0
  25. package/tsconfig.json +15 -0
  26. package/build/cjs/bireader.d.ts +0 -2372
  27. package/build/cjs/bireader.d.ts.map +0 -1
  28. package/build/cjs/bireader.js +0 -3060
  29. package/build/cjs/bireader.js.map +0 -1
  30. package/build/cjs/biwriter.d.ts +0 -2359
  31. package/build/cjs/biwriter.d.ts.map +0 -1
  32. package/build/cjs/biwriter.js +0 -3094
  33. package/build/cjs/biwriter.js.map +0 -1
  34. package/build/cjs/common.d.ts.map +0 -1
  35. package/build/cjs/common.js +0 -3615
  36. package/build/cjs/common.js.map +0 -1
  37. package/build/cjs/index.d.ts +0 -18
  38. package/build/cjs/index.d.ts.map +0 -1
  39. package/build/cjs/index.js +0 -30
  40. package/build/cjs/index.js.map +0 -1
  41. package/build/esm/bireader.d.ts +0 -2372
  42. package/build/esm/bireader.d.ts.map +0 -1
  43. package/build/esm/bireader.js +0 -3060
  44. package/build/esm/bireader.js.map +0 -1
  45. package/build/esm/biwriter.d.ts +0 -2359
  46. package/build/esm/biwriter.d.ts.map +0 -1
  47. package/build/esm/biwriter.js +0 -3094
  48. package/build/esm/biwriter.js.map +0 -1
  49. package/build/esm/common.d.ts.map +0 -1
  50. package/build/esm/common.js +0 -3615
  51. package/build/esm/common.js.map +0 -1
  52. package/build/esm/index.d.ts +0 -18
  53. package/build/esm/index.d.ts.map +0 -1
  54. package/build/esm/index.js +0 -30
  55. package/build/esm/index.js.map +0 -1
@@ -1,3060 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BiReader = void 0;
4
- const common_1 = require("./common");
5
- /**
6
- * Binary reader, includes bitfields and strings.
7
- *
8
- * @param {Buffer|Uint8Array} data - ``Buffer`` or ``Uint8Array``. Always found in ``BiReader.data``
9
- * @param {BiOptions?} options - Any options to set at start
10
- * @param {number?} options.byteOffset - Byte offset to start reader (default ``0``)
11
- * @param {number?} options.bitOffset - Bit offset 0-7 to start reader (default ``0``)
12
- * @param {string?} options.endianness - Endianness ``big`` or ``little`` (default ``little``)
13
- * @param {boolean?} options.strict - Strict mode: if ``true`` does not extend supplied array on outside write (default ``true``)
14
- * @param {number?} options.extendBufferSize - Amount of data to add when extending the buffer array when strict mode is false. Note: Changes logic in ``.get`` and ``.return``.
15
- *
16
- * @since 2.0
17
- */
18
- class BiReader extends common_1.ReaderBase {
19
- /**
20
- * Binary reader, includes bitfields and strings.
21
- *
22
- * @param {Buffer|Uint8Array} data - ``Buffer`` or ``Uint8Array``. Always found in ``BiReader.data``
23
- * @param {BiOptions?} options - Any options to set at start
24
- * @param {number?} options.byteOffset - Byte offset to start reader (default ``0``)
25
- * @param {number?} options.bitOffset - Bit offset 0-7 to start reader (default ``0``)
26
- * @param {string?} options.endianness - Endianness ``big`` or ``little`` (default ``little``)
27
- * @param {boolean?} options.strict - Strict mode: if ``true`` does not extend supplied array on outside write (default ``true``)
28
- * @param {number?} options.extendBufferSize - Amount of data to add when extending the buffer array when strict mode is false. Note: Changes logic in ``.get`` and ``.return``.
29
- */
30
- constructor(data, options = {}) {
31
- super();
32
- this.strict = true;
33
- if (data == undefined) {
34
- throw new Error("Data required");
35
- }
36
- else {
37
- if (!this.isBufferOrUint8Array(data)) {
38
- throw new Error("Write data must be Uint8Array or Buffer");
39
- }
40
- this.data = data;
41
- }
42
- if (options.extendBufferSize != undefined && options.extendBufferSize != 0) {
43
- this.extendBufferSize = options.extendBufferSize;
44
- }
45
- this.size = this.data.length;
46
- this.sizeB = this.data.length * 8;
47
- if (options.endianness != undefined && typeof options.endianness != "string") {
48
- throw new Error("Endian must be big or little");
49
- }
50
- if (options.endianness != undefined && !(options.endianness == "big" || options.endianness == "little")) {
51
- throw new Error("Byte order must be big or little");
52
- }
53
- this.endian = options.endianness || "little";
54
- if (typeof options.strict == "boolean") {
55
- this.strict = options.strict;
56
- }
57
- else {
58
- if (options.strict != undefined) {
59
- throw new Error("Strict mode must be true of false");
60
- }
61
- }
62
- if (options.byteOffset != undefined || options.bitOffset != undefined) {
63
- this.offset = ((Math.abs(options.byteOffset || 0)) + Math.ceil((Math.abs(options.bitOffset || 0)) / 8));
64
- // Adjust byte offset based on bit overflow
65
- this.offset += Math.floor((Math.abs(options.bitOffset || 0)) / 8);
66
- // Adjust bit offset
67
- this.bitoffset = (Math.abs(options.bitOffset || 0) + 64) % 8;
68
- // Ensure bit offset stays between 0-7
69
- this.bitoffset = Math.min(Math.max(this.bitoffset, 0), 7);
70
- // Ensure offset doesn't go negative
71
- this.offset = Math.max(this.offset, 0);
72
- if (this.offset > this.size) {
73
- if (this.strict == false) {
74
- if (this.extendBufferSize != 0) {
75
- this.extendArray(this.extendBufferSize);
76
- }
77
- else {
78
- this.extendArray(this.offset - this.size);
79
- }
80
- }
81
- else {
82
- throw new Error(`Starting offset outside of size: ${this.offset} of ${this.size}`);
83
- }
84
- }
85
- }
86
- }
87
- //
88
- // Bit Aliases
89
- //
90
- /**
91
- * Bit field reader.
92
- *
93
- * Note: When returning to a byte read, remaining bits are dropped.
94
- *
95
- * @param {number} bits - bits to read
96
- * @param {boolean} unsigned - if the value is unsigned
97
- * @param {string} endian - ``big`` or ``little``
98
- * @returns {number}
99
- */
100
- bit(bits, unsigned, endian) {
101
- return this.readBit(bits, unsigned, endian);
102
- }
103
- /**
104
- * Bit field reader. Unsigned read.
105
- *
106
- * Note: When returning to a byte read, remaining bits are dropped.
107
- *
108
- * @param {number} bits - bits to read
109
- * @param {string} endian - ``big`` or ``little``
110
- * @returns {number}
111
- */
112
- ubit(bits, endian) {
113
- return this.readBit(bits, true, endian);
114
- }
115
- /**
116
- * Bit field reader. Unsigned big endian read.
117
- *
118
- * Note: When returning to a byte read, remaining bits are dropped.
119
- *
120
- * @param {number} bits - bits to read
121
- * @returns {number}
122
- */
123
- ubitbe(bits) {
124
- return this.bit(bits, true, "big");
125
- }
126
- /**
127
- * Bit field reader. Big endian read.
128
- *
129
- * Note: When returning to a byte read, remaining bits are dropped.
130
- *
131
- * @param {number} bits - bits to read
132
- * @param {boolean} unsigned - if the value is unsigned
133
- * @returns {number}
134
- */
135
- bitbe(bits, unsigned) {
136
- return this.bit(bits, unsigned, "big");
137
- }
138
- /**
139
- * Bit field reader. Unsigned little endian read.
140
- *
141
- * Note: When returning to a byte read, remaining bits are dropped.
142
- *
143
- * @param {number} bits - bits to read
144
- * @returns {number}
145
- */
146
- ubitle(bits) {
147
- return this.bit(bits, true, "little");
148
- }
149
- /**
150
- * Bit field reader. Little endian read.
151
- *
152
- * Note: When returning to a byte read, remaining bits are dropped.
153
- *
154
- * @param {number} bits - bits to read
155
- * @param {boolean} unsigned - if the value is unsigned
156
- * @returns {number}
157
- */
158
- bitle(bits, unsigned) {
159
- return this.bit(bits, unsigned, "little");
160
- }
161
- /**
162
- * Bit field reader. Reads 1 bit.
163
- *
164
- * Note: When returning to a byte read, remaining bits are dropped.
165
- *
166
- * @returns {number}
167
- */
168
- get bit1() {
169
- return this.bit(1);
170
- }
171
- /**
172
- * Bit field reader. Reads 1 bit.
173
- *
174
- * Note: When returning to a byte read, remaining bits are dropped.
175
- *
176
- * @returns {number}
177
- */
178
- get bit1le() {
179
- return this.bit(1, undefined, "little");
180
- }
181
- /**
182
- * Bit field reader. Reads 1 bit.
183
- *
184
- * Note: When returning to a byte read, remaining bits are dropped.
185
- *
186
- * @returns {number}
187
- */
188
- get bit1be() {
189
- return this.bit(1, undefined, "big");
190
- }
191
- /**
192
- * Bit field reader. Reads 1 bit.
193
- *
194
- * Note: When returning to a byte read, remaining bits are dropped.
195
- *
196
- * @returns {number}
197
- */
198
- get ubit1() {
199
- return this.bit(1, true);
200
- }
201
- /**
202
- * Bit field reader. Reads 1 bit.
203
- *
204
- * Note: When returning to a byte read, remaining bits are dropped.
205
- *
206
- * @returns {number}
207
- */
208
- get ubit1le() {
209
- return this.bit(1, true, "little");
210
- }
211
- /**
212
- * Bit field reader. Reads 1 bit.
213
- *
214
- * Note: When returning to a byte read, remaining bits are dropped.
215
- *
216
- * @returns {number}
217
- */
218
- get ubit1be() {
219
- return this.bit(1, true, "big");
220
- }
221
- /**
222
- * Bit field reader. Reads 2 bits.
223
- *
224
- * Note: When returning to a byte read, remaining bits are dropped.
225
- *
226
- * @returns {number}
227
- */
228
- get bit2() {
229
- return this.bit(2);
230
- }
231
- /**
232
- * Bit field reader. Reads 2 bits.
233
- *
234
- * Note: When returning to a byte read, remaining bits are dropped.
235
- *
236
- * @returns {number}
237
- */
238
- get bit2le() {
239
- return this.bit(2, undefined, "little");
240
- }
241
- /**
242
- * Bit field reader. Reads 2 bits.
243
- *
244
- * Note: When returning to a byte read, remaining bits are dropped.
245
- *
246
- * @returns {number}
247
- */
248
- get bit2be() {
249
- return this.bit(2, undefined, "big");
250
- }
251
- /**
252
- * Bit field reader. Reads 2 bits.
253
- *
254
- * Note: When returning to a byte read, remaining bits are dropped.
255
- *
256
- * @returns {number}
257
- */
258
- get ubit2() {
259
- return this.bit(2, true);
260
- }
261
- /**
262
- * Bit field reader. Reads 2 bits.
263
- *
264
- * Note: When returning to a byte read, remaining bits are dropped.
265
- *
266
- * @returns {number}
267
- */
268
- get ubit2le() {
269
- return this.bit(2, true, "little");
270
- }
271
- /**
272
- * Bit field reader. Reads 2 bits.
273
- *
274
- * Note: When returning to a byte read, remaining bits are dropped.
275
- *
276
- * @returns {number}
277
- */
278
- get ubit2be() {
279
- return this.bit(2, true, "big");
280
- }
281
- /**
282
- * Bit field reader. Reads 3 bits.
283
- *
284
- * Note: When returning to a byte read, remaining bits are dropped.
285
- *
286
- * @returns {number}
287
- */
288
- get bit3() {
289
- return this.bit(3);
290
- }
291
- /**
292
- * Bit field reader. Reads 3 bits.
293
- *
294
- * Note: When returning to a byte read, remaining bits are dropped.
295
- *
296
- * @returns {number}
297
- */
298
- get bit3le() {
299
- return this.bit(3, undefined, "little");
300
- }
301
- /**
302
- * Bit field reader. Reads 3 bits.
303
- *
304
- * Note: When returning to a byte read, remaining bits are dropped.
305
- *
306
- * @returns {number}
307
- */
308
- get bit3be() {
309
- return this.bit(3, undefined, "big");
310
- }
311
- /**
312
- * Bit field reader. Reads 3 bits.
313
- *
314
- * Note: When returning to a byte read, remaining bits are dropped.
315
- *
316
- * @returns {number}
317
- */
318
- get ubit3() {
319
- return this.bit(3, true);
320
- }
321
- /**
322
- * Bit field reader. Reads 3 bits.
323
- *
324
- * Note: When returning to a byte read, remaining bits are dropped.
325
- *
326
- * @returns {number}
327
- */
328
- get ubit3le() {
329
- return this.bit(3, true, "little");
330
- }
331
- /**
332
- * Bit field reader. Reads 3 bits.
333
- *
334
- * Note: When returning to a byte read, remaining bits are dropped.
335
- *
336
- * @returns {number}
337
- */
338
- get ubit3be() {
339
- return this.bit(3, true, "big");
340
- }
341
- /**
342
- * Bit field reader. Reads 4 bits.
343
- *
344
- * Note: When returning to a byte read, remaining bits are dropped.
345
- *
346
- * @returns {number}
347
- */
348
- get bit4() {
349
- return this.bit(4);
350
- }
351
- /**
352
- * Bit field reader. Reads 4 bits.
353
- *
354
- * Note: When returning to a byte read, remaining bits are dropped.
355
- *
356
- * @returns {number}
357
- */
358
- get bit4le() {
359
- return this.bit(4, undefined, "little");
360
- }
361
- /**
362
- * Bit field reader. Reads 4 bits.
363
- *
364
- * Note: When returning to a byte read, remaining bits are dropped.
365
- *
366
- * @returns {number}
367
- */
368
- get bit4be() {
369
- return this.bit(4, undefined, "big");
370
- }
371
- /**
372
- * Bit field reader. Reads 4 bits.
373
- *
374
- * Note: When returning to a byte read, remaining bits are dropped.
375
- *
376
- * @returns {number}
377
- */
378
- get ubit4() {
379
- return this.bit(4, true);
380
- }
381
- /**
382
- * Bit field reader. Reads 4 bits.
383
- *
384
- * Note: When returning to a byte read, remaining bits are dropped.
385
- *
386
- * @returns {number}
387
- */
388
- get ubit4le() {
389
- return this.bit(4, true, "little");
390
- }
391
- /**
392
- * Bit field reader. Reads 4 bits.
393
- *
394
- * Note: When returning to a byte read, remaining bits are dropped.
395
- *
396
- * @returns {number}
397
- */
398
- get ubit4be() {
399
- return this.bit(4, true, "big");
400
- }
401
- /**
402
- * Bit field reader. Reads 5 bits.
403
- *
404
- * Note: When returning to a byte read, remaining bits are dropped.
405
- *
406
- * @returns {number}
407
- */
408
- get bit5() {
409
- return this.bit(5);
410
- }
411
- /**
412
- * Bit field reader. Reads 5 bits.
413
- *
414
- * Note: When returning to a byte read, remaining bits are dropped.
415
- *
416
- * @returns {number}
417
- */
418
- get bit5le() {
419
- return this.bit(5, undefined, "little");
420
- }
421
- /**
422
- * Bit field reader. Reads 5 bits.
423
- *
424
- * Note: When returning to a byte read, remaining bits are dropped.
425
- *
426
- * @returns {number}
427
- */
428
- get bit5be() {
429
- return this.bit(5, undefined, "big");
430
- }
431
- /**
432
- * Bit field reader. Reads 5 bits.
433
- *
434
- * Note: When returning to a byte read, remaining bits are dropped.
435
- *
436
- * @returns {number}
437
- */
438
- get ubit5() {
439
- return this.bit(5, true);
440
- }
441
- /**
442
- * Bit field reader. Reads 5 bits.
443
- *
444
- * Note: When returning to a byte read, remaining bits are dropped.
445
- *
446
- * @returns {number}
447
- */
448
- get ubit5le() {
449
- return this.bit(5, true, "little");
450
- }
451
- /**
452
- * Bit field reader. Reads 5 bits.
453
- *
454
- * Note: When returning to a byte read, remaining bits are dropped.
455
- *
456
- * @returns {number}
457
- */
458
- get ubit5be() {
459
- return this.bit(5, true, "big");
460
- }
461
- /**
462
- * Bit field reader. Reads 6 bits.
463
- *
464
- * Note: When returning to a byte read, remaining bits are dropped.
465
- *
466
- * @returns {number}
467
- */
468
- get bit6() {
469
- return this.bit(6);
470
- }
471
- /**
472
- * Bit field reader. Reads 6 bits.
473
- *
474
- * Note: When returning to a byte read, remaining bits are dropped.
475
- *
476
- * @returns {number}
477
- */
478
- get bit6le() {
479
- return this.bit(6, undefined, "little");
480
- }
481
- /**
482
- * Bit field reader. Reads 6 bits.
483
- *
484
- * Note: When returning to a byte read, remaining bits are dropped.
485
- *
486
- * @returns {number}
487
- */
488
- get bit6be() {
489
- return this.bit(6, undefined, "big");
490
- }
491
- /**
492
- * Bit field reader. Reads 6 bits.
493
- *
494
- * Note: When returning to a byte read, remaining bits are dropped.
495
- *
496
- * @returns {number}
497
- */
498
- get ubit6() {
499
- return this.bit(6, true);
500
- }
501
- /**
502
- * Bit field reader. Reads 6 bits.
503
- *
504
- * Note: When returning to a byte read, remaining bits are dropped.
505
- *
506
- * @returns {number}
507
- */
508
- get ubit6le() {
509
- return this.bit(6, true, "little");
510
- }
511
- /**
512
- * Bit field reader. Reads 6 bits.
513
- *
514
- * Note: When returning to a byte read, remaining bits are dropped.
515
- *
516
- * @returns {number}
517
- */
518
- get ubit6be() {
519
- return this.bit(6, true, "big");
520
- }
521
- /**
522
- * Bit field reader. Reads 7 bits.
523
- *
524
- * Note: When returning to a byte read, remaining bits are dropped.
525
- *
526
- * @returns {number}
527
- */
528
- get bit7() {
529
- return this.bit(7);
530
- }
531
- /**
532
- * Bit field reader. Reads 7 bits.
533
- *
534
- * Note: When returning to a byte read, remaining bits are dropped.
535
- *
536
- * @returns {number}
537
- */
538
- get bit7le() {
539
- return this.bit(7, undefined, "little");
540
- }
541
- /**
542
- * Bit field reader. Reads 7 bits.
543
- *
544
- * Note: When returning to a byte read, remaining bits are dropped.
545
- *
546
- * @returns {number}
547
- */
548
- get bit7be() {
549
- return this.bit(7, undefined, "big");
550
- }
551
- /**
552
- * Bit field reader. Reads 7 bits.
553
- *
554
- * Note: When returning to a byte read, remaining bits are dropped.
555
- *
556
- * @returns {number}
557
- */
558
- get ubit7() {
559
- return this.bit(7, true);
560
- }
561
- /**
562
- * Bit field reader. Reads 7 bits.
563
- *
564
- * Note: When returning to a byte read, remaining bits are dropped.
565
- *
566
- * @returns {number}
567
- */
568
- get ubit7le() {
569
- return this.bit(7, true, "little");
570
- }
571
- /**
572
- * Bit field reader. Reads 7 bits.
573
- *
574
- * Note: When returning to a byte read, remaining bits are dropped.
575
- *
576
- * @returns {number}
577
- */
578
- get ubit7be() {
579
- return this.bit(7, true, "big");
580
- }
581
- /**
582
- * Bit field reader. Reads 8 bits.
583
- *
584
- * Note: When returning to a byte read, remaining bits are dropped.
585
- *
586
- * @returns {number}
587
- */
588
- get bit8() {
589
- return this.bit(8);
590
- }
591
- /**
592
- * Bit field reader. Reads 8 bits.
593
- *
594
- * Note: When returning to a byte read, remaining bits are dropped.
595
- *
596
- * @returns {number}
597
- */
598
- get bit8le() {
599
- return this.bit(8, undefined, "little");
600
- }
601
- /**
602
- * Bit field reader. Reads 8 bits.
603
- *
604
- * Note: When returning to a byte read, remaining bits are dropped.
605
- *
606
- * @returns {number}
607
- */
608
- get bit8be() {
609
- return this.bit(8, undefined, "big");
610
- }
611
- /**
612
- * Bit field reader. Reads 8 bits.
613
- *
614
- * Note: When returning to a byte read, remaining bits are dropped.
615
- *
616
- * @returns {number}
617
- */
618
- get ubit8() {
619
- return this.bit(8, true);
620
- }
621
- /**
622
- * Bit field reader. Reads 8 bits.
623
- *
624
- * Note: When returning to a byte read, remaining bits are dropped.
625
- *
626
- * @returns {number}
627
- */
628
- get ubit8le() {
629
- return this.bit(8, true, "little");
630
- }
631
- /**
632
- * Bit field reader. Reads 8 bits.
633
- *
634
- * Note: When returning to a byte read, remaining bits are dropped.
635
- *
636
- * @returns {number}
637
- */
638
- get ubit8be() {
639
- return this.bit(8, true, "big");
640
- }
641
- /**
642
- * Bit field reader. Reads 9 bits.
643
- *
644
- * Note: When returning to a byte read, remaining bits are dropped.
645
- *
646
- * @returns {number}
647
- */
648
- get bit9() {
649
- return this.bit(9);
650
- }
651
- /**
652
- * Bit field reader. Reads 9 bits.
653
- *
654
- * Note: When returning to a byte read, remaining bits are dropped.
655
- *
656
- * @returns {number}
657
- */
658
- get bit9le() {
659
- return this.bit(9, undefined, "little");
660
- }
661
- /**
662
- * Bit field reader. Reads 9 bits.
663
- *
664
- * Note: When returning to a byte read, remaining bits are dropped.
665
- *
666
- * @returns {number}
667
- */
668
- get bit9be() {
669
- return this.bit(9, undefined, "big");
670
- }
671
- /**
672
- * Bit field reader. Reads 9 bits.
673
- *
674
- * Note: When returning to a byte read, remaining bits are dropped.
675
- *
676
- * @returns {number}
677
- */
678
- get ubit9() {
679
- return this.bit(9, true);
680
- }
681
- /**
682
- * Bit field reader. Reads 9 bits.
683
- *
684
- * Note: When returning to a byte read, remaining bits are dropped.
685
- *
686
- * @returns {number}
687
- */
688
- get ubit9le() {
689
- return this.bit(9, true, "little");
690
- }
691
- /**
692
- * Bit field reader. Reads 9 bits.
693
- *
694
- * Note: When returning to a byte read, remaining bits are dropped.
695
- *
696
- * @returns {number}
697
- */
698
- get ubit9be() {
699
- return this.bit(9, true, "big");
700
- }
701
- /**
702
- * Bit field reader. Reads 10 bits.
703
- *
704
- * Note: When returning to a byte read, remaining bits are dropped.
705
- *
706
- * @returns {number}
707
- */
708
- get bit10() {
709
- return this.bit(10);
710
- }
711
- /**
712
- * Bit field reader. Reads 10 bits.
713
- *
714
- * Note: When returning to a byte read, remaining bits are dropped.
715
- *
716
- * @returns {number}
717
- */
718
- get bit10le() {
719
- return this.bit(10, undefined, "little");
720
- }
721
- /**
722
- * Bit field reader. Reads 10 bits.
723
- *
724
- * Note: When returning to a byte read, remaining bits are dropped.
725
- *
726
- * @returns {number}
727
- */
728
- get bit10be() {
729
- return this.bit(10, undefined, "big");
730
- }
731
- /**
732
- * Bit field reader. Reads 10 bits.
733
- *
734
- * Note: When returning to a byte read, remaining bits are dropped.
735
- *
736
- * @returns {number}
737
- */
738
- get ubit10() {
739
- return this.bit(10, true);
740
- }
741
- /**
742
- * Bit field reader. Reads 10 bits.
743
- *
744
- * Note: When returning to a byte read, remaining bits are dropped.
745
- *
746
- * @returns {number}
747
- */
748
- get ubit10le() {
749
- return this.bit(10, true, "little");
750
- }
751
- /**
752
- * Bit field reader. Reads 10 bits.
753
- *
754
- * Note: When returning to a byte read, remaining bits are dropped.
755
- *
756
- * @returns {number}
757
- */
758
- get ubit10be() {
759
- return this.bit(10, true, "big");
760
- }
761
- /**
762
- * Bit field reader. Reads 11 bits.
763
- *
764
- * Note: When returning to a byte read, remaining bits are dropped.
765
- *
766
- * @returns {number}
767
- */
768
- get bit11() {
769
- return this.bit(11);
770
- }
771
- /**
772
- * Bit field reader. Reads 11 bits.
773
- *
774
- * Note: When returning to a byte read, remaining bits are dropped.
775
- *
776
- * @returns {number}
777
- */
778
- get bit11le() {
779
- return this.bit(11, undefined, "little");
780
- }
781
- /**
782
- * Bit field reader. Reads 11 bits.
783
- *
784
- * Note: When returning to a byte read, remaining bits are dropped.
785
- *
786
- * @returns {number}
787
- */
788
- get bit11be() {
789
- return this.bit(11, undefined, "big");
790
- }
791
- /**
792
- * Bit field reader. Reads 11 bits.
793
- *
794
- * Note: When returning to a byte read, remaining bits are dropped.
795
- *
796
- * @returns {number}
797
- */
798
- get ubit11() {
799
- return this.bit(11, true);
800
- }
801
- /**
802
- * Bit field reader. Reads 11 bits.
803
- *
804
- * Note: When returning to a byte read, remaining bits are dropped.
805
- *
806
- * @returns {number}
807
- */
808
- get ubit11le() {
809
- return this.bit(11, true, "little");
810
- }
811
- /**
812
- * Bit field reader. Reads 11 bits.
813
- *
814
- * Note: When returning to a byte read, remaining bits are dropped.
815
- *
816
- * @returns {number}
817
- */
818
- get ubit11be() {
819
- return this.bit(11, true, "big");
820
- }
821
- /**
822
- * Bit field reader. Reads 12 bits.
823
- *
824
- * Note: When returning to a byte read, remaining bits are dropped.
825
- *
826
- * @returns {number}
827
- */
828
- get bit12() {
829
- return this.bit(12);
830
- }
831
- /**
832
- * Bit field reader. Reads 12 bits.
833
- *
834
- * Note: When returning to a byte read, remaining bits are dropped.
835
- *
836
- * @returns {number}
837
- */
838
- get bit12le() {
839
- return this.bit(12, undefined, "little");
840
- }
841
- /**
842
- * Bit field reader. Reads 12 bits.
843
- *
844
- * Note: When returning to a byte read, remaining bits are dropped.
845
- *
846
- * @returns {number}
847
- */
848
- get bit12be() {
849
- return this.bit(12, undefined, "big");
850
- }
851
- /**
852
- * Bit field reader. Reads 12 bits.
853
- *
854
- * Note: When returning to a byte read, remaining bits are dropped.
855
- *
856
- * @returns {number}
857
- */
858
- get ubit12() {
859
- return this.bit(12, true);
860
- }
861
- /**
862
- * Bit field reader. Reads 12 bits.
863
- *
864
- * Note: When returning to a byte read, remaining bits are dropped.
865
- *
866
- * @returns {number}
867
- */
868
- get ubit12le() {
869
- return this.bit(12, true, "little");
870
- }
871
- /**
872
- * Bit field reader. Reads 12 bits.
873
- *
874
- * Note: When returning to a byte read, remaining bits are dropped.
875
- *
876
- * @returns {number}
877
- */
878
- get ubit12be() {
879
- return this.bit(12, true, "big");
880
- }
881
- /**
882
- * Bit field reader. Reads 13 bits.
883
- *
884
- * Note: When returning to a byte read, remaining bits are dropped.
885
- *
886
- * @returns {number}
887
- */
888
- get bit13() {
889
- return this.bit(13);
890
- }
891
- /**
892
- * Bit field reader. Reads 13 bits.
893
- *
894
- * Note: When returning to a byte read, remaining bits are dropped.
895
- *
896
- * @returns {number}
897
- */
898
- get bit13le() {
899
- return this.bit(13, undefined, "little");
900
- }
901
- /**
902
- * Bit field reader. Reads 13 bits.
903
- *
904
- * Note: When returning to a byte read, remaining bits are dropped.
905
- *
906
- * @returns {number}
907
- */
908
- get bit13be() {
909
- return this.bit(13, undefined, "big");
910
- }
911
- /**
912
- * Bit field reader. Reads 13 bits.
913
- *
914
- * Note: When returning to a byte read, remaining bits are dropped.
915
- *
916
- * @returns {number}
917
- */
918
- get ubit13() {
919
- return this.bit(13, true);
920
- }
921
- /**
922
- * Bit field reader. Reads 13 bits.
923
- *
924
- * Note: When returning to a byte read, remaining bits are dropped.
925
- *
926
- * @returns {number}
927
- */
928
- get ubit13le() {
929
- return this.bit(13, true, "little");
930
- }
931
- /**
932
- * Bit field reader. Reads 13 bits.
933
- *
934
- * Note: When returning to a byte read, remaining bits are dropped.
935
- *
936
- * @returns {number}
937
- */
938
- get ubit13be() {
939
- return this.bit(13, true, "big");
940
- }
941
- /**
942
- * Bit field reader. Reads 14 bits.
943
- *
944
- * Note: When returning to a byte read, remaining bits are dropped.
945
- *
946
- * @returns {number}
947
- */
948
- get bit14() {
949
- return this.bit(14);
950
- }
951
- /**
952
- * Bit field reader. Reads 14 bits.
953
- *
954
- * Note: When returning to a byte read, remaining bits are dropped.
955
- *
956
- * @returns {number}
957
- */
958
- get bit14le() {
959
- return this.bit(14, undefined, "little");
960
- }
961
- /**
962
- * Bit field reader. Reads 14 bits.
963
- *
964
- * Note: When returning to a byte read, remaining bits are dropped.
965
- *
966
- * @returns {number}
967
- */
968
- get bit14be() {
969
- return this.bit(14, undefined, "big");
970
- }
971
- /**
972
- * Bit field reader. Reads 14 bits.
973
- *
974
- * Note: When returning to a byte read, remaining bits are dropped.
975
- *
976
- * @returns {number}
977
- */
978
- get ubit14() {
979
- return this.bit(14, true);
980
- }
981
- /**
982
- * Bit field reader. Reads 14 bits.
983
- *
984
- * Note: When returning to a byte read, remaining bits are dropped.
985
- *
986
- * @returns {number}
987
- */
988
- get ubit14le() {
989
- return this.bit(14, true, "little");
990
- }
991
- /**
992
- * Bit field reader. Reads 14 bits.
993
- *
994
- * Note: When returning to a byte read, remaining bits are dropped.
995
- *
996
- * @returns {number}
997
- */
998
- get ubit14be() {
999
- return this.bit(14, true, "big");
1000
- }
1001
- /**
1002
- * Bit field reader. Reads 15 bits.
1003
- *
1004
- * Note: When returning to a byte read, remaining bits are dropped.
1005
- *
1006
- * @returns {number}
1007
- */
1008
- get bit15() {
1009
- return this.bit(15);
1010
- }
1011
- /**
1012
- * Bit field reader. Reads 15 bits.
1013
- *
1014
- * Note: When returning to a byte read, remaining bits are dropped.
1015
- *
1016
- * @returns {number}
1017
- */
1018
- get bit15le() {
1019
- return this.bit(15, undefined, "little");
1020
- }
1021
- /**
1022
- * Bit field reader. Reads 15 bits.
1023
- *
1024
- * Note: When returning to a byte read, remaining bits are dropped.
1025
- *
1026
- * @returns {number}
1027
- */
1028
- get bit15be() {
1029
- return this.bit(15, undefined, "big");
1030
- }
1031
- /**
1032
- * Bit field reader. Reads 15 bits.
1033
- *
1034
- * Note: When returning to a byte read, remaining bits are dropped.
1035
- *
1036
- * @returns {number}
1037
- */
1038
- get ubit15() {
1039
- return this.bit(15, true);
1040
- }
1041
- /**
1042
- * Bit field reader. Reads 15 bits.
1043
- *
1044
- * Note: When returning to a byte read, remaining bits are dropped.
1045
- *
1046
- * @returns {number}
1047
- */
1048
- get ubit15le() {
1049
- return this.bit(15, true, "little");
1050
- }
1051
- /**
1052
- * Bit field reader. Reads 15 bits.
1053
- *
1054
- * Note: When returning to a byte read, remaining bits are dropped.
1055
- *
1056
- * @returns {number}
1057
- */
1058
- get ubit15be() {
1059
- return this.bit(15, true, "big");
1060
- }
1061
- /**
1062
- * Bit field reader. Reads 16 bits.
1063
- *
1064
- * Note: When returning to a byte read, remaining bits are dropped.
1065
- *
1066
- * @returns {number}
1067
- */
1068
- get bit16() {
1069
- return this.bit(16);
1070
- }
1071
- /**
1072
- * Bit field reader. Reads 16 bits.
1073
- *
1074
- * Note: When returning to a byte read, remaining bits are dropped.
1075
- *
1076
- * @returns {number}
1077
- */
1078
- get bit16le() {
1079
- return this.bit(16, undefined, "little");
1080
- }
1081
- /**
1082
- * Bit field reader. Reads 16 bits.
1083
- *
1084
- * Note: When returning to a byte read, remaining bits are dropped.
1085
- *
1086
- * @returns {number}
1087
- */
1088
- get bit16be() {
1089
- return this.bit(16, undefined, "big");
1090
- }
1091
- /**
1092
- * Bit field reader. Reads 16 bits.
1093
- *
1094
- * Note: When returning to a byte read, remaining bits are dropped.
1095
- *
1096
- * @returns {number}
1097
- */
1098
- get ubit16() {
1099
- return this.bit(16, true);
1100
- }
1101
- /**
1102
- * Bit field reader. Reads 16 bits.
1103
- *
1104
- * Note: When returning to a byte read, remaining bits are dropped.
1105
- *
1106
- * @returns {number}
1107
- */
1108
- get ubit16le() {
1109
- return this.bit(16, true, "little");
1110
- }
1111
- /**
1112
- * Bit field reader. Reads 16 bits.
1113
- *
1114
- * Note: When returning to a byte read, remaining bits are dropped.
1115
- *
1116
- * @returns {number}
1117
- */
1118
- get ubit16be() {
1119
- return this.bit(16, true, "big");
1120
- }
1121
- /**
1122
- * Bit field reader. Reads 17 bits.
1123
- *
1124
- * Note: When returning to a byte read, remaining bits are dropped.
1125
- *
1126
- * @returns {number}
1127
- */
1128
- get bit17() {
1129
- return this.bit(17);
1130
- }
1131
- /**
1132
- * Bit field reader. Reads 17 bits.
1133
- *
1134
- * Note: When returning to a byte read, remaining bits are dropped.
1135
- *
1136
- * @returns {number}
1137
- */
1138
- get bit17le() {
1139
- return this.bit(17, undefined, "little");
1140
- }
1141
- /**
1142
- * Bit field reader. Reads 17 bits.
1143
- *
1144
- * Note: When returning to a byte read, remaining bits are dropped.
1145
- *
1146
- * @returns {number}
1147
- */
1148
- get bit17be() {
1149
- return this.bit(17, undefined, "big");
1150
- }
1151
- /**
1152
- * Bit field reader. Reads 17 bits.
1153
- *
1154
- * Note: When returning to a byte read, remaining bits are dropped.
1155
- *
1156
- * @returns {number}
1157
- */
1158
- get ubit17() {
1159
- return this.bit(17, true);
1160
- }
1161
- /**
1162
- * Bit field reader. Reads 17 bits.
1163
- *
1164
- * Note: When returning to a byte read, remaining bits are dropped.
1165
- *
1166
- * @returns {number}
1167
- */
1168
- get ubit17le() {
1169
- return this.bit(17, true, "little");
1170
- }
1171
- /**
1172
- * Bit field reader. Reads 17 bits.
1173
- *
1174
- * Note: When returning to a byte read, remaining bits are dropped.
1175
- *
1176
- * @returns {number}
1177
- */
1178
- get ubit17be() {
1179
- return this.bit(17, true, "big");
1180
- }
1181
- /**
1182
- * Bit field reader. Reads 18 bits.
1183
- *
1184
- * Note: When returning to a byte read, remaining bits are dropped.
1185
- *
1186
- * @returns {number}
1187
- */
1188
- get bit18() {
1189
- return this.bit(18);
1190
- }
1191
- /**
1192
- * Bit field reader. Reads 18 bits.
1193
- *
1194
- * Note: When returning to a byte read, remaining bits are dropped.
1195
- *
1196
- * @returns {number}
1197
- */
1198
- get bit18le() {
1199
- return this.bit(18, undefined, "little");
1200
- }
1201
- /**
1202
- * Bit field reader. Reads 18 bits.
1203
- *
1204
- * Note: When returning to a byte read, remaining bits are dropped.
1205
- *
1206
- * @returns {number}
1207
- */
1208
- get bit18be() {
1209
- return this.bit(18, undefined, "big");
1210
- }
1211
- /**
1212
- * Bit field reader. Reads 18 bits.
1213
- *
1214
- * Note: When returning to a byte read, remaining bits are dropped.
1215
- *
1216
- * @returns {number}
1217
- */
1218
- get ubit18() {
1219
- return this.bit(18, true);
1220
- }
1221
- /**
1222
- * Bit field reader. Reads 18 bits.
1223
- *
1224
- * Note: When returning to a byte read, remaining bits are dropped.
1225
- *
1226
- * @returns {number}
1227
- */
1228
- get ubit18le() {
1229
- return this.bit(18, true, "little");
1230
- }
1231
- /**
1232
- * Bit field reader. Reads 18 bits.
1233
- *
1234
- * Note: When returning to a byte read, remaining bits are dropped.
1235
- *
1236
- * @returns {number}
1237
- */
1238
- get ubit18be() {
1239
- return this.bit(18, true, "big");
1240
- }
1241
- /**
1242
- * Bit field reader. Reads 19 bits.
1243
- *
1244
- * Note: When returning to a byte read, remaining bits are dropped.
1245
- *
1246
- * @returns {number}
1247
- */
1248
- get bit19() {
1249
- return this.bit(19);
1250
- }
1251
- /**
1252
- * Bit field reader. Reads 19 bits.
1253
- *
1254
- * Note: When returning to a byte read, remaining bits are dropped.
1255
- *
1256
- * @returns {number}
1257
- */
1258
- get bit19le() {
1259
- return this.bit(19, undefined, "little");
1260
- }
1261
- /**
1262
- * Bit field reader. Reads 19 bits.
1263
- *
1264
- * Note: When returning to a byte read, remaining bits are dropped.
1265
- *
1266
- * @returns {number}
1267
- */
1268
- get bit19be() {
1269
- return this.bit(19, undefined, "big");
1270
- }
1271
- /**
1272
- * Bit field reader. Reads 19 bits.
1273
- *
1274
- * Note: When returning to a byte read, remaining bits are dropped.
1275
- *
1276
- * @returns {number}
1277
- */
1278
- get ubit19() {
1279
- return this.bit(19, true);
1280
- }
1281
- /**
1282
- * Bit field reader. Reads 19 bits.
1283
- *
1284
- * Note: When returning to a byte read, remaining bits are dropped.
1285
- *
1286
- * @returns {number}
1287
- */
1288
- get ubit19le() {
1289
- return this.bit(19, true, "little");
1290
- }
1291
- /**
1292
- * Bit field reader. Reads 19 bits.
1293
- *
1294
- * Note: When returning to a byte read, remaining bits are dropped.
1295
- *
1296
- * @returns {number}
1297
- */
1298
- get ubit19be() {
1299
- return this.bit(19, true, "big");
1300
- }
1301
- /**
1302
- * Bit field reader. Reads 20 bits.
1303
- *
1304
- * Note: When returning to a byte read, remaining bits are dropped.
1305
- *
1306
- * @returns {number}
1307
- */
1308
- get bit20() {
1309
- return this.bit(20);
1310
- }
1311
- /**
1312
- * Bit field reader. Reads 20 bits.
1313
- *
1314
- * Note: When returning to a byte read, remaining bits are dropped.
1315
- *
1316
- * @returns {number}
1317
- */
1318
- get bit20le() {
1319
- return this.bit(20, undefined, "little");
1320
- }
1321
- /**
1322
- * Bit field reader. Reads 20 bits.
1323
- *
1324
- * Note: When returning to a byte read, remaining bits are dropped.
1325
- *
1326
- * @returns {number}
1327
- */
1328
- get bit20be() {
1329
- return this.bit(20, undefined, "big");
1330
- }
1331
- /**
1332
- * Bit field reader. Reads 20 bits.
1333
- *
1334
- * Note: When returning to a byte read, remaining bits are dropped.
1335
- *
1336
- * @returns {number}
1337
- */
1338
- get ubit20() {
1339
- return this.bit(20, true);
1340
- }
1341
- /**
1342
- * Bit field reader. Reads 20 bits.
1343
- *
1344
- * Note: When returning to a byte read, remaining bits are dropped.
1345
- *
1346
- * @returns {number}
1347
- */
1348
- get ubit20le() {
1349
- return this.bit(20, true, "little");
1350
- }
1351
- /**
1352
- * Bit field reader. Reads 20 bits.
1353
- *
1354
- * Note: When returning to a byte read, remaining bits are dropped.
1355
- *
1356
- * @returns {number}
1357
- */
1358
- get ubit20be() {
1359
- return this.bit(20, true, "big");
1360
- }
1361
- /**
1362
- * Bit field reader. Reads 21 bits.
1363
- *
1364
- * Note: When returning to a byte read, remaining bits are dropped.
1365
- *
1366
- * @returns {number}
1367
- */
1368
- get bit21() {
1369
- return this.bit(21);
1370
- }
1371
- /**
1372
- * Bit field reader. Reads 21 bits.
1373
- *
1374
- * Note: When returning to a byte read, remaining bits are dropped.
1375
- *
1376
- * @returns {number}
1377
- */
1378
- get bit21le() {
1379
- return this.bit(21, undefined, "little");
1380
- }
1381
- /**
1382
- * Bit field reader. Reads 21 bits.
1383
- *
1384
- * Note: When returning to a byte read, remaining bits are dropped.
1385
- *
1386
- * @returns {number}
1387
- */
1388
- get bit21be() {
1389
- return this.bit(21, undefined, "big");
1390
- }
1391
- /**
1392
- * Bit field reader. Reads 21 bits.
1393
- *
1394
- * Note: When returning to a byte read, remaining bits are dropped.
1395
- *
1396
- * @returns {number}
1397
- */
1398
- get ubit21() {
1399
- return this.bit(21, true);
1400
- }
1401
- /**
1402
- * Bit field reader. Reads 21 bits.
1403
- *
1404
- * Note: When returning to a byte read, remaining bits are dropped.
1405
- *
1406
- * @returns {number}
1407
- */
1408
- get ubit21le() {
1409
- return this.bit(21, true, "little");
1410
- }
1411
- /**
1412
- * Bit field reader. Reads 21 bits.
1413
- *
1414
- * Note: When returning to a byte read, remaining bits are dropped.
1415
- *
1416
- * @returns {number}
1417
- */
1418
- get ubit21be() {
1419
- return this.bit(21, true, "big");
1420
- }
1421
- /**
1422
- * Bit field reader. Reads 22 bits.
1423
- *
1424
- * Note: When returning to a byte read, remaining bits are dropped.
1425
- *
1426
- * @returns {number}
1427
- */
1428
- get bit22() {
1429
- return this.bit(22);
1430
- }
1431
- /**
1432
- * Bit field reader. Reads 22 bits.
1433
- *
1434
- * Note: When returning to a byte read, remaining bits are dropped.
1435
- *
1436
- * @returns {number}
1437
- */
1438
- get bit22le() {
1439
- return this.bit(22, undefined, "little");
1440
- }
1441
- /**
1442
- * Bit field reader. Reads 22 bits.
1443
- *
1444
- * Note: When returning to a byte read, remaining bits are dropped.
1445
- *
1446
- * @returns {number}
1447
- */
1448
- get bit22be() {
1449
- return this.bit(22, undefined, "big");
1450
- }
1451
- /**
1452
- * Bit field reader. Reads 22 bits.
1453
- *
1454
- * Note: When returning to a byte read, remaining bits are dropped.
1455
- *
1456
- * @returns {number}
1457
- */
1458
- get ubit22() {
1459
- return this.bit(22, true);
1460
- }
1461
- /**
1462
- * Bit field reader. Reads 22 bits.
1463
- *
1464
- * Note: When returning to a byte read, remaining bits are dropped.
1465
- *
1466
- * @returns {number}
1467
- */
1468
- get ubit22le() {
1469
- return this.bit(22, true, "little");
1470
- }
1471
- /**
1472
- * Bit field reader. Reads 22 bits.
1473
- *
1474
- * Note: When returning to a byte read, remaining bits are dropped.
1475
- *
1476
- * @returns {number}
1477
- */
1478
- get ubit22be() {
1479
- return this.bit(22, true, "big");
1480
- }
1481
- /**
1482
- * Bit field reader. Reads 23 bits.
1483
- *
1484
- * Note: When returning to a byte read, remaining bits are dropped.
1485
- *
1486
- * @returns {number}
1487
- */
1488
- get bit23() {
1489
- return this.bit(23);
1490
- }
1491
- /**
1492
- * Bit field reader. Reads 23 bits.
1493
- *
1494
- * Note: When returning to a byte read, remaining bits are dropped.
1495
- *
1496
- * @returns {number}
1497
- */
1498
- get bit23le() {
1499
- return this.bit(23, undefined, "little");
1500
- }
1501
- /**
1502
- * Bit field reader. Reads 23 bits.
1503
- *
1504
- * Note: When returning to a byte read, remaining bits are dropped.
1505
- *
1506
- * @returns {number}
1507
- */
1508
- get bit23be() {
1509
- return this.bit(23, undefined, "big");
1510
- }
1511
- /**
1512
- * Bit field reader. Reads 23 bits.
1513
- *
1514
- * Note: When returning to a byte read, remaining bits are dropped.
1515
- *
1516
- * @returns {number}
1517
- */
1518
- get ubit23() {
1519
- return this.bit(23, true);
1520
- }
1521
- /**
1522
- * Bit field reader. Reads 23 bits.
1523
- *
1524
- * Note: When returning to a byte read, remaining bits are dropped.
1525
- *
1526
- * @returns {number}
1527
- */
1528
- get ubit23le() {
1529
- return this.bit(23, true, "little");
1530
- }
1531
- /**
1532
- * Bit field reader. Reads 23 bits.
1533
- *
1534
- * Note: When returning to a byte read, remaining bits are dropped.
1535
- *
1536
- * @returns {number}
1537
- */
1538
- get ubit23be() {
1539
- return this.bit(23, true, "big");
1540
- }
1541
- /**
1542
- * Bit field reader. Reads 24 bits.
1543
- *
1544
- * Note: When returning to a byte read, remaining bits are dropped.
1545
- *
1546
- * @returns {number}
1547
- */
1548
- get bit24() {
1549
- return this.bit(24);
1550
- }
1551
- /**
1552
- * Bit field reader. Reads 24 bits.
1553
- *
1554
- * Note: When returning to a byte read, remaining bits are dropped.
1555
- *
1556
- * @returns {number}
1557
- */
1558
- get bit24le() {
1559
- return this.bit(24, undefined, "little");
1560
- }
1561
- /**
1562
- * Bit field reader. Reads 24 bits.
1563
- *
1564
- * Note: When returning to a byte read, remaining bits are dropped.
1565
- *
1566
- * @returns {number}
1567
- */
1568
- get bit24be() {
1569
- return this.bit(24, undefined, "big");
1570
- }
1571
- /**
1572
- * Bit field reader. Reads 24 bits.
1573
- *
1574
- * Note: When returning to a byte read, remaining bits are dropped.
1575
- *
1576
- * @returns {number}
1577
- */
1578
- get ubit24() {
1579
- return this.bit(24, true);
1580
- }
1581
- /**
1582
- * Bit field reader. Reads 24 bits.
1583
- *
1584
- * Note: When returning to a byte read, remaining bits are dropped.
1585
- *
1586
- * @returns {number}
1587
- */
1588
- get ubit24le() {
1589
- return this.bit(24, true, "little");
1590
- }
1591
- /**
1592
- * Bit field reader. Reads 24 bits.
1593
- *
1594
- * Note: When returning to a byte read, remaining bits are dropped.
1595
- *
1596
- * @returns {number}
1597
- */
1598
- get ubit24be() {
1599
- return this.bit(24, true, "big");
1600
- }
1601
- /**
1602
- * Bit field reader. Reads 25 bits.
1603
- *
1604
- * Note: When returning to a byte read, remaining bits are dropped.
1605
- *
1606
- * @returns {number}
1607
- */
1608
- get bit25() {
1609
- return this.bit(25);
1610
- }
1611
- /**
1612
- * Bit field reader. Reads 25 bits.
1613
- *
1614
- * Note: When returning to a byte read, remaining bits are dropped.
1615
- *
1616
- * @returns {number}
1617
- */
1618
- get bit25le() {
1619
- return this.bit(25, undefined, "little");
1620
- }
1621
- /**
1622
- * Bit field reader. Reads 25 bits.
1623
- *
1624
- * Note: When returning to a byte read, remaining bits are dropped.
1625
- *
1626
- * @returns {number}
1627
- */
1628
- get bit25be() {
1629
- return this.bit(25, undefined, "big");
1630
- }
1631
- /**
1632
- * Bit field reader. Reads 25 bits.
1633
- *
1634
- * Note: When returning to a byte read, remaining bits are dropped.
1635
- *
1636
- * @returns {number}
1637
- */
1638
- get ubit25() {
1639
- return this.bit(25, true);
1640
- }
1641
- /**
1642
- * Bit field reader. Reads 25 bits.
1643
- *
1644
- * Note: When returning to a byte read, remaining bits are dropped.
1645
- *
1646
- * @returns {number}
1647
- */
1648
- get ubit25le() {
1649
- return this.bit(25, true, "little");
1650
- }
1651
- /**
1652
- * Bit field reader. Reads 25 bits.
1653
- *
1654
- * Note: When returning to a byte read, remaining bits are dropped.
1655
- *
1656
- * @returns {number}
1657
- */
1658
- get ubit25be() {
1659
- return this.bit(25, true, "big");
1660
- }
1661
- /**
1662
- * Bit field reader. Reads 26 bits.
1663
- *
1664
- * Note: When returning to a byte read, remaining bits are dropped.
1665
- *
1666
- * @returns {number}
1667
- */
1668
- get bit26() {
1669
- return this.bit(26);
1670
- }
1671
- /**
1672
- * Bit field reader. Reads 26 bits.
1673
- *
1674
- * Note: When returning to a byte read, remaining bits are dropped.
1675
- *
1676
- * @returns {number}
1677
- */
1678
- get bit26le() {
1679
- return this.bit(26, undefined, "little");
1680
- }
1681
- /**
1682
- * Bit field reader. Reads 26 bits.
1683
- *
1684
- * Note: When returning to a byte read, remaining bits are dropped.
1685
- *
1686
- * @returns {number}
1687
- */
1688
- get bit26be() {
1689
- return this.bit(26, undefined, "big");
1690
- }
1691
- /**
1692
- * Bit field reader. Reads 26 bits.
1693
- *
1694
- * Note: When returning to a byte read, remaining bits are dropped.
1695
- *
1696
- * @returns {number}
1697
- */
1698
- get ubit26() {
1699
- return this.bit(26, true);
1700
- }
1701
- /**
1702
- * Bit field reader. Reads 26 bits.
1703
- *
1704
- * Note: When returning to a byte read, remaining bits are dropped.
1705
- *
1706
- * @returns {number}
1707
- */
1708
- get ubit26le() {
1709
- return this.bit(26, true, "little");
1710
- }
1711
- /**
1712
- * Bit field reader. Reads 26 bits.
1713
- *
1714
- * Note: When returning to a byte read, remaining bits are dropped.
1715
- *
1716
- * @returns {number}
1717
- */
1718
- get ubit26be() {
1719
- return this.bit(26, true, "big");
1720
- }
1721
- /**
1722
- * Bit field reader. Reads 27 bits.
1723
- *
1724
- * Note: When returning to a byte read, remaining bits are dropped.
1725
- *
1726
- * @returns {number}
1727
- */
1728
- get bit27() {
1729
- return this.bit(27);
1730
- }
1731
- /**
1732
- * Bit field reader. Reads 27 bits.
1733
- *
1734
- * Note: When returning to a byte read, remaining bits are dropped.
1735
- *
1736
- * @returns {number}
1737
- */
1738
- get bit27le() {
1739
- return this.bit(27, undefined, "little");
1740
- }
1741
- /**
1742
- * Bit field reader. Reads 27 bits.
1743
- *
1744
- * Note: When returning to a byte read, remaining bits are dropped.
1745
- *
1746
- * @returns {number}
1747
- */
1748
- get bit27be() {
1749
- return this.bit(27, undefined, "big");
1750
- }
1751
- /**
1752
- * Bit field reader. Reads 27 bits.
1753
- *
1754
- * Note: When returning to a byte read, remaining bits are dropped.
1755
- *
1756
- * @returns {number}
1757
- */
1758
- get ubit27() {
1759
- return this.bit(27, true);
1760
- }
1761
- /**
1762
- * Bit field reader. Reads 27 bits.
1763
- *
1764
- * Note: When returning to a byte read, remaining bits are dropped.
1765
- *
1766
- * @returns {number}
1767
- */
1768
- get ubit27le() {
1769
- return this.bit(27, true, "little");
1770
- }
1771
- /**
1772
- * Bit field reader. Reads 27 bits.
1773
- *
1774
- * Note: When returning to a byte read, remaining bits are dropped.
1775
- *
1776
- * @returns {number}
1777
- */
1778
- get ubit27be() {
1779
- return this.bit(27, true, "big");
1780
- }
1781
- /**
1782
- * Bit field reader. Reads 28 bits.
1783
- *
1784
- * Note: When returning to a byte read, remaining bits are dropped.
1785
- *
1786
- * @returns {number}
1787
- */
1788
- get bit28() {
1789
- return this.bit(28);
1790
- }
1791
- /**
1792
- * Bit field reader. Reads 28 bits.
1793
- *
1794
- * Note: When returning to a byte read, remaining bits are dropped.
1795
- *
1796
- * @returns {number}
1797
- */
1798
- get bit28le() {
1799
- return this.bit(28, undefined, "little");
1800
- }
1801
- /**
1802
- * Bit field reader. Reads 28 bits.
1803
- *
1804
- * Note: When returning to a byte read, remaining bits are dropped.
1805
- *
1806
- * @returns {number}
1807
- */
1808
- get bit28be() {
1809
- return this.bit(28, undefined, "big");
1810
- }
1811
- /**
1812
- * Bit field reader. Reads 28 bits.
1813
- *
1814
- * Note: When returning to a byte read, remaining bits are dropped.
1815
- *
1816
- * @returns {number}
1817
- */
1818
- get ubit28() {
1819
- return this.bit(28, true);
1820
- }
1821
- /**
1822
- * Bit field reader. Reads 28 bits.
1823
- *
1824
- * Note: When returning to a byte read, remaining bits are dropped.
1825
- *
1826
- * @returns {number}
1827
- */
1828
- get ubit28le() {
1829
- return this.bit(28, true, "little");
1830
- }
1831
- /**
1832
- * Bit field reader. Reads 28 bits.
1833
- *
1834
- * Note: When returning to a byte read, remaining bits are dropped.
1835
- *
1836
- * @returns {number}
1837
- */
1838
- get ubit28be() {
1839
- return this.bit(28, true, "big");
1840
- }
1841
- /**
1842
- * Bit field reader. Reads 29 bits.
1843
- *
1844
- * Note: When returning to a byte read, remaining bits are dropped.
1845
- *
1846
- * @returns {number}
1847
- */
1848
- get bit29() {
1849
- return this.bit(29);
1850
- }
1851
- /**
1852
- * Bit field reader. Reads 29 bits.
1853
- *
1854
- * Note: When returning to a byte read, remaining bits are dropped.
1855
- *
1856
- * @returns {number}
1857
- */
1858
- get bit29le() {
1859
- return this.bit(29, undefined, "little");
1860
- }
1861
- /**
1862
- * Bit field reader. Reads 29 bits.
1863
- *
1864
- * Note: When returning to a byte read, remaining bits are dropped.
1865
- *
1866
- * @returns {number}
1867
- */
1868
- get bit29be() {
1869
- return this.bit(29, undefined, "big");
1870
- }
1871
- /**
1872
- * Bit field reader. Reads 29 bits.
1873
- *
1874
- * Note: When returning to a byte read, remaining bits are dropped.
1875
- *
1876
- * @returns {number}
1877
- */
1878
- get ubit29() {
1879
- return this.bit(29, true);
1880
- }
1881
- /**
1882
- * Bit field reader. Reads 29 bits.
1883
- *
1884
- * Note: When returning to a byte read, remaining bits are dropped.
1885
- *
1886
- * @returns {number}
1887
- */
1888
- get ubit29le() {
1889
- return this.bit(29, true, "little");
1890
- }
1891
- /**
1892
- * Bit field reader. Reads 29 bits.
1893
- *
1894
- * Note: When returning to a byte read, remaining bits are dropped.
1895
- *
1896
- * @returns {number}
1897
- */
1898
- get ubit29be() {
1899
- return this.bit(29, true, "big");
1900
- }
1901
- /**
1902
- * Bit field reader. Reads 30 bits.
1903
- *
1904
- * Note: When returning to a byte read, remaining bits are dropped.
1905
- *
1906
- * @returns {number}
1907
- */
1908
- get bit30() {
1909
- return this.bit(30);
1910
- }
1911
- /**
1912
- * Bit field reader. Reads 30 bits.
1913
- *
1914
- * Note: When returning to a byte read, remaining bits are dropped.
1915
- *
1916
- * @returns {number}
1917
- */
1918
- get bit30le() {
1919
- return this.bit(30, undefined, "little");
1920
- }
1921
- /**
1922
- * Bit field reader. Reads 30 bits.
1923
- *
1924
- * Note: When returning to a byte read, remaining bits are dropped.
1925
- *
1926
- * @returns {number}
1927
- */
1928
- get bit30be() {
1929
- return this.bit(30, undefined, "big");
1930
- }
1931
- /**
1932
- * Bit field reader. Reads 30 bits.
1933
- *
1934
- * Note: When returning to a byte read, remaining bits are dropped.
1935
- *
1936
- * @returns {number}
1937
- */
1938
- get ubit30() {
1939
- return this.bit(30, true);
1940
- }
1941
- /**
1942
- * Bit field reader. Reads 30 bits.
1943
- *
1944
- * Note: When returning to a byte read, remaining bits are dropped.
1945
- *
1946
- * @returns {number}
1947
- */
1948
- get ubit30le() {
1949
- return this.bit(30, true, "little");
1950
- }
1951
- /**
1952
- * Bit field reader. Reads 30 bits.
1953
- *
1954
- * Note: When returning to a byte read, remaining bits are dropped.
1955
- *
1956
- * @returns {number}
1957
- */
1958
- get ubit30be() {
1959
- return this.bit(30, true, "big");
1960
- }
1961
- /**
1962
- * Bit field reader. Reads 31 bits.
1963
- *
1964
- * Note: When returning to a byte read, remaining bits are dropped.
1965
- *
1966
- * @returns {number}
1967
- */
1968
- get bit31() {
1969
- return this.bit(31);
1970
- }
1971
- /**
1972
- * Bit field reader. Reads 31 bits.
1973
- *
1974
- * Note: When returning to a byte read, remaining bits are dropped.
1975
- *
1976
- * @returns {number}
1977
- */
1978
- get bit31le() {
1979
- return this.bit(31, undefined, "little");
1980
- }
1981
- /**
1982
- * Bit field reader. Reads 31 bits.
1983
- *
1984
- * Note: When returning to a byte read, remaining bits are dropped.
1985
- *
1986
- * @returns {number}
1987
- */
1988
- get bit31be() {
1989
- return this.bit(31, undefined, "big");
1990
- }
1991
- /**
1992
- * Bit field reader. Reads 31 bits.
1993
- *
1994
- * Note: When returning to a byte read, remaining bits are dropped.
1995
- *
1996
- * @returns {number}
1997
- */
1998
- get ubit31() {
1999
- return this.bit(31, true);
2000
- }
2001
- /**
2002
- * Bit field reader. Reads 31 bits.
2003
- *
2004
- * Note: When returning to a byte read, remaining bits are dropped.
2005
- *
2006
- * @returns {number}
2007
- */
2008
- get ubit31le() {
2009
- return this.bit(31, true, "little");
2010
- }
2011
- /**
2012
- * Bit field reader. Reads 31 bits.
2013
- *
2014
- * Note: When returning to a byte read, remaining bits are dropped.
2015
- *
2016
- * @returns {number}
2017
- */
2018
- get ubit31be() {
2019
- return this.bit(31, true, "big");
2020
- }
2021
- /**
2022
- * Bit field reader. Reads 32 bits.
2023
- *
2024
- * Note: When returning to a byte read, remaining bits are dropped.
2025
- *
2026
- * @returns {number}
2027
- */
2028
- get bit32() {
2029
- return this.bit(32);
2030
- }
2031
- /**
2032
- * Bit field reader. Reads 32 bits.
2033
- *
2034
- * Note: When returning to a byte read, remaining bits are dropped.
2035
- *
2036
- * @returns {number}
2037
- */
2038
- get bit32le() {
2039
- return this.bit(32, undefined, "little");
2040
- }
2041
- /**
2042
- * Bit field reader. Reads 32 bits.
2043
- *
2044
- * Note: When returning to a byte read, remaining bits are dropped.
2045
- *
2046
- * @returns {number}
2047
- */
2048
- get bit32be() {
2049
- return this.bit(32, undefined, "big");
2050
- }
2051
- /**
2052
- * Bit field reader. Reads 32 bits.
2053
- *
2054
- * Note: When returning to a byte read, remaining bits are dropped.
2055
- *
2056
- * @returns {number}
2057
- */
2058
- get ubit32() {
2059
- return this.bit(32, true);
2060
- }
2061
- /**
2062
- * Bit field reader. Reads 32 bits.
2063
- *
2064
- * Note: When returning to a byte read, remaining bits are dropped.
2065
- *
2066
- * @returns {number}
2067
- */
2068
- get ubit32le() {
2069
- return this.bit(32, true, "little");
2070
- }
2071
- /**
2072
- * Bit field reader. Reads 32 bits.
2073
- *
2074
- * Note: When returning to a byte read, remaining bits are dropped.
2075
- *
2076
- * @returns {number}
2077
- */
2078
- get ubit32be() {
2079
- return this.bit(32, true, "big");
2080
- }
2081
- //
2082
- // byte read
2083
- //
2084
- /**
2085
- * Read byte.
2086
- *
2087
- * @returns {number}
2088
- */
2089
- get byte() {
2090
- return this.readByte();
2091
- }
2092
- /**
2093
- * Read byte.
2094
- *
2095
- * @returns {number}
2096
- */
2097
- get int8() {
2098
- return this.readByte();
2099
- }
2100
- /**
2101
- * Read unsigned byte.
2102
- *
2103
- * @returns {number}
2104
- */
2105
- get uint8() {
2106
- return this.readByte(true);
2107
- }
2108
- /**
2109
- * Read unsigned byte.
2110
- *
2111
- * @returns {number}
2112
- */
2113
- get ubyte() {
2114
- return this.readByte(true);
2115
- }
2116
- //
2117
- //short16 read
2118
- //
2119
- /**
2120
- * Read short.
2121
- *
2122
- * @returns {number}
2123
- */
2124
- get int16() {
2125
- return this.readInt16();
2126
- }
2127
- /**
2128
- * Read short.
2129
- *
2130
- * @returns {number}
2131
- */
2132
- get short() {
2133
- return this.readInt16();
2134
- }
2135
- /**
2136
- * Read short.
2137
- *
2138
- * @returns {number}
2139
- */
2140
- get word() {
2141
- return this.readInt16();
2142
- }
2143
- /**
2144
- * Read unsigned short.
2145
- *
2146
- * @returns {number}
2147
- */
2148
- get uint16() {
2149
- return this.readInt16(true);
2150
- }
2151
- /**
2152
- * Read unsigned short.
2153
- *
2154
- * @returns {number}
2155
- */
2156
- get ushort() {
2157
- return this.readInt16(true);
2158
- }
2159
- /**
2160
- * Read unsigned short.
2161
- *
2162
- * @returns {number}
2163
- */
2164
- get uword() {
2165
- return this.readInt16(true);
2166
- }
2167
- /**
2168
- * Read unsigned short in little endian.
2169
- *
2170
- * @returns {number}
2171
- */
2172
- get uint16le() {
2173
- return this.readInt16(true, "little");
2174
- }
2175
- /**
2176
- * Read unsigned short in little endian.
2177
- *
2178
- * @returns {number}
2179
- */
2180
- get ushortle() {
2181
- return this.readInt16(true, "little");
2182
- }
2183
- /**
2184
- * Read unsigned short in little endian.
2185
- *
2186
- * @returns {number}
2187
- */
2188
- get uwordle() {
2189
- return this.readInt16(true, "little");
2190
- }
2191
- /**
2192
- * Read signed short in little endian.
2193
- *
2194
- * @returns {number}
2195
- */
2196
- get int16le() {
2197
- return this.readInt16(false, "little");
2198
- }
2199
- /**
2200
- * Read signed short in little endian.
2201
- *
2202
- * @returns {number}
2203
- */
2204
- get shortle() {
2205
- return this.readInt16(false, "little");
2206
- }
2207
- /**
2208
- * Read signed short in little endian.
2209
- *
2210
- * @returns {number}
2211
- */
2212
- get wordle() {
2213
- return this.readInt16(false, "little");
2214
- }
2215
- /**
2216
- * Read unsigned short in big endian.
2217
- *
2218
- * @returns {number}
2219
- */
2220
- get uint16be() {
2221
- return this.readInt16(true, "big");
2222
- }
2223
- /**
2224
- * Read unsigned short in big endian.
2225
- *
2226
- * @returns {number}
2227
- */
2228
- get ushortbe() {
2229
- return this.readInt16(true, "big");
2230
- }
2231
- /**
2232
- * Read unsigned short in big endian.
2233
- *
2234
- * @returns {number}
2235
- */
2236
- get uwordbe() {
2237
- return this.readInt16(true, "big");
2238
- }
2239
- /**
2240
- * Read signed short in big endian.
2241
- *
2242
- * @returns {number}
2243
- */
2244
- get int16be() {
2245
- return this.readInt16(false, "big");
2246
- }
2247
- /**
2248
- * Read signed short in big endian.
2249
- *
2250
- * @returns {number}
2251
- */
2252
- get shortbe() {
2253
- return this.readInt16(false, "big");
2254
- }
2255
- /**
2256
- * Read signed short in big endian.
2257
- *
2258
- * @returns {number}
2259
- */
2260
- get wordbe() {
2261
- return this.readInt16(false, "big");
2262
- }
2263
- //
2264
- //half float read
2265
- //
2266
- /**
2267
- * Read half float.
2268
- *
2269
- * @param {string} endian - ``big`` or ``little``
2270
- * @returns {number}
2271
- */
2272
- get halffloat() {
2273
- return this.readHalfFloat();
2274
- }
2275
- /**
2276
- * Read half float
2277
- *
2278
- * @returns {number}
2279
- */
2280
- get half() {
2281
- return this.readHalfFloat();
2282
- }
2283
- /**
2284
- * Read half float.
2285
- *
2286
- * @returns {number}
2287
- */
2288
- get halffloatbe() {
2289
- return this.readHalfFloat("big");
2290
- }
2291
- /**
2292
- * Read half float.
2293
- *
2294
- * @returns {number}
2295
- */
2296
- get halfbe() {
2297
- return this.readHalfFloat("big");
2298
- }
2299
- /**
2300
- * Read half float.
2301
- *
2302
- * @returns {number}
2303
- */
2304
- get halffloatle() {
2305
- return this.readHalfFloat("little");
2306
- }
2307
- /**
2308
- * Read half float.
2309
- *
2310
- * @returns {number}
2311
- */
2312
- get halfle() {
2313
- return this.readHalfFloat("little");
2314
- }
2315
- //
2316
- //int read
2317
- //
2318
- /**
2319
- * Read 32 bit integer.
2320
- *
2321
- * @returns {number}
2322
- */
2323
- get int() {
2324
- return this.readInt32();
2325
- }
2326
- /**
2327
- * Read 32 bit integer.
2328
- *
2329
- * @returns {number}
2330
- */
2331
- get double() {
2332
- return this.readInt32();
2333
- }
2334
- /**
2335
- * Read 32 bit integer.
2336
- *
2337
- * @returns {number}
2338
- */
2339
- get int32() {
2340
- return this.readInt32();
2341
- }
2342
- /**
2343
- * Read 32 bit integer.
2344
- *
2345
- * @returns {number}
2346
- */
2347
- get long() {
2348
- return this.readInt32();
2349
- }
2350
- /**
2351
- * Read unsigned 32 bit integer.
2352
- *
2353
- * @returns {number}
2354
- */
2355
- get uint() {
2356
- return this.readInt32(true);
2357
- }
2358
- /**
2359
- * Read unsigned 32 bit integer.
2360
- *
2361
- * @returns {number}
2362
- */
2363
- get udouble() {
2364
- return this.readInt32(true);
2365
- }
2366
- /**
2367
- * Read unsigned 32 bit integer.
2368
- *
2369
- * @returns {number}
2370
- */
2371
- get uint32() {
2372
- return this.readInt32(true);
2373
- }
2374
- /**
2375
- * Read unsigned 32 bit integer.
2376
- *
2377
- * @returns {number}
2378
- */
2379
- get ulong() {
2380
- return this.readInt32(true);
2381
- }
2382
- /**
2383
- * Read signed 32 bit integer.
2384
- *
2385
- * @returns {number}
2386
- */
2387
- get intbe() {
2388
- return this.readInt32(false, "big");
2389
- }
2390
- /**
2391
- * Read signed 32 bit integer.
2392
- *
2393
- * @returns {number}
2394
- */
2395
- get doublebe() {
2396
- return this.readInt32(false, "big");
2397
- }
2398
- /**
2399
- * Read signed 32 bit integer.
2400
- *
2401
- * @returns {number}
2402
- */
2403
- get int32be() {
2404
- return this.readInt32(false, "big");
2405
- }
2406
- /**
2407
- * Read signed 32 bit integer.
2408
- *
2409
- * @returns {number}
2410
- */
2411
- get longbe() {
2412
- return this.readInt32(false, "big");
2413
- }
2414
- /**
2415
- * Read unsigned 32 bit integer.
2416
- *
2417
- * @returns {number}
2418
- */
2419
- get uintbe() {
2420
- return this.readInt32(true, "big");
2421
- }
2422
- /**
2423
- * Read unsigned 32 bit integer.
2424
- *
2425
- * @returns {number}
2426
- */
2427
- get udoublebe() {
2428
- return this.readInt32(true, "big");
2429
- }
2430
- /**
2431
- * Read unsigned 32 bit integer.
2432
- *
2433
- * @returns {number}
2434
- */
2435
- get uint32be() {
2436
- return this.readInt32(true, "big");
2437
- }
2438
- /**
2439
- * Read unsigned 32 bit integer.
2440
- *
2441
- * @returns {number}
2442
- */
2443
- get ulongbe() {
2444
- return this.readInt32(true, "big");
2445
- }
2446
- /**
2447
- * Read signed 32 bit integer.
2448
- *
2449
- * @returns {number}
2450
- */
2451
- get intle() {
2452
- return this.readInt32(false, "little");
2453
- }
2454
- /**
2455
- * Read signed 32 bit integer.
2456
- *
2457
- * @returns {number}
2458
- */
2459
- get doublele() {
2460
- return this.readInt32(false, "little");
2461
- }
2462
- /**
2463
- * Read signed 32 bit integer.
2464
- *
2465
- * @returns {number}
2466
- */
2467
- get int32le() {
2468
- return this.readInt32(false, "little");
2469
- }
2470
- /**
2471
- * Read signed 32 bit integer.
2472
- *
2473
- * @returns {number}
2474
- */
2475
- get longle() {
2476
- return this.readInt32(false, "little");
2477
- }
2478
- /**
2479
- * Read signed 32 bit integer.
2480
- *
2481
- * @returns {number}
2482
- */
2483
- get uintle() {
2484
- return this.readInt32(true, "little");
2485
- }
2486
- /**
2487
- * Read signed 32 bit integer.
2488
- *
2489
- * @returns {number}
2490
- */
2491
- get udoublele() {
2492
- return this.readInt32(true, "little");
2493
- }
2494
- /**
2495
- * Read signed 32 bit integer.
2496
- *
2497
- * @returns {number}
2498
- */
2499
- get uint32le() {
2500
- return this.readInt32(true, "little");
2501
- }
2502
- /**
2503
- * Read signed 32 bit integer.
2504
- *
2505
- * @returns {number}
2506
- */
2507
- get ulongle() {
2508
- return this.readInt32(true, "little");
2509
- }
2510
- //
2511
- //float read
2512
- //
2513
- /**
2514
- * Read float.
2515
- *
2516
- * @returns {number}
2517
- */
2518
- get float() {
2519
- return this.readFloat();
2520
- }
2521
- /**
2522
- * Read float.
2523
- *
2524
- * @returns {number}
2525
- */
2526
- get floatbe() {
2527
- return this.readFloat("big");
2528
- }
2529
- /**
2530
- * Read float.
2531
- *
2532
- * @returns {number}
2533
- */
2534
- get floatle() {
2535
- return this.readFloat("little");
2536
- }
2537
- //
2538
- //int64 reader
2539
- //
2540
- /**
2541
- * Read signed 64 bit integer
2542
- *
2543
- * @returns {number}
2544
- */
2545
- get int64() {
2546
- return this.readInt64();
2547
- }
2548
- /**
2549
- * Read signed 64 bit integer.
2550
- *
2551
- * @returns {number}
2552
- */
2553
- get bigint() {
2554
- return this.readInt64();
2555
- }
2556
- /**
2557
- * Read signed 64 bit integer.
2558
- *
2559
- * @returns {number}
2560
- */
2561
- get quad() {
2562
- return this.readInt64();
2563
- }
2564
- /**
2565
- * Read unsigned 64 bit integer.
2566
- *
2567
- * @returns {number}
2568
- */
2569
- get uint64() {
2570
- return this.readInt64(true);
2571
- }
2572
- /**
2573
- * Read unsigned 64 bit integer.
2574
- *
2575
- * @returns {number}
2576
- */
2577
- get ubigint() {
2578
- return this.readInt64(true);
2579
- }
2580
- /**
2581
- * Read unsigned 64 bit integer.
2582
- *
2583
- * @returns {number}
2584
- */
2585
- get uquad() {
2586
- return this.readInt64(true);
2587
- }
2588
- /**
2589
- * Read signed 64 bit integer.
2590
- *
2591
- * @returns {number}
2592
- */
2593
- get int64be() {
2594
- return this.readInt64(false, "big");
2595
- }
2596
- /**
2597
- * Read signed 64 bit integer.
2598
- *
2599
- * @returns {number}
2600
- */
2601
- get bigintbe() {
2602
- return this.readInt64(false, "big");
2603
- }
2604
- /**
2605
- * Read signed 64 bit integer.
2606
- *
2607
- * @returns {number}
2608
- */
2609
- get quadbe() {
2610
- return this.readInt64(false, "big");
2611
- }
2612
- /**
2613
- * Read unsigned 64 bit integer.
2614
- *
2615
- * @returns {number}
2616
- */
2617
- get uint64be() {
2618
- return this.readInt64(true, "big");
2619
- }
2620
- /**
2621
- * Read unsigned 64 bit integer.
2622
- *
2623
- * @returns {number}
2624
- */
2625
- get ubigintbe() {
2626
- return this.readInt64(true, "big");
2627
- }
2628
- /**
2629
- * Read unsigned 64 bit integer.
2630
- *
2631
- * @returns {number}
2632
- */
2633
- get uquadbe() {
2634
- return this.readInt64(true, "big");
2635
- }
2636
- /**
2637
- * Read signed 64 bit integer.
2638
- *
2639
- * @returns {number}
2640
- */
2641
- get int64le() {
2642
- return this.readInt64(false, "little");
2643
- }
2644
- /**
2645
- * Read signed 64 bit integer.
2646
- *
2647
- * @returns {number}
2648
- */
2649
- get bigintle() {
2650
- return this.readInt64(false, "little");
2651
- }
2652
- /**
2653
- * Read signed 64 bit integer.
2654
- *
2655
- * @returns {number}
2656
- */
2657
- get quadle() {
2658
- return this.readInt64(false, "little");
2659
- }
2660
- /**
2661
- * Read unsigned 64 bit integer.
2662
- *
2663
- * @returns {number}
2664
- */
2665
- get uint64le() {
2666
- return this.readInt64(true, "little");
2667
- }
2668
- /**
2669
- * Read unsigned 64 bit integer.
2670
- *
2671
- * @returns {number}
2672
- */
2673
- get ubigintle() {
2674
- return this.readInt64(true, "little");
2675
- }
2676
- /**
2677
- * Read unsigned 64 bit integer.
2678
- *
2679
- * @returns {number}
2680
- */
2681
- get uquadle() {
2682
- return this.readInt64(true, "little");
2683
- }
2684
- //
2685
- //doublefloat reader
2686
- //
2687
- /**
2688
- * Read double float.
2689
- *
2690
- * @returns {number}
2691
- */
2692
- get doublefloat() {
2693
- return this.readDoubleFloat();
2694
- }
2695
- /**
2696
- * Read double float.
2697
- *
2698
- * @returns {number}
2699
- */
2700
- get dfloat() {
2701
- return this.readDoubleFloat();
2702
- }
2703
- /**
2704
- * Read double float.
2705
- *
2706
- * @returns {number}
2707
- */
2708
- get dfloatebe() {
2709
- return this.readDoubleFloat("big");
2710
- }
2711
- /**
2712
- * Read double float.
2713
- *
2714
- * @returns {number}
2715
- */
2716
- get doublefloatbe() {
2717
- return this.readDoubleFloat("big");
2718
- }
2719
- /**
2720
- * Read double float.
2721
- *
2722
- * @returns {number}
2723
- */
2724
- get dfloatle() {
2725
- return this.readDoubleFloat("little");
2726
- }
2727
- /**
2728
- * Read double float.
2729
- *
2730
- * @returns {number}
2731
- */
2732
- get doublefloatle() {
2733
- return this.readDoubleFloat("little");
2734
- }
2735
- //
2736
- //string reader
2737
- //
2738
- /**
2739
- * Reads string, use options object for different types.
2740
- *
2741
- * @param {object} options
2742
- * ```javascript
2743
- * {
2744
- * length: number, //for fixed length, non-terminate value utf strings
2745
- * stringType: "utf-8", //utf-8, utf-16, pascal or wide-pascal
2746
- * terminateValue: 0x00, // only for non-fixed length utf strings
2747
- * lengthReadSize: 1, //for pascal strings. 1, 2 or 4 byte length read size
2748
- * stripNull: true, // removes 0x00 characters
2749
- * encoding: "utf-8", //TextEncoder accepted types
2750
- * endian: "little", //for wide-pascal and utf-16
2751
- * }
2752
- * ```
2753
- * @return string
2754
- */
2755
- string(options) {
2756
- return this.readString(options);
2757
- }
2758
- /**
2759
- * Reads UTF-8 (C) string.
2760
- *
2761
- * @param {number} length - for fixed length utf strings
2762
- * @param {number} terminateValue - for non-fixed length utf strings
2763
- * @param {boolean} stripNull - removes 0x00 characters
2764
- *
2765
- * @return string
2766
- */
2767
- utf8string(length, terminateValue, stripNull) {
2768
- return this.string({ stringType: "utf-8", encoding: "utf-8", length: length, terminateValue: terminateValue, stripNull: stripNull });
2769
- }
2770
- /**
2771
- * Reads UTF-8 (C) string.
2772
- *
2773
- * @param {number} length - for fixed length utf strings
2774
- * @param {number} terminateValue - for non-fixed length utf strings
2775
- * @param {boolean} stripNull - removes 0x00 characters
2776
- *
2777
- * @return string
2778
- */
2779
- cstring(length, terminateValue, stripNull) {
2780
- return this.string({ stringType: "utf-8", encoding: "utf-8", length: length, terminateValue: terminateValue, stripNull: stripNull });
2781
- }
2782
- /**
2783
- * Reads ANSI string.
2784
- *
2785
- * @param {number} length - for fixed length utf strings
2786
- * @param {number} terminateValue - for non-fixed length utf strings
2787
- * @param {boolean} stripNull - removes 0x00 characters
2788
- *
2789
- * @return string
2790
- */
2791
- ansistring(length, terminateValue, stripNull) {
2792
- return this.string({ stringType: "utf-8", encoding: "windows-1252", length: length, terminateValue: terminateValue, stripNull: stripNull });
2793
- }
2794
- /**
2795
- * Reads UTF-16 (Unicode) string.
2796
- *
2797
- * @param {number} length - for fixed length utf strings
2798
- * @param {number} terminateValue - for non-fixed length utf strings
2799
- * @param {boolean} stripNull - removes 0x00 characters
2800
- * @param {string} endian - ``big`` or ``little``
2801
- *
2802
- * @return string
2803
- */
2804
- utf16string(length, terminateValue, stripNull, endian) {
2805
- return this.string({ stringType: "utf-16", encoding: "utf-16", length: length, terminateValue: terminateValue, endian: endian, stripNull: stripNull });
2806
- }
2807
- /**
2808
- * Reads UTF-16 (Unicode) string.
2809
- *
2810
- * @param {number} length - for fixed length utf strings
2811
- * @param {number} terminateValue - for non-fixed length utf strings
2812
- * @param {boolean} stripNull - removes 0x00 characters
2813
- * @param {string} endian - ``big`` or ``little``
2814
- *
2815
- * @return string
2816
- */
2817
- unistring(length, terminateValue, stripNull, endian) {
2818
- return this.string({ stringType: "utf-16", encoding: "utf-16", length: length, terminateValue: terminateValue, endian: endian, stripNull: stripNull });
2819
- }
2820
- /**
2821
- * Reads UTF-16 (Unicode) string in little endian order.
2822
- *
2823
- * @param {number} length - for fixed length utf strings
2824
- * @param {number} terminateValue - for non-fixed length utf strings
2825
- * @param {boolean} stripNull - removes 0x00 characters
2826
- *
2827
- * @return string
2828
- */
2829
- utf16stringle(length, terminateValue, stripNull) {
2830
- return this.string({ stringType: "utf-16", encoding: "utf-16", length: length, terminateValue: terminateValue, endian: "little", stripNull: stripNull });
2831
- }
2832
- /**
2833
- * Reads UTF-16 (Unicode) string in little endian order.
2834
- *
2835
- * @param {number} length - for fixed length utf strings
2836
- * @param {number} terminateValue - for non-fixed length utf strings
2837
- * @param {boolean} stripNull - removes 0x00 characters
2838
- *
2839
- * @return string
2840
- */
2841
- unistringle(length, terminateValue, stripNull) {
2842
- return this.string({ stringType: "utf-16", encoding: "utf-16", length: length, terminateValue: terminateValue, endian: "little", stripNull: stripNull });
2843
- }
2844
- /**
2845
- * Reads UTF-16 (Unicode) string in big endian order.
2846
- *
2847
- * @param {number} length - for fixed length utf strings
2848
- * @param {number} terminateValue - for non-fixed length utf strings
2849
- * @param {boolean} stripNull - removes 0x00 characters
2850
- *
2851
- * @return string
2852
- */
2853
- utf16stringbe(length, terminateValue, stripNull) {
2854
- return this.string({ stringType: "utf-16", encoding: "utf-16", length: length, terminateValue: terminateValue, endian: "big", stripNull: stripNull });
2855
- }
2856
- /**
2857
- * Reads UTF-16 (Unicode) string in big endian order.
2858
- *
2859
- * @param {number} length - for fixed length utf strings
2860
- * @param {number} terminateValue - for non-fixed length utf strings
2861
- * @param {boolean} stripNull - removes 0x00 characters
2862
- *
2863
- * @return string
2864
- */
2865
- unistringbe(length, terminateValue, stripNull) {
2866
- return this.string({ stringType: "utf-16", encoding: "utf-16", length: length, terminateValue: terminateValue, endian: "big", stripNull: stripNull });
2867
- }
2868
- /**
2869
- * Reads Pascal string.
2870
- *
2871
- * @param {number} lengthReadSize - 1, 2 or 4 byte length write size (default 1)
2872
- * @param {boolean} stripNull - removes 0x00 characters
2873
- * @param {string} endian - ``big`` or ``little``
2874
- *
2875
- * @return string
2876
- */
2877
- pstring(lengthReadSize, stripNull, endian) {
2878
- return this.string({ stringType: "pascal", encoding: "utf-8", lengthReadSize: lengthReadSize, stripNull: stripNull, endian: endian });
2879
- }
2880
- /**
2881
- * Reads Pascal string 1 byte length read.
2882
- *
2883
- * @param {boolean} stripNull - removes 0x00 characters
2884
- * @param {string} endian - ``big`` or ``little``
2885
- *
2886
- * @return string
2887
- */
2888
- pstring1(stripNull, endian) {
2889
- return this.string({ stringType: "pascal", encoding: "utf-8", lengthReadSize: 1, stripNull: stripNull, endian: endian });
2890
- }
2891
- /**
2892
- * Reads Pascal string 1 byte length read in little endian order.
2893
- *
2894
- * @param {boolean} stripNull - removes 0x00 characters
2895
- *
2896
- * @return string
2897
- */
2898
- pstring1le(stripNull) {
2899
- return this.string({ stringType: "pascal", encoding: "utf-8", lengthReadSize: 1, stripNull: stripNull, endian: "little" });
2900
- }
2901
- /**
2902
- * Reads Pascal string 1 byte length read in big endian order.
2903
- *
2904
- * @param {boolean} stripNull - removes 0x00 characters
2905
- *
2906
- * @return string
2907
- */
2908
- pstring1be(stripNull) {
2909
- return this.string({ stringType: "pascal", encoding: "utf-8", lengthReadSize: 1, stripNull: stripNull, endian: "big" });
2910
- }
2911
- /**
2912
- * Reads Pascal string 2 byte length read.
2913
- *
2914
- * @param {boolean} stripNull - removes 0x00 characters
2915
- * @param {string} endian - ``big`` or ``little``
2916
- *
2917
- * @return string
2918
- */
2919
- pstring2(stripNull, endian) {
2920
- return this.string({ stringType: "pascal", encoding: "utf-8", lengthReadSize: 2, stripNull: stripNull, endian: endian });
2921
- }
2922
- /**
2923
- * Reads Pascal string 2 byte length read in little endian order.
2924
- *
2925
- * @param {boolean} stripNull - removes 0x00 characters
2926
- *
2927
- * @return string
2928
- */
2929
- pstring2le(stripNull) {
2930
- return this.string({ stringType: "pascal", encoding: "utf-8", lengthReadSize: 2, stripNull: stripNull, endian: "little" });
2931
- }
2932
- /**
2933
- * Reads Pascal string 2 byte length read in big endian order.
2934
- *
2935
- * @param {boolean} stripNull - removes 0x00 characters
2936
- *
2937
- * @return string
2938
- */
2939
- pstring2be(stripNull) {
2940
- return this.string({ stringType: "pascal", encoding: "utf-8", lengthReadSize: 2, stripNull: stripNull, endian: "big" });
2941
- }
2942
- /**
2943
- * Reads Pascal string 4 byte length read.
2944
- *
2945
- * @param {boolean} stripNull - removes 0x00 characters
2946
- * @param {string} endian - ``big`` or ``little``
2947
- *
2948
- * @return string
2949
- */
2950
- pstring4(stripNull, endian) {
2951
- return this.string({ stringType: "pascal", encoding: "utf-8", lengthReadSize: 4, stripNull: stripNull, endian: endian });
2952
- }
2953
- /**
2954
- * Reads Pascal string 4 byte length read in little endian order.
2955
- *
2956
- * @param {boolean} stripNull - removes 0x00 characters
2957
- *
2958
- * @return string
2959
- */
2960
- pstring4le(stripNull) {
2961
- return this.string({ stringType: "pascal", encoding: "utf-8", lengthReadSize: 4, stripNull: stripNull, endian: "little" });
2962
- }
2963
- /**
2964
- * Reads Pascal string 4 byte length read in big endian order.
2965
- *
2966
- * @param {boolean} stripNull - removes 0x00 characters
2967
- *
2968
- * @return string
2969
- */
2970
- pstring4be(stripNull) {
2971
- return this.string({ stringType: "pascal", encoding: "utf-8", lengthReadSize: 4, stripNull: stripNull, endian: "big" });
2972
- }
2973
- /**
2974
- * Reads Wide-Pascal string.
2975
- *
2976
- * @param {number} lengthReadSize - 1, 2 or 4 byte length write size (default 1)
2977
- * @param {boolean} stripNull - removes 0x00 characters
2978
- * @param {string} endian - ``big`` or ``little``
2979
- *
2980
- * @return string
2981
- */
2982
- wpstring(lengthReadSize, stripNull, endian) {
2983
- return this.string({ stringType: "wide-pascal", encoding: "utf-16", lengthReadSize: lengthReadSize, endian: endian, stripNull: stripNull });
2984
- }
2985
- /**
2986
- * Reads Wide-Pascal string 1 byte length read.
2987
- *
2988
- * @param {boolean} stripNull - removes 0x00 characters
2989
- * @param {string} endian - ``big`` or ``little``
2990
- *
2991
- * @return string
2992
- */
2993
- wpstring1(stripNull, endian) {
2994
- return this.string({ stringType: "wide-pascal", encoding: "utf-16", lengthReadSize: 1, endian: endian, stripNull: stripNull });
2995
- }
2996
- /**
2997
- * Reads Wide-Pascal string 2 byte length read.
2998
- *
2999
- * @param {boolean} stripNull - removes 0x00 characters
3000
- * @param {string} endian - ``big`` or ``little``
3001
- *
3002
- * @return string
3003
- */
3004
- wpstring2(stripNull, endian) {
3005
- return this.string({ stringType: "wide-pascal", encoding: "utf-16", lengthReadSize: 2, endian: endian, stripNull: stripNull });
3006
- }
3007
- /**
3008
- * Reads Wide-Pascal string 2 byte length read in little endian order.
3009
- *
3010
- * @param {boolean} stripNull - removes 0x00 characters
3011
- *
3012
- * @return string
3013
- */
3014
- wpstring2le(stripNull) {
3015
- return this.string({ stringType: "wide-pascal", encoding: "utf-16", lengthReadSize: 2, endian: "little", stripNull: stripNull });
3016
- }
3017
- /**
3018
- * Reads Wide-Pascal string 2 byte length read in big endian order.
3019
- *
3020
- * @param {boolean} stripNull - removes 0x00 characters
3021
- *
3022
- * @return string
3023
- */
3024
- wpstring2be(stripNull) {
3025
- return this.string({ stringType: "wide-pascal", encoding: "utf-16", lengthReadSize: 2, endian: "big", stripNull: stripNull });
3026
- }
3027
- /**
3028
- * Reads Wide-Pascal string 4 byte length read.
3029
- *
3030
- * @param {boolean} stripNull - removes 0x00 characters
3031
- * @param {string} endian - ``big`` or ``little``
3032
- *
3033
- * @return string
3034
- */
3035
- wpstring4(stripNull, endian) {
3036
- return this.string({ stringType: "wide-pascal", encoding: "utf-16", lengthReadSize: 4, endian: endian, stripNull: stripNull });
3037
- }
3038
- /**
3039
- * Reads Wide-Pascal string 4 byte length read in big endian order.
3040
- *
3041
- * @param {boolean} stripNull - removes 0x00 characters
3042
- *
3043
- * @return string
3044
- */
3045
- wpstring4be(stripNull) {
3046
- return this.string({ stringType: "wide-pascal", encoding: "utf-16", lengthReadSize: 4, endian: "big", stripNull: stripNull });
3047
- }
3048
- /**
3049
- * Reads Wide-Pascal string 4 byte length read in little endian order.
3050
- *
3051
- * @param {boolean} stripNull - removes 0x00 characters
3052
- *
3053
- * @return string
3054
- */
3055
- wpstring4le(stripNull) {
3056
- return this.string({ stringType: "wide-pascal", encoding: "utf-16", lengthReadSize: 4, endian: "little", stripNull: stripNull });
3057
- }
3058
- }
3059
- exports.BiReader = BiReader;
3060
- //# sourceMappingURL=bireader.js.map