bireader 1.0.36 → 1.0.39

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.
package/lib/cjs/index.js CHANGED
@@ -1,22 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.biwriter = exports.bireader = exports.wstring = exports.rstring = exports.rdfloat = exports.wdfloat = exports.wint64 = exports.rint64 = exports.wfloat = exports.rfloat = exports.rint32 = exports.wint32 = exports.whalffloat = exports.rhalffloat = exports.rint16 = exports.wint16 = exports.rbyte = exports.wbyte = exports.rbit = exports.wbit = exports.ADD = exports.RSHIFT = exports.LSHIFT = exports.NOT = exports.XOR = exports.OR = exports.AND = exports.hexDump = exports.addData = exports.remove = exports.goto = exports.skip = exports.checkSize = exports.extendarray = exports.arraybuffcheck = exports.buffcheck = exports.check_size = exports.isBuffer = void 0;
3
+ exports.biwriter = exports.bireader = void 0;
4
4
  function isBuffer(obj) {
5
5
  return buffcheck(obj);
6
6
  }
7
- exports.isBuffer = isBuffer;
8
7
  function check_size(_this, write_bytes, write_bit, offset) {
9
8
  return checkSize(_this, write_bytes || 0, write_bit || 0, offset || _this.offset);
10
9
  }
11
- exports.check_size = check_size;
12
10
  function buffcheck(obj) {
13
11
  return (typeof Buffer !== 'undefined' && obj instanceof Buffer);
14
12
  }
15
- exports.buffcheck = buffcheck;
16
13
  function arraybuffcheck(_this, obj) {
17
14
  return obj instanceof Uint8Array || isBuffer(obj);
18
15
  }
19
- exports.arraybuffcheck = arraybuffcheck;
20
16
  function extendarray(_this, to_padd) {
21
17
  if ((typeof Buffer !== 'undefined' && _this.data instanceof Buffer)) {
22
18
  var paddbuffer = Buffer.alloc(to_padd);
@@ -27,7 +23,6 @@ function extendarray(_this, to_padd) {
27
23
  _this.data = new Uint8Array([..._this.data, ...addArray]);
28
24
  }
29
25
  }
30
- exports.extendarray = extendarray;
31
26
  function checkSize(_this, write_bytes, write_bit, offset) {
32
27
  const bits = (write_bit || 0) + _this.bitoffset;
33
28
  var new_off = (offset || _this.offset);
@@ -51,7 +46,6 @@ function checkSize(_this, write_bytes, write_bit, offset) {
51
46
  //start read location
52
47
  return new_off;
53
48
  }
54
- exports.checkSize = checkSize;
55
49
  function skip(_this, bytes, bits) {
56
50
  var new_size = (((bytes || 0) + _this.offset) + Math.ceil((_this.bitoffset + (bits || 0)) / 8));
57
51
  if (bits && bits < 0) {
@@ -66,11 +60,29 @@ function skip(_this, bytes, bits) {
66
60
  throw new Error("\x1b[33m[Strict mode]\x1b[0m: Seek of range of data: seek " + new_size + " of " + _this.size);
67
61
  }
68
62
  }
69
- const total_bits = (((bytes || 0) + _this.offset) * 8) + (bits || 0) + _this.bitoffset;
70
- _this.bitoffset = total_bits % 8;
71
- _this.offset = Math.floor(total_bits / 8);
63
+ // Adjust byte offset based on bit overflow
64
+ _this.offset += Math.floor((_this.bitoffset + (bits || 0)) / 8);
65
+ // Adjust bit offset
66
+ _this.bitoffset = (_this.bitoffset + (bits || 0) + 64) % 8;
67
+ // Adjust byte offset based on byte overflow
68
+ _this.offset += bytes;
69
+ // Ensure bit offset stays between 0-7
70
+ _this.bitoffset = Math.min(Math.max(_this.bitoffset, 0), 7);
71
+ // Ensure offset doesn't go negative
72
+ _this.offset = Math.max(_this.offset, 0);
73
+ }
74
+ function align(_this, n) {
75
+ var a = _this.offset % n;
76
+ if (a) {
77
+ _this.skip(n - a);
78
+ }
79
+ }
80
+ function alignRev(_this, n) {
81
+ var a = _this.offset % n;
82
+ if (a) {
83
+ _this.skip(a * -1);
84
+ }
72
85
  }
73
- exports.skip = skip;
74
86
  function goto(_this, byte, bit) {
75
87
  const new_size = (byte + Math.ceil((bit || 0) / 8));
76
88
  if (new_size > _this.size) {
@@ -85,7 +97,6 @@ function goto(_this, byte, bit) {
85
97
  _this.offset = byte;
86
98
  _this.bitoffset = (bit || 0) % 8;
87
99
  }
88
- exports.goto = goto;
89
100
  function remove(_this, startOffset, endOffset, consume, remove, fillValue) {
90
101
  const new_start = Math.abs(startOffset || 0);
91
102
  const new_offset = (endOffset || _this.offset);
@@ -139,7 +150,6 @@ function remove(_this, startOffset, endOffset, consume, remove, fillValue) {
139
150
  }
140
151
  return data_removed;
141
152
  }
142
- exports.remove = remove;
143
153
  function addData(_this, data, consume, offset, repalce) {
144
154
  if (_this.strict == true) {
145
155
  _this.errorDump ? "\x1b[31m[Error]\x1b[0m: hexdump:\n" + _this.hexdump() : "";
@@ -198,7 +208,6 @@ function addData(_this, data, consume, offset, repalce) {
198
208
  _this.bitoffset = 0;
199
209
  }
200
210
  }
201
- exports.addData = addData;
202
211
  function hexDump(_this, options) {
203
212
  var length = options && options.length;
204
213
  var startByte = options && options.startByte;
@@ -381,7 +390,6 @@ function hexDump(_this, options) {
381
390
  }
382
391
  console.log(rows.join("\n"));
383
392
  }
384
- exports.hexDump = hexDump;
385
393
  function AND(_this, and_key, start, end, consume) {
386
394
  const input = _this.data;
387
395
  if ((end || 0) > _this.size) {
@@ -403,7 +411,7 @@ function AND(_this, and_key, start, end, consume) {
403
411
  }
404
412
  }
405
413
  else {
406
- if (_this.isBufferOrUint8Array(and_key)) {
414
+ if (arraybuffcheck(_this, and_key)) {
407
415
  let number = -1;
408
416
  for (let i = (start || 0); i < Math.min(end || _this.size, _this.size); i++) {
409
417
  if (number != and_key.length - 1) {
@@ -424,7 +432,6 @@ function AND(_this, and_key, start, end, consume) {
424
432
  }
425
433
  }
426
434
  }
427
- exports.AND = AND;
428
435
  function OR(_this, or_key, start, end, consume) {
429
436
  const input = _this.data;
430
437
  if ((end || 0) > _this.size) {
@@ -446,7 +453,7 @@ function OR(_this, or_key, start, end, consume) {
446
453
  }
447
454
  }
448
455
  else {
449
- if (_this.isBufferOrUint8Array(or_key)) {
456
+ if (arraybuffcheck(_this, or_key)) {
450
457
  let number = -1;
451
458
  for (let i = (start || 0); i < Math.min(end || _this.size, _this.size); i++) {
452
459
  if (number != or_key.length - 1) {
@@ -467,7 +474,6 @@ function OR(_this, or_key, start, end, consume) {
467
474
  }
468
475
  }
469
476
  }
470
- exports.OR = OR;
471
477
  function XOR(_this, xor_key, start, end, consume) {
472
478
  const input = _this.data;
473
479
  if ((end || 0) > _this.size) {
@@ -489,7 +495,7 @@ function XOR(_this, xor_key, start, end, consume) {
489
495
  }
490
496
  }
491
497
  else {
492
- if (_this.isBufferOrUint8Array(xor_key)) {
498
+ if (arraybuffcheck(_this, xor_key)) {
493
499
  let number = -1;
494
500
  for (let i = (start || 0); i < Math.min(end || _this.size, _this.size); i++) {
495
501
  if (number != xor_key.length - 1) {
@@ -510,7 +516,6 @@ function XOR(_this, xor_key, start, end, consume) {
510
516
  }
511
517
  }
512
518
  }
513
- exports.XOR = XOR;
514
519
  function NOT(_this, start, end, consume) {
515
520
  if ((end || 0) > _this.size) {
516
521
  if (_this.strict == false) {
@@ -529,7 +534,6 @@ function NOT(_this, start, end, consume) {
529
534
  }
530
535
  }
531
536
  }
532
- exports.NOT = NOT;
533
537
  function LSHIFT(_this, shift_key, start, end, consume) {
534
538
  const input = _this.data;
535
539
  if ((end || 0) > _this.size) {
@@ -551,7 +555,7 @@ function LSHIFT(_this, shift_key, start, end, consume) {
551
555
  }
552
556
  }
553
557
  else {
554
- if (_this.isBufferOrUint8Array(shift_key)) {
558
+ if (arraybuffcheck(_this, shift_key)) {
555
559
  let number = -1;
556
560
  for (let i = (start || 0); i < Math.min(end || _this.size, _this.size); i++) {
557
561
  if (number != shift_key.length - 1) {
@@ -572,7 +576,6 @@ function LSHIFT(_this, shift_key, start, end, consume) {
572
576
  }
573
577
  }
574
578
  }
575
- exports.LSHIFT = LSHIFT;
576
579
  function RSHIFT(_this, shift_key, start, end, consume) {
577
580
  const input = _this.data;
578
581
  if ((end || 0) > _this.size) {
@@ -594,7 +597,7 @@ function RSHIFT(_this, shift_key, start, end, consume) {
594
597
  }
595
598
  }
596
599
  else {
597
- if (_this.isBufferOrUint8Array(shift_key)) {
600
+ if (arraybuffcheck(_this, shift_key)) {
598
601
  let number = -1;
599
602
  for (let i = (start || 0); i < Math.min(end || _this.size, _this.size); i++) {
600
603
  if (number != shift_key.length - 1) {
@@ -615,7 +618,6 @@ function RSHIFT(_this, shift_key, start, end, consume) {
615
618
  }
616
619
  }
617
620
  }
618
- exports.RSHIFT = RSHIFT;
619
621
  function ADD(_this, add_key, start, end, consume) {
620
622
  const input = _this.data;
621
623
  if ((end || 0) > _this.size) {
@@ -637,7 +639,7 @@ function ADD(_this, add_key, start, end, consume) {
637
639
  }
638
640
  }
639
641
  else {
640
- if (_this.isBufferOrUint8Array(add_key)) {
642
+ if (arraybuffcheck(_this, add_key)) {
641
643
  let number = -1;
642
644
  for (let i = (start || 0); i < Math.min(end || _this.size, _this.size); i++) {
643
645
  if (number != add_key.length - 1) {
@@ -658,7 +660,6 @@ function ADD(_this, add_key, start, end, consume) {
658
660
  }
659
661
  }
660
662
  }
661
- exports.ADD = ADD;
662
663
  function wbit(_this, value, bits, unsigned, endian) {
663
664
  if (value == undefined) {
664
665
  throw new Error('Must supply value.');
@@ -719,7 +720,6 @@ function wbit(_this, value, bits, unsigned, endian) {
719
720
  _this.offset = _this.offset + Math.floor(((bits) + _this.bitoffset) / 8); //end byte
720
721
  _this.bitoffset = ((bits) + _this.bitoffset) % 8;
721
722
  }
722
- exports.wbit = wbit;
723
723
  function rbit(_this, bits, unsigned, endian) {
724
724
  if (bits == undefined || typeof bits != "number") {
725
725
  throw new Error("Enter number of bits to read");
@@ -764,7 +764,6 @@ function rbit(_this, bits, unsigned, endian) {
764
764
  }
765
765
  return value;
766
766
  }
767
- exports.rbit = rbit;
768
767
  function wbyte(_this, value, unsigned) {
769
768
  check_size(_this, 1, 0);
770
769
  if (unsigned == true) {
@@ -785,7 +784,6 @@ function wbyte(_this, value, unsigned) {
785
784
  _this.offset += 1;
786
785
  _this.bitoffset = 0;
787
786
  }
788
- exports.wbyte = wbyte;
789
787
  function rbyte(_this, unsigned) {
790
788
  check_size(_this, 1);
791
789
  var read = _this.data[_this.offset];
@@ -798,7 +796,6 @@ function rbyte(_this, unsigned) {
798
796
  return read > 127 ? read - 256 : read;
799
797
  }
800
798
  }
801
- exports.rbyte = rbyte;
802
799
  function wint16(_this, value, unsigned, endian) {
803
800
  check_size(_this, 2, 0);
804
801
  if (unsigned == true) {
@@ -826,7 +823,6 @@ function wint16(_this, value, unsigned, endian) {
826
823
  _this.offset += 2;
827
824
  _this.bitoffset = 0;
828
825
  }
829
- exports.wint16 = wint16;
830
826
  function rint16(_this, unsigned, endian) {
831
827
  check_size(_this, 2);
832
828
  var read;
@@ -845,7 +841,6 @@ function rint16(_this, unsigned, endian) {
845
841
  return read & 0xFFFF;
846
842
  }
847
843
  }
848
- exports.rint16 = rint16;
849
844
  function rhalffloat(_this, endian) {
850
845
  var uint16Value = _this.readInt16(true, (endian != undefined ? endian : _this.endian));
851
846
  const sign = (uint16Value & 0x8000) >> 15;
@@ -875,7 +870,6 @@ function rhalffloat(_this, endian) {
875
870
  }
876
871
  return floatValue;
877
872
  }
878
- exports.rhalffloat = rhalffloat;
879
873
  function whalffloat(_this, value, endian) {
880
874
  check_size(_this, 2, 0);
881
875
  const maxValue = 65504;
@@ -919,7 +913,6 @@ function whalffloat(_this, value, endian) {
919
913
  _this.offset += 2;
920
914
  _this.bitoffset = 0;
921
915
  }
922
- exports.whalffloat = whalffloat;
923
916
  function wint32(_this, value, unsigned, endian) {
924
917
  check_size(_this, 4, 0);
925
918
  if (unsigned == true) {
@@ -951,7 +944,6 @@ function wint32(_this, value, unsigned, endian) {
951
944
  _this.offset += 4;
952
945
  _this.bitoffset = 0;
953
946
  }
954
- exports.wint32 = wint32;
955
947
  function rint32(_this, unsigned, endian) {
956
948
  check_size(_this, 4);
957
949
  var read;
@@ -970,7 +962,6 @@ function rint32(_this, unsigned, endian) {
970
962
  return read >>> 0;
971
963
  }
972
964
  }
973
- exports.rint32 = rint32;
974
965
  function rfloat(_this, endian) {
975
966
  var uint32Value = _this.readInt32(true, (endian == undefined ? _this.endian : endian));
976
967
  // Check if the value is negative (i.e., the most significant bit is set)
@@ -994,7 +985,6 @@ function rfloat(_this, endian) {
994
985
  }
995
986
  return floatValue;
996
987
  }
997
- exports.rfloat = rfloat;
998
988
  function wfloat(_this, value, endian) {
999
989
  check_size(_this, 4, 0);
1000
990
  const maxValue = 3.402823466e+38;
@@ -1017,7 +1007,6 @@ function wfloat(_this, value, endian) {
1017
1007
  _this.offset += 4;
1018
1008
  _this.bitoffset = 0;
1019
1009
  }
1020
- exports.wfloat = wfloat;
1021
1010
  function rint64(_this, unsigned, endian) {
1022
1011
  check_size(_this, 8);
1023
1012
  // Convert the byte array to a BigInt
@@ -1048,7 +1037,6 @@ function rint64(_this, unsigned, endian) {
1048
1037
  _this.bitoffset = 0;
1049
1038
  return value;
1050
1039
  }
1051
- exports.rint64 = rint64;
1052
1040
  function wint64(_this, value, unsigned, endian) {
1053
1041
  check_size(_this, 8, 0);
1054
1042
  if (unsigned == true) {
@@ -1103,7 +1091,6 @@ function wint64(_this, value, unsigned, endian) {
1103
1091
  _this.offset += 8;
1104
1092
  _this.bitoffset = 0;
1105
1093
  }
1106
- exports.wint64 = wint64;
1107
1094
  function wdfloat(_this, value, endian) {
1108
1095
  check_size(_this, 8, 0);
1109
1096
  const maxValue = 1.7976931348623158e308;
@@ -1127,7 +1114,6 @@ function wdfloat(_this, value, endian) {
1127
1114
  _this.offset += 8;
1128
1115
  _this.bitoffset = 0;
1129
1116
  }
1130
- exports.wdfloat = wdfloat;
1131
1117
  function rdfloat(_this, endian) {
1132
1118
  var uint64Value = _this.readInt64(true, (endian == undefined ? _this.endian : endian));
1133
1119
  const sign = (uint64Value & 0x8000000000000000n) >> 63n;
@@ -1157,7 +1143,6 @@ function rdfloat(_this, endian) {
1157
1143
  }
1158
1144
  return floatValue;
1159
1145
  }
1160
- exports.rdfloat = rdfloat;
1161
1146
  function rstring(_this, options) {
1162
1147
  var length = options && options.length;
1163
1148
  var stringType = options && options.stringType || 'utf-8';
@@ -1280,7 +1265,6 @@ function rstring(_this, options) {
1280
1265
  throw new Error('Unsupported string type: ' + stringType);
1281
1266
  }
1282
1267
  }
1283
- exports.rstring = rstring;
1284
1268
  function wstring(_this, string, options) {
1285
1269
  var length = options && options.length;
1286
1270
  var stringType = options && options.stringType || 'utf-8';
@@ -1407,14 +1391,13 @@ function wstring(_this, string, options) {
1407
1391
  throw new Error('Unsupported string type: ' + stringType);
1408
1392
  }
1409
1393
  }
1410
- exports.wstring = wstring;
1411
1394
  /**
1412
1395
  * Binary reader, includes bitfields and strings
1413
1396
  *
1414
- * @param {Buffer|Uint8Array} data - ```Buffer``` or ```Uint8Array```. Always found in ``biwriter.data``
1397
+ * @param {Buffer|Uint8Array} data - ``Buffer`` or ``Uint8Array``. Always found in ``biwriter.data``
1415
1398
  * @param {number} byteOffset - Byte offset to start reader (default 0)
1416
1399
  * @param {number} bitOffset - Bit offset 0-7 to start reader (default 0)
1417
- * @param {string} endianness - Endianness ```big``` or ```little``` (default ```little```)
1400
+ * @param {string} endianness - Endianness ``big`` or ``little`` (default ``little``)
1418
1401
  * @param {boolean} strict - Strict mode: if true does not extend supplied array on outside write (default true)
1419
1402
  */
1420
1403
  class bireader {
@@ -1427,10 +1410,10 @@ class bireader {
1427
1410
  /**
1428
1411
  * Binary reader, includes bitfields and strings
1429
1412
  *
1430
- * @param {Buffer|Uint8Array} data - ```Buffer``` or ```Uint8Array```. Always found in ``biwriter.data``
1413
+ * @param {Buffer|Uint8Array} data - ``Buffer`` or ``Uint8Array``. Always found in ``biwriter.data``
1431
1414
  * @param {number} byteOffset - Byte offset to start reader (default 0)
1432
1415
  * @param {number} bitOffset - Bit offset 0-7 to start reader (default 0)
1433
- * @param {string} endianness - Endianness ```big``` or ```little``` (default ```little```)
1416
+ * @param {string} endianness - Endianness ``big`` or ``little`` (default ``little``)
1434
1417
  * @param {boolean} strict - Strict mode: if true does not extend supplied array on outside write (default true)
1435
1418
  */
1436
1419
  constructor(data, byteOffset, bitOffset, endianness, strict) {
@@ -1484,7 +1467,7 @@ class bireader {
1484
1467
  *
1485
1468
  * Can be changed at any time, doesn't loose position
1486
1469
  *
1487
- * @param {string} endian - endianness ```big``` or ```little```
1470
+ * @param {string} endian - endianness ``big`` or ``little``
1488
1471
  */
1489
1472
  endianness(endian) {
1490
1473
  if (endian == undefined || typeof endian != "string") {
@@ -1535,6 +1518,26 @@ class bireader {
1535
1518
  // move from current position
1536
1519
  //
1537
1520
  /**
1521
+ * Aligns current byte position
1522
+ *
1523
+ * Note: Will extend array if strict mode is off and outside of max size
1524
+ *
1525
+ * @param {number} number - Byte to align
1526
+ */
1527
+ align(number) {
1528
+ return align(this, number);
1529
+ }
1530
+ /**
1531
+ * Reverse aligns current byte position
1532
+ *
1533
+ * Note: Will extend array if strict mode is off and outside of max size
1534
+ *
1535
+ * @param {number} number - Byte to align
1536
+ */
1537
+ alignRev(number) {
1538
+ return alignRev(this, number);
1539
+ }
1540
+ /**
1538
1541
  * Offset current byte or bit position
1539
1542
  * Note: Will extend array if strict mode is off and outside of max size
1540
1543
  *
@@ -2091,7 +2094,7 @@ class bireader {
2091
2094
  * @param {number} endOffset - End location (default end of data)
2092
2095
  * @param {boolean} consume - Move position to end of lifted data (default false)
2093
2096
  * @param {number} fillValue - Byte value to to fill returned data (does NOT fill unless supplied)
2094
- * @returns {Buffer|Uint8Array} Selected data as ```Uint8Array``` or ```Buffer```
2097
+ * @returns {Buffer|Uint8Array} Selected data as ``Uint8Array`` or ``Buffer``
2095
2098
  */
2096
2099
  lift(startOffset, endOffset, consume, fillValue) {
2097
2100
  return remove(this, startOffset || this.offset, endOffset || this.size, consume || false, false, fillValue);
@@ -2103,7 +2106,7 @@ class bireader {
2103
2106
  * @param {number} endOffset - End location (default end of data)
2104
2107
  * @param {boolean} consume - Move position to end of lifted data (default false)
2105
2108
  * @param {number} fillValue - Byte value to to fill returned data (does NOT fill unless supplied)
2106
- * @returns {Buffer|Uint8Array} Selected data as ```Uint8Array``` or ```Buffer```
2109
+ * @returns {Buffer|Uint8Array} Selected data as ``Uint8Array`` or ``Buffer``
2107
2110
  */
2108
2111
  fill(startOffset, endOffset, consume, fillValue) {
2109
2112
  return remove(this, startOffset || this.offset, endOffset || this.size, consume || false, false, fillValue);
@@ -2114,7 +2117,7 @@ class bireader {
2114
2117
  *
2115
2118
  * @param {number} length - Length of data in bytes to copy from current offset
2116
2119
  * @param {number} consume - Moves offset to end of length
2117
- * @returns {Buffer|Uint8Array} Selected data as ```Uint8Array``` or ```Buffer```
2120
+ * @returns {Buffer|Uint8Array} Selected data as ``Uint8Array`` or ``Buffer``
2118
2121
  */
2119
2122
  extract(length, consume) {
2120
2123
  return remove(this, this.offset, this.offset + (length || 0), consume || false, false);
@@ -2125,7 +2128,7 @@ class bireader {
2125
2128
  *
2126
2129
  * @param {number} length - Length of data in bytes to copy from current offset
2127
2130
  * @param {number} consume - Moves offset to end of length
2128
- * @returns {Buffer|Uint8Array} Selected data as ```Uint8Array``` or ```Buffer```
2131
+ * @returns {Buffer|Uint8Array} Selected data as ``Uint8Array`` or ``Buffer``
2129
2132
  */
2130
2133
  slice(length, consume) {
2131
2134
  return remove(this, this.offset, this.offset + (length || 0), consume || false, false);
@@ -2136,7 +2139,7 @@ class bireader {
2136
2139
  *
2137
2140
  * @param {number} length - Length of data in bytes to copy from current offset
2138
2141
  * @param {number} consume - Moves offset to end of length
2139
- * @returns {Buffer|Uint8Array} Selected data as ```Uint8Array``` or ```Buffer```
2142
+ * @returns {Buffer|Uint8Array} Selected data as ``Uint8Array`` or ``Buffer``
2140
2143
  */
2141
2144
  wrap(length, consume) {
2142
2145
  return remove(this, this.offset, this.offset + (length || 0), consume || false, false);
@@ -2148,7 +2151,7 @@ class bireader {
2148
2151
  * Inserts data into data
2149
2152
  * Note: Must be same data type as supplied data. Errors on strict mode.
2150
2153
  *
2151
- * @param {Buffer|Uint8Array} data - ```Uint8Array``` or ```Buffer``` to add to data
2154
+ * @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to add to data
2152
2155
  * @param {boolean} consume - Move current byte position to end of data (default false)
2153
2156
  * @param {number} offset - Byte position to add at (defaults to current position)
2154
2157
  */
@@ -2159,7 +2162,7 @@ class bireader {
2159
2162
  * Inserts data into data
2160
2163
  * Note: Must be same data type as supplied data. Errors on strict mode.
2161
2164
  *
2162
- * @param {Buffer|Uint8Array} data - ```Uint8Array``` or ```Buffer``` to add to data
2165
+ * @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to add to data
2163
2166
  * @param {boolean} consume - Move current byte position to end of data (default false)
2164
2167
  * @param {number} offset - Byte position to add at (defaults to current position)
2165
2168
  */
@@ -2170,7 +2173,7 @@ class bireader {
2170
2173
  * Replaces data in data
2171
2174
  * Note: Must be same data type as supplied data. Errors on strict mode.
2172
2175
  *
2173
- * @param {Buffer|Uint8Array} data - ```Uint8Array``` or ```Buffer``` to replace in data
2176
+ * @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to replace in data
2174
2177
  * @param {boolean} consume - Move current byte position to end of data (default false)
2175
2178
  * @param {number} offset - Offset to add it at (defaults to current position)
2176
2179
  */
@@ -2181,7 +2184,7 @@ class bireader {
2181
2184
  * Replaces data in data
2182
2185
  * Note: Must be same data type as supplied data. Errors on strict mode.
2183
2186
  *
2184
- * @param {Buffer|Uint8Array} data - ```Uint8Array``` or ```Buffer``` to replace in data
2187
+ * @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to replace in data
2185
2188
  * @param {boolean} consume - Move current byte position to end of data (default false)
2186
2189
  * @param {number} offset - Offset to add it at (defaults to current position)
2187
2190
  */
@@ -2192,7 +2195,7 @@ class bireader {
2192
2195
  * Adds data to start of supplied data
2193
2196
  * Note: Must be same data type as supplied data. Errors on strict mode.
2194
2197
  *
2195
- * @param {Buffer|Uint8Array} data - ```Uint8Array``` or ```Buffer``` to add to data
2198
+ * @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to add to data
2196
2199
  * @param {boolean} consume - Move current write position to end of data (default false)
2197
2200
  */
2198
2201
  unshift(data, consume) {
@@ -2202,7 +2205,7 @@ class bireader {
2202
2205
  * Adds data to start of supplied data
2203
2206
  * Note: Must be same data type as supplied data. Errors on strict mode.
2204
2207
  *
2205
- * @param {Buffer|Uint8Array} data - ```Uint8Array``` or ```Buffer``` to add to data
2208
+ * @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to add to data
2206
2209
  * @param {boolean} consume - Move current write position to end of data (default false)
2207
2210
  */
2208
2211
  prepend(data, consume) {
@@ -2212,7 +2215,7 @@ class bireader {
2212
2215
  * Adds data to end of supplied data
2213
2216
  * Note: Must be same data type as supplied data. Errors on strict mode.
2214
2217
  *
2215
- * @param {Buffer|Uint8Array} data - ```Uint8Array``` or ```Buffer``` to add to data
2218
+ * @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to add to data
2216
2219
  * @param {boolean} consume - Move current write position to end of data (default false)
2217
2220
  */
2218
2221
  push(data, consume) {
@@ -2222,7 +2225,7 @@ class bireader {
2222
2225
  * Adds data to end of supplied data
2223
2226
  * Note: Must be same data type as supplied data. Errors on strict mode.
2224
2227
  *
2225
- * @param {Buffer|Uint8Array} data - ```Uint8Array``` or ```Buffer``` to add to data
2228
+ * @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to add to data
2226
2229
  * @param {boolean} consume - Move current write position to end of data (default false)
2227
2230
  */
2228
2231
  append(data, consume) {
@@ -2322,7 +2325,7 @@ class bireader {
2322
2325
  *
2323
2326
  * @param {number} bits - bits to read
2324
2327
  * @param {boolean} unsigned - if the value is unsigned
2325
- * @param {string} endian - ``big`` or ``little`
2328
+ * @param {string} endian - ``big`` or ``little``
2326
2329
  * @returns number
2327
2330
  */
2328
2331
  readBit(bits, unsigned, endian) {
@@ -2335,7 +2338,7 @@ class bireader {
2335
2338
  *
2336
2339
  * @param {number} bits - bits to read
2337
2340
  * @param {boolean} unsigned - if the value is unsigned
2338
- * @param {string} endian - ``big`` or ``little`
2341
+ * @param {string} endian - ``big`` or ``little``
2339
2342
  * @returns number
2340
2343
  */
2341
2344
  bit(bits, unsigned, endian) {
@@ -2347,7 +2350,7 @@ class bireader {
2347
2350
  * Note: When returning to a byte read, remaining bits are dropped
2348
2351
  *
2349
2352
  * @param {number} bits - bits to read
2350
- * @param {string} endian - ``big`` or ``little`
2353
+ * @param {string} endian - ``big`` or ``little``
2351
2354
  * @returns number
2352
2355
  */
2353
2356
  ubit(bits, endian) {
@@ -2359,7 +2362,7 @@ class bireader {
2359
2362
  * Note: When returning to a byte read, remaining bits are dropped
2360
2363
  *
2361
2364
  * @param {boolean} unsigned - if the value is unsigned
2362
- * @param {string} endian - ``big`` or ``little`
2365
+ * @param {string} endian - ``big`` or ``little``
2363
2366
  * @returns number
2364
2367
  */
2365
2368
  bit1(unsigned, endian) {
@@ -4484,6 +4487,14 @@ class bireader {
4484
4487
  return wbyte(this, value, unsigned);
4485
4488
  }
4486
4489
  /**
4490
+ * Write unsigned byte
4491
+ *
4492
+ * @param {number} value - value as int
4493
+ */
4494
+ writeUByte(value) {
4495
+ return wbyte(this, value, true);
4496
+ }
4497
+ /**
4487
4498
  * Read byte
4488
4499
  *
4489
4500
  * @param {boolean} unsigned - if value is unsigned or not
@@ -4532,7 +4543,7 @@ class bireader {
4532
4543
  * Read short
4533
4544
  *
4534
4545
  * @param {boolean} unsigned - if value is unsigned or not
4535
- * @param {string} endian - ```big``` or ```little```
4546
+ * @param {string} endian - ``big`` or ``little``
4536
4547
  * @returns number
4537
4548
  */
4538
4549
  readInt16(unsigned, endian) {
@@ -4543,16 +4554,25 @@ class bireader {
4543
4554
  *
4544
4555
  * @param {number} value - value as int
4545
4556
  * @param {boolean} unsigned - if the value is unsigned
4546
- * @param {string} endian - ``big`` or ``little`
4557
+ * @param {string} endian - ``big`` or ``little``
4547
4558
  */
4548
4559
  writeInt16(value, unsigned, endian) {
4549
4560
  return wint16(this, value, unsigned, endian);
4550
4561
  }
4551
4562
  /**
4563
+ * Write unsigned int16
4564
+ *
4565
+ * @param {number} value - value as int
4566
+ * @param {string} endian - ``big`` or ``little``
4567
+ */
4568
+ writeUInt16(value, endian) {
4569
+ return wint16(this, value, true, endian);
4570
+ }
4571
+ /**
4552
4572
  * Read short
4553
4573
  *
4554
4574
  * @param {boolean} unsigned - if value is unsigned or not
4555
- * @param {string} endian - ```big``` or ```little```
4575
+ * @param {string} endian - ``big`` or ``little``
4556
4576
  * @returns number
4557
4577
  */
4558
4578
  int16(unsigned, endian) {
@@ -4562,7 +4582,7 @@ class bireader {
4562
4582
  * Read short
4563
4583
  *
4564
4584
  * @param {boolean} unsigned - if value is unsigned or not
4565
- * @param {string} endian - ```big``` or ```little```
4585
+ * @param {string} endian - ``big`` or ``little``
4566
4586
  * @returns number
4567
4587
  */
4568
4588
  short(unsigned, endian) {
@@ -4572,7 +4592,7 @@ class bireader {
4572
4592
  * Read short
4573
4593
  *
4574
4594
  * @param {boolean} unsigned - if value is unsigned or not
4575
- * @param {string} endian - ```big``` or ```little```
4595
+ * @param {string} endian - ``big`` or ``little``
4576
4596
  * @returns number
4577
4597
  */
4578
4598
  word(unsigned, endian) {
@@ -4581,7 +4601,7 @@ class bireader {
4581
4601
  /**
4582
4602
  * Read unsigned short
4583
4603
  *
4584
- * @param {string} endian - ```big``` or ```little```
4604
+ * @param {string} endian - ``big`` or ``little``
4585
4605
  *
4586
4606
  * @returns number
4587
4607
  */
@@ -4591,7 +4611,7 @@ class bireader {
4591
4611
  /**
4592
4612
  * Read unsigned short
4593
4613
  *
4594
- * @param {string} endian - ```big``` or ```little```
4614
+ * @param {string} endian - ``big`` or ``little``
4595
4615
  *
4596
4616
  * @returns number
4597
4617
  */
@@ -4601,7 +4621,7 @@ class bireader {
4601
4621
  /**
4602
4622
  * Read unsigned short
4603
4623
  *
4604
- * @param {string} endian - ```big``` or ```little```
4624
+ * @param {string} endian - ``big`` or ``little``
4605
4625
  *
4606
4626
  * @returns number
4607
4627
  */
@@ -4611,7 +4631,7 @@ class bireader {
4611
4631
  /**
4612
4632
  * Read unsigned short
4613
4633
  *
4614
- * @param {string} endian - ```big``` or ```little```
4634
+ * @param {string} endian - ``big`` or ``little``
4615
4635
  *
4616
4636
  * @returns number
4617
4637
  */
@@ -4752,7 +4772,7 @@ class bireader {
4752
4772
  /**
4753
4773
  * Read half float
4754
4774
  *
4755
- * @param {string} endian - ```big``` or ```little```
4775
+ * @param {string} endian - ``big`` or ``little``
4756
4776
  * @returns number
4757
4777
  */
4758
4778
  readHalfFloat(endian) {
@@ -4762,7 +4782,7 @@ class bireader {
4762
4782
  * Writes half float
4763
4783
  *
4764
4784
  * @param {number} value - value as int
4765
- * @param {string} endian - ``big`` or ``little`
4785
+ * @param {string} endian - ``big`` or ``little``
4766
4786
  */
4767
4787
  writeHalfFloat(value, endian) {
4768
4788
  return whalffloat(this, value, endian);
@@ -4770,7 +4790,7 @@ class bireader {
4770
4790
  /**
4771
4791
  * Read half float
4772
4792
  *
4773
- * @param {string} endian - ```big``` or ```little```
4793
+ * @param {string} endian - ``big`` or ``little``
4774
4794
  * @returns number
4775
4795
  */
4776
4796
  halffloat(endian) {
@@ -4779,7 +4799,7 @@ class bireader {
4779
4799
  /**
4780
4800
  * Read half float
4781
4801
  *
4782
- * @param {string} endian - ```big``` or ```little```
4802
+ * @param {string} endian - ``big`` or ``little``
4783
4803
  * @returns number
4784
4804
  */
4785
4805
  half(endian) {
@@ -4840,7 +4860,7 @@ class bireader {
4840
4860
  * Read 32 bit integer
4841
4861
  *
4842
4862
  * @param {boolean} unsigned - if value is unsigned or not
4843
- * @param {string} endian - ```big``` or ```little```
4863
+ * @param {string} endian - ``big`` or ``little``
4844
4864
  * @returns number
4845
4865
  */
4846
4866
  readInt32(unsigned, endian) {
@@ -4851,16 +4871,25 @@ class bireader {
4851
4871
  *
4852
4872
  * @param {number} value - value as int
4853
4873
  * @param {boolean} unsigned - if the value is unsigned
4854
- * @param {string} endian - ``big`` or ``little`
4874
+ * @param {string} endian - ``big`` or ``little``
4855
4875
  */
4856
4876
  writeInt32(value, unsigned, endian) {
4857
4877
  return wint32(this, value, unsigned, endian);
4858
4878
  }
4859
4879
  /**
4880
+ * Write unsigned int32
4881
+ *
4882
+ * @param {number} value - value as int
4883
+ * @param {string} endian - ``big`` or ``little``
4884
+ */
4885
+ writeUInt32(value, endian) {
4886
+ return wint32(this, value, true, endian);
4887
+ }
4888
+ /**
4860
4889
  * Read 32 bit integer
4861
4890
  *
4862
4891
  * @param {boolean} unsigned - if value is unsigned or not
4863
- * @param {string} endian - ```big``` or ```little```
4892
+ * @param {string} endian - ``big`` or ``little``
4864
4893
  * @returns number
4865
4894
  */
4866
4895
  int(unsigned, endian) {
@@ -4870,7 +4899,7 @@ class bireader {
4870
4899
  * Read 32 bit integer
4871
4900
  *
4872
4901
  * @param {boolean} unsigned - if value is unsigned or not
4873
- * @param {string} endian - ```big``` or ```little```
4902
+ * @param {string} endian - ``big`` or ``little``
4874
4903
  * @returns number
4875
4904
  */
4876
4905
  double(unsigned, endian) {
@@ -4880,7 +4909,7 @@ class bireader {
4880
4909
  * Read 32 bit integer
4881
4910
  *
4882
4911
  * @param {boolean} unsigned - if value is unsigned or not
4883
- * @param {string} endian - ```big``` or ```little```
4912
+ * @param {string} endian - ``big`` or ``little``
4884
4913
  * @returns number
4885
4914
  */
4886
4915
  int32(unsigned, endian) {
@@ -4890,7 +4919,7 @@ class bireader {
4890
4919
  * Read 32 bit integer
4891
4920
  *
4892
4921
  * @param {boolean} unsigned - if value is unsigned or not
4893
- * @param {string} endian - ```big``` or ```little```
4922
+ * @param {string} endian - ``big`` or ``little``
4894
4923
  * @returns number
4895
4924
  */
4896
4925
  long(unsigned, endian) {
@@ -5102,25 +5131,25 @@ class bireader {
5102
5131
  /**
5103
5132
  * Read float
5104
5133
  *
5105
- * @param {string} endian - ```big``` or ```little```
5134
+ * @param {string} endian - ``big`` or ``little``
5106
5135
  * @returns number
5107
5136
  */
5108
5137
  readFloat(endian) {
5109
5138
  return rfloat(this, endian);
5110
5139
  }
5111
5140
  /**
5112
- * Write float
5113
- *
5114
- * @param {number} value - value as int
5115
- * @param {string} endian - ``big`` or ``little`
5116
- */
5141
+ * Write float
5142
+ *
5143
+ * @param {number} value - value as int
5144
+ * @param {string} endian - ``big`` or ``little``
5145
+ */
5117
5146
  writeFloat(value, endian) {
5118
5147
  return wfloat(this, value, endian);
5119
5148
  }
5120
5149
  /**
5121
5150
  * Read float
5122
5151
  *
5123
- * @param {string} endian - ```big``` or ```little```
5152
+ * @param {string} endian - ``big`` or ``little``
5124
5153
  * @returns number
5125
5154
  */
5126
5155
  float(endian) {
@@ -5164,7 +5193,7 @@ class bireader {
5164
5193
  /**
5165
5194
  * Read signed 64 bit integer
5166
5195
  * @param {boolean} unsigned - if value is unsigned or not
5167
- * @param {string} endian - ```big``` or ```little```
5196
+ * @param {string} endian - ``big`` or ``little``
5168
5197
  * @returns number
5169
5198
  */
5170
5199
  readInt64(unsigned, endian) {
@@ -5175,7 +5204,7 @@ class bireader {
5175
5204
  *
5176
5205
  * @param {number} value - value as int
5177
5206
  * @param {boolean} unsigned - if the value is unsigned
5178
- * @param {string} endian - ``big`` or ``little`
5207
+ * @param {string} endian - ``big`` or ``little``
5179
5208
  */
5180
5209
  writeInt64(value, unsigned, endian) {
5181
5210
  return wint64(this, value, unsigned, endian);
@@ -5183,7 +5212,7 @@ class bireader {
5183
5212
  /**
5184
5213
  * Read signed 64 bit integer
5185
5214
  * @param {boolean} unsigned - if value is unsigned or not
5186
- * @param {string} endian - ```big``` or ```little```
5215
+ * @param {string} endian - ``big`` or ``little``
5187
5216
  * @returns number
5188
5217
  */
5189
5218
  int64(unsigned, endian) {
@@ -5192,7 +5221,7 @@ class bireader {
5192
5221
  /**
5193
5222
  * Read signed 64 bit integer
5194
5223
  * @param {boolean} unsigned - if value is unsigned or not
5195
- * @param {string} endian - ```big``` or ```little```
5224
+ * @param {string} endian - ``big`` or ``little``
5196
5225
  * @returns number
5197
5226
  */
5198
5227
  bigint(unsigned, endian) {
@@ -5201,7 +5230,7 @@ class bireader {
5201
5230
  /**
5202
5231
  * Read signed 64 bit integer
5203
5232
  * @param {boolean} unsigned - if value is unsigned or not
5204
- * @param {string} endian - ```big``` or ```little```
5233
+ * @param {string} endian - ``big`` or ``little``
5205
5234
  * @returns number
5206
5235
  */
5207
5236
  quad(unsigned, endian) {
@@ -5373,7 +5402,7 @@ class bireader {
5373
5402
  /**
5374
5403
  * Read double float
5375
5404
  *
5376
- * @param {string} endian - ```big``` or ```little```
5405
+ * @param {string} endian - ``big`` or ``little``
5377
5406
  * @returns number
5378
5407
  */
5379
5408
  readDoubleFloat(endian) {
@@ -5384,7 +5413,7 @@ class bireader {
5384
5413
  *
5385
5414
  * @param {number} value - value as int
5386
5415
  * @param {number} offset - byte offset (default last write position)
5387
- * @param {string} endian - ``big`` or ``little`
5416
+ * @param {string} endian - ``big`` or ``little``
5388
5417
  */
5389
5418
  writeDoubleFloat(value, endian) {
5390
5419
  return wdfloat(this, value, endian);
@@ -5392,7 +5421,7 @@ class bireader {
5392
5421
  /**
5393
5422
  * Read double float
5394
5423
  *
5395
- * @param {string} endian - ```big``` or ```little```
5424
+ * @param {string} endian - ``big`` or ``little``
5396
5425
  * @returns number
5397
5426
  */
5398
5427
  doublefloat(endian) {
@@ -5401,7 +5430,7 @@ class bireader {
5401
5430
  /**
5402
5431
  * Read double float
5403
5432
  *
5404
- * @param {string} endian - ```big``` or ```little```
5433
+ * @param {string} endian - ``big`` or ``little``
5405
5434
  * @returns number
5406
5435
  */
5407
5436
  dfloat(endian) {
@@ -5895,7 +5924,7 @@ class biwriter {
5895
5924
  *
5896
5925
  * Can be changed at any time, doesn't loose position
5897
5926
  *
5898
- * @param {string} endian - Endianness ```big``` or ```little```
5927
+ * @param {string} endian - Endianness ``big`` or ``little``
5899
5928
  */
5900
5929
  endianness(endian) {
5901
5930
  if (endian == undefined || typeof endian != "string") {
@@ -5952,7 +5981,28 @@ class biwriter {
5952
5981
  // move from current position
5953
5982
  //
5954
5983
  /**
5984
+ * Aligns current byte position
5985
+ *
5986
+ * Note: Will extend array if strict mode is off and outside of max size
5987
+ *
5988
+ * @param {number} number - Byte to align
5989
+ */
5990
+ align(number) {
5991
+ return align(this, number);
5992
+ }
5993
+ /**
5994
+ * Reverse aligns current byte position
5995
+ *
5996
+ * Note: Will extend array if strict mode is off and outside of max size
5997
+ *
5998
+ * @param {number} number - Byte to align
5999
+ */
6000
+ alignRev(number) {
6001
+ return alignRev(this, number);
6002
+ }
6003
+ /**
5955
6004
  * Offset current byte or bit position
6005
+ *
5956
6006
  * Note: Will extend array if strict mode is off and outside of max size
5957
6007
  *
5958
6008
  * @param {number} bytes - Bytes to skip
@@ -6508,7 +6558,7 @@ class biwriter {
6508
6558
  * @param {number} endOffset - End location (default end of data)
6509
6559
  * @param {boolean} consume - Move position to end of lifted data (default false)
6510
6560
  * @param {number} fillValue - Byte value to to fill returned data (does NOT fill unless supplied)
6511
- * @returns {Buffer|Uint8Array} Selected data as ```Uint8Array``` or ```Buffer```
6561
+ * @returns {Buffer|Uint8Array} Selected data as ``Uint8Array`` or ``Buffer``
6512
6562
  */
6513
6563
  lift(startOffset, endOffset, consume, fillValue) {
6514
6564
  return remove(this, startOffset || this.offset, endOffset || this.size, consume || false, false, fillValue);
@@ -6520,7 +6570,7 @@ class biwriter {
6520
6570
  * @param {number} endOffset - End location (default end of data)
6521
6571
  * @param {boolean} consume - Move position to end of lifted data (default false)
6522
6572
  * @param {number} fillValue - Byte value to to fill returned data (does NOT fill unless supplied)
6523
- * @returns {Buffer|Uint8Array} Selected data as ```Uint8Array``` or ```Buffer```
6573
+ * @returns {Buffer|Uint8Array} Selected data as ``Uint8Array`` or ``Buffer``
6524
6574
  */
6525
6575
  fill(startOffset, endOffset, consume, fillValue) {
6526
6576
  return remove(this, startOffset || this.offset, endOffset || this.size, consume || false, false, fillValue);
@@ -6531,7 +6581,7 @@ class biwriter {
6531
6581
  *
6532
6582
  * @param {number} length - Length of data in bytes to copy from current offset
6533
6583
  * @param {number} consume - Moves offset to end of length
6534
- * @returns {Buffer|Uint8Array} Selected data as ```Uint8Array``` or ```Buffer```
6584
+ * @returns {Buffer|Uint8Array} Selected data as ``Uint8Array`` or ``Buffer``
6535
6585
  */
6536
6586
  extract(length, consume) {
6537
6587
  return remove(this, this.offset, this.offset + (length || 0), consume || false, false);
@@ -6542,7 +6592,7 @@ class biwriter {
6542
6592
  *
6543
6593
  * @param {number} length - Length of data in bytes to copy from current offset
6544
6594
  * @param {number} consume - Moves offset to end of length
6545
- * @returns {Buffer|Uint8Array} Selected data as ```Uint8Array``` or ```Buffer```
6595
+ * @returns {Buffer|Uint8Array} Selected data as ``Uint8Array`` or ``Buffer``
6546
6596
  */
6547
6597
  slice(length, consume) {
6548
6598
  return remove(this, this.offset, this.offset + (length || 0), consume || false, false);
@@ -6553,7 +6603,7 @@ class biwriter {
6553
6603
  *
6554
6604
  * @param {number} length - Length of data in bytes to copy from current offset
6555
6605
  * @param {number} consume - Moves offset to end of length
6556
- * @returns {Buffer|Uint8Array} Selected data as ```Uint8Array``` or ```Buffer```
6606
+ * @returns {Buffer|Uint8Array} Selected data as ``Uint8Array`` or ``Buffer``
6557
6607
  */
6558
6608
  wrap(length, consume) {
6559
6609
  return remove(this, this.offset, this.offset + (length || 0), consume || false, false);
@@ -6565,7 +6615,7 @@ class biwriter {
6565
6615
  * Inserts data into data
6566
6616
  * Note: Must be same data type as supplied data. Errors on strict mode.
6567
6617
  *
6568
- * @param {Buffer|Uint8Array} data - ```Uint8Array``` or ```Buffer``` to add to data
6618
+ * @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to add to data
6569
6619
  * @param {boolean} consume - Move current byte position to end of data (default false)
6570
6620
  * @param {number} offset - Byte position to add at (defaults to current position)
6571
6621
  */
@@ -6576,7 +6626,7 @@ class biwriter {
6576
6626
  * Inserts data into data
6577
6627
  * Note: Must be same data type as supplied data. Errors on strict mode.
6578
6628
  *
6579
- * @param {Buffer|Uint8Array} data - ```Uint8Array``` or ```Buffer``` to add to data
6629
+ * @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to add to data
6580
6630
  * @param {boolean} consume - Move current byte position to end of data (default false)
6581
6631
  * @param {number} offset - Byte position to add at (defaults to current position)
6582
6632
  */
@@ -6587,7 +6637,7 @@ class biwriter {
6587
6637
  * Replaces data in data
6588
6638
  * Note: Must be same data type as supplied data. Errors on strict mode.
6589
6639
  *
6590
- * @param {Buffer|Uint8Array} data - ```Uint8Array``` or ```Buffer``` to replace in data
6640
+ * @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to replace in data
6591
6641
  * @param {boolean} consume - Move current byte position to end of data (default false)
6592
6642
  * @param {number} offset - Offset to add it at (defaults to current position)
6593
6643
  */
@@ -6598,7 +6648,7 @@ class biwriter {
6598
6648
  * Replaces data in data
6599
6649
  * Note: Must be same data type as supplied data. Errors on strict mode.
6600
6650
  *
6601
- * @param {Buffer|Uint8Array} data - ```Uint8Array``` or ```Buffer``` to replace in data
6651
+ * @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to replace in data
6602
6652
  * @param {boolean} consume - Move current byte position to end of data (default false)
6603
6653
  * @param {number} offset - Offset to add it at (defaults to current position)
6604
6654
  */
@@ -6609,7 +6659,7 @@ class biwriter {
6609
6659
  * Adds data to start of supplied data
6610
6660
  * Note: Must be same data type as supplied data. Errors on strict mode.
6611
6661
  *
6612
- * @param {Buffer|Uint8Array} data - ```Uint8Array``` or ```Buffer``` to add to data
6662
+ * @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to add to data
6613
6663
  * @param {boolean} consume - Move current write position to end of data (default false)
6614
6664
  */
6615
6665
  unshift(data, consume) {
@@ -6619,7 +6669,7 @@ class biwriter {
6619
6669
  * Adds data to start of supplied data
6620
6670
  * Note: Must be same data type as supplied data. Errors on strict mode.
6621
6671
  *
6622
- * @param {Buffer|Uint8Array} data - ```Uint8Array``` or ```Buffer``` to add to data
6672
+ * @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to add to data
6623
6673
  * @param {boolean} consume - Move current write position to end of data (default false)
6624
6674
  */
6625
6675
  prepend(data, consume) {
@@ -6629,7 +6679,7 @@ class biwriter {
6629
6679
  * Adds data to end of supplied data
6630
6680
  * Note: Must be same data type as supplied data. Errors on strict mode.
6631
6681
  *
6632
- * @param {Buffer|Uint8Array} data - ```Uint8Array``` or ```Buffer``` to add to data
6682
+ * @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to add to data
6633
6683
  * @param {boolean} consume - Move current write position to end of data (default false)
6634
6684
  */
6635
6685
  push(data, consume) {
@@ -6639,7 +6689,7 @@ class biwriter {
6639
6689
  * Adds data to end of supplied data
6640
6690
  * Note: Must be same data type as supplied data. Errors on strict mode.
6641
6691
  *
6642
- * @param {Buffer|Uint8Array} data - ```Uint8Array``` or ```Buffer``` to add to data
6692
+ * @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to add to data
6643
6693
  * @param {boolean} consume - Move current write position to end of data (default false)
6644
6694
  */
6645
6695
  append(data, consume) {
@@ -6739,7 +6789,7 @@ class biwriter {
6739
6789
  *
6740
6790
  * @param {number} bits - bits to read
6741
6791
  * @param {boolean} unsigned - if the value is unsigned
6742
- * @param {string} endian - ``big`` or ``little`
6792
+ * @param {string} endian - ``big`` or ``little``
6743
6793
  * @returns number
6744
6794
  */
6745
6795
  readBit(bits, unsigned, endian) {
@@ -6753,7 +6803,7 @@ class biwriter {
6753
6803
  * @param {number} value - value as int
6754
6804
  * @param {number} bits - bits to write
6755
6805
  * @param {boolean} unsigned - if the value is unsigned
6756
- * @param {string} endian - ``big`` or ``little`
6806
+ * @param {string} endian - ``big`` or ``little``
6757
6807
  * @returns number
6758
6808
  */
6759
6809
  bit(value, bits, unsigned, endian) {
@@ -6766,7 +6816,7 @@ class biwriter {
6766
6816
  *
6767
6817
  * @param {number} value - value as int
6768
6818
  * @param {number} bits - bits to write
6769
- * @param {string} endian - ``big`` or ``little`
6819
+ * @param {string} endian - ``big`` or ``little``
6770
6820
  * @returns number
6771
6821
  */
6772
6822
  ubit(value, bits, endian) {
@@ -6879,7 +6929,7 @@ class biwriter {
6879
6929
  *
6880
6930
  * @param {number} value - value as int
6881
6931
  * @param {boolean} unsigned - if the value is unsigned
6882
- * @param {string} endian - ``big`` or ``little`
6932
+ * @param {string} endian - ``big`` or ``little``
6883
6933
  * @returns number
6884
6934
  */
6885
6935
  bit1(value, unsigned, endian) {
@@ -6915,7 +6965,7 @@ class biwriter {
6915
6965
  * Note: When returning to a byte write, remaining bits are dropped
6916
6966
  *
6917
6967
  * @param {number} value - value as int
6918
- * @param {string} endian - ``big`` or ``little`
6968
+ * @param {string} endian - ``big`` or ``little``
6919
6969
  * @returns number
6920
6970
  */
6921
6971
  ubit1(value, endian) {
@@ -6950,7 +7000,7 @@ class biwriter {
6950
7000
  *
6951
7001
  * @param {number} value - value as int
6952
7002
  * @param {boolean} unsigned - if the value is unsigned
6953
- * @param {string} endian - ``big`` or ``little`
7003
+ * @param {string} endian - ``big`` or ``little``
6954
7004
  * @returns number
6955
7005
  */
6956
7006
  bit2(value, unsigned, endian) {
@@ -6986,7 +7036,7 @@ class biwriter {
6986
7036
  * Note: When returning to a byte write, remaining bits are dropped
6987
7037
  *
6988
7038
  * @param {number} value - value as int
6989
- * @param {string} endian - ``big`` or ``little`
7039
+ * @param {string} endian - ``big`` or ``little``
6990
7040
  * @returns number
6991
7041
  */
6992
7042
  ubit2(value, endian) {
@@ -7021,7 +7071,7 @@ class biwriter {
7021
7071
  *
7022
7072
  * @param {number} value - value as int
7023
7073
  * @param {boolean} unsigned - if the value is unsigned
7024
- * @param {string} endian - ``big`` or ``little`
7074
+ * @param {string} endian - ``big`` or ``little``
7025
7075
  * @returns number
7026
7076
  */
7027
7077
  bit3(value, unsigned, endian) {
@@ -7057,7 +7107,7 @@ class biwriter {
7057
7107
  * Note: When returning to a byte write, remaining bits are dropped
7058
7108
  *
7059
7109
  * @param {number} value - value as int
7060
- * @param {string} endian - ``big`` or ``little`
7110
+ * @param {string} endian - ``big`` or ``little``
7061
7111
  * @returns number
7062
7112
  */
7063
7113
  ubit3(value, endian) {
@@ -7092,7 +7142,7 @@ class biwriter {
7092
7142
  *
7093
7143
  * @param {number} value - value as int
7094
7144
  * @param {boolean} unsigned - if the value is unsigned
7095
- * @param {string} endian - ``big`` or ``little`
7145
+ * @param {string} endian - ``big`` or ``little``
7096
7146
  * @returns number
7097
7147
  */
7098
7148
  bit4(value, unsigned, endian) {
@@ -7128,7 +7178,7 @@ class biwriter {
7128
7178
  * Note: When returning to a byte write, remaining bits are dropped
7129
7179
  *
7130
7180
  * @param {number} value - value as int
7131
- * @param {string} endian - ``big`` or ``little`
7181
+ * @param {string} endian - ``big`` or ``little``
7132
7182
  * @returns number
7133
7183
  */
7134
7184
  ubit4(value, endian) {
@@ -7163,7 +7213,7 @@ class biwriter {
7163
7213
  *
7164
7214
  * @param {number} value - value as int
7165
7215
  * @param {boolean} unsigned - if the value is unsigned
7166
- * @param {string} endian - ``big`` or ``little`
7216
+ * @param {string} endian - ``big`` or ``little``
7167
7217
  * @returns number
7168
7218
  */
7169
7219
  bit5(value, unsigned, endian) {
@@ -7199,7 +7249,7 @@ class biwriter {
7199
7249
  * Note: When returning to a byte write, remaining bits are dropped
7200
7250
  *
7201
7251
  * @param {number} value - value as int
7202
- * @param {string} endian - ``big`` or ``little`
7252
+ * @param {string} endian - ``big`` or ``little``
7203
7253
  * @returns number
7204
7254
  */
7205
7255
  ubit5(value, endian) {
@@ -7234,7 +7284,7 @@ class biwriter {
7234
7284
  *
7235
7285
  * @param {number} value - value as int
7236
7286
  * @param {boolean} unsigned - if the value is unsigned
7237
- * @param {string} endian - ``big`` or ``little`
7287
+ * @param {string} endian - ``big`` or ``little``
7238
7288
  * @returns number
7239
7289
  */
7240
7290
  bit6(value, unsigned, endian) {
@@ -7270,7 +7320,7 @@ class biwriter {
7270
7320
  * Note: When returning to a byte write, remaining bits are dropped
7271
7321
  *
7272
7322
  * @param {number} value - value as int
7273
- * @param {string} endian - ``big`` or ``little`
7323
+ * @param {string} endian - ``big`` or ``little``
7274
7324
  * @returns number
7275
7325
  */
7276
7326
  ubit6(value, endian) {
@@ -7305,7 +7355,7 @@ class biwriter {
7305
7355
  *
7306
7356
  * @param {number} value - value as int
7307
7357
  * @param {boolean} unsigned - if the value is unsigned
7308
- * @param {string} endian - ``big`` or ``little`
7358
+ * @param {string} endian - ``big`` or ``little``
7309
7359
  * @returns number
7310
7360
  */
7311
7361
  bit7(value, unsigned, endian) {
@@ -7341,7 +7391,7 @@ class biwriter {
7341
7391
  * Note: When returning to a byte write, remaining bits are dropped
7342
7392
  *
7343
7393
  * @param {number} value - value as int
7344
- * @param {string} endian - ``big`` or ``little`
7394
+ * @param {string} endian - ``big`` or ``little``
7345
7395
  * @returns number
7346
7396
  */
7347
7397
  ubit7(value, endian) {
@@ -7376,7 +7426,7 @@ class biwriter {
7376
7426
  *
7377
7427
  * @param {number} value - value as int
7378
7428
  * @param {boolean} unsigned - if the value is unsigned
7379
- * @param {string} endian - ``big`` or ``little`
7429
+ * @param {string} endian - ``big`` or ``little``
7380
7430
  * @returns number
7381
7431
  */
7382
7432
  bit8(value, unsigned, endian) {
@@ -7412,7 +7462,7 @@ class biwriter {
7412
7462
  * Note: When returning to a byte write, remaining bits are dropped
7413
7463
  *
7414
7464
  * @param {number} value - value as int
7415
- * @param {string} endian - ``big`` or ``little`
7465
+ * @param {string} endian - ``big`` or ``little``
7416
7466
  * @returns number
7417
7467
  */
7418
7468
  ubit8(value, endian) {
@@ -7447,7 +7497,7 @@ class biwriter {
7447
7497
  *
7448
7498
  * @param {number} value - value as int
7449
7499
  * @param {boolean} unsigned - if the value is unsigned
7450
- * @param {string} endian - ``big`` or ``little`
7500
+ * @param {string} endian - ``big`` or ``little``
7451
7501
  * @returns number
7452
7502
  */
7453
7503
  bit9(value, unsigned, endian) {
@@ -7483,7 +7533,7 @@ class biwriter {
7483
7533
  * Note: When returning to a byte write, remaining bits are dropped
7484
7534
  *
7485
7535
  * @param {number} value - value as int
7486
- * @param {string} endian - ``big`` or ``little`
7536
+ * @param {string} endian - ``big`` or ``little``
7487
7537
  * @returns number
7488
7538
  */
7489
7539
  ubit9(value, endian) {
@@ -7518,7 +7568,7 @@ class biwriter {
7518
7568
  *
7519
7569
  * @param {number} value - value as int
7520
7570
  * @param {boolean} unsigned - if the value is unsigned
7521
- * @param {string} endian - ``big`` or ``little`
7571
+ * @param {string} endian - ``big`` or ``little``
7522
7572
  * @returns number
7523
7573
  */
7524
7574
  bit10(value, unsigned, endian) {
@@ -7554,7 +7604,7 @@ class biwriter {
7554
7604
  * Note: When returning to a byte write, remaining bits are dropped
7555
7605
  *
7556
7606
  * @param {number} value - value as int
7557
- * @param {string} endian - ``big`` or ``little`
7607
+ * @param {string} endian - ``big`` or ``little``
7558
7608
  * @returns number
7559
7609
  */
7560
7610
  ubit10(value, endian) {
@@ -7589,7 +7639,7 @@ class biwriter {
7589
7639
  *
7590
7640
  * @param {number} value - value as int
7591
7641
  * @param {boolean} unsigned - if the value is unsigned
7592
- * @param {string} endian - ``big`` or ``little`
7642
+ * @param {string} endian - ``big`` or ``little``
7593
7643
  * @returns number
7594
7644
  */
7595
7645
  bit11(value, unsigned, endian) {
@@ -7625,7 +7675,7 @@ class biwriter {
7625
7675
  * Note: When returning to a byte write, remaining bits are dropped
7626
7676
  *
7627
7677
  * @param {number} value - value as int
7628
- * @param {string} endian - ``big`` or ``little`
7678
+ * @param {string} endian - ``big`` or ``little``
7629
7679
  * @returns number
7630
7680
  */
7631
7681
  ubit11(value, endian) {
@@ -7660,7 +7710,7 @@ class biwriter {
7660
7710
  *
7661
7711
  * @param {number} value - value as int
7662
7712
  * @param {boolean} unsigned - if the value is unsigned
7663
- * @param {string} endian - ``big`` or ``little`
7713
+ * @param {string} endian - ``big`` or ``little``
7664
7714
  * @returns number
7665
7715
  */
7666
7716
  bit12(value, unsigned, endian) {
@@ -7696,7 +7746,7 @@ class biwriter {
7696
7746
  * Note: When returning to a byte write, remaining bits are dropped
7697
7747
  *
7698
7748
  * @param {number} value - value as int
7699
- * @param {string} endian - ``big`` or ``little`
7749
+ * @param {string} endian - ``big`` or ``little``
7700
7750
  * @returns number
7701
7751
  */
7702
7752
  ubit12(value, endian) {
@@ -7731,7 +7781,7 @@ class biwriter {
7731
7781
  *
7732
7782
  * @param {number} value - value as int
7733
7783
  * @param {boolean} unsigned - if the value is unsigned
7734
- * @param {string} endian - ``big`` or ``little`
7784
+ * @param {string} endian - ``big`` or ``little``
7735
7785
  * @returns number
7736
7786
  */
7737
7787
  bit13(value, unsigned, endian) {
@@ -7767,7 +7817,7 @@ class biwriter {
7767
7817
  * Note: When returning to a byte write, remaining bits are dropped
7768
7818
  *
7769
7819
  * @param {number} value - value as int
7770
- * @param {string} endian - ``big`` or ``little`
7820
+ * @param {string} endian - ``big`` or ``little``
7771
7821
  * @returns number
7772
7822
  */
7773
7823
  ubit13(value, endian) {
@@ -7802,7 +7852,7 @@ class biwriter {
7802
7852
  *
7803
7853
  * @param {number} value - value as int
7804
7854
  * @param {boolean} unsigned - if the value is unsigned
7805
- * @param {string} endian - ``big`` or ``little`
7855
+ * @param {string} endian - ``big`` or ``little``
7806
7856
  * @returns number
7807
7857
  */
7808
7858
  bit14(value, unsigned, endian) {
@@ -7838,7 +7888,7 @@ class biwriter {
7838
7888
  * Note: When returning to a byte write, remaining bits are dropped
7839
7889
  *
7840
7890
  * @param {number} value - value as int
7841
- * @param {string} endian - ``big`` or ``little`
7891
+ * @param {string} endian - ``big`` or ``little``
7842
7892
  * @returns number
7843
7893
  */
7844
7894
  ubit14(value, endian) {
@@ -7873,7 +7923,7 @@ class biwriter {
7873
7923
  *
7874
7924
  * @param {number} value - value as int
7875
7925
  * @param {boolean} unsigned - if the value is unsigned
7876
- * @param {string} endian - ``big`` or ``little`
7926
+ * @param {string} endian - ``big`` or ``little``
7877
7927
  * @returns number
7878
7928
  */
7879
7929
  bit15(value, unsigned, endian) {
@@ -7909,7 +7959,7 @@ class biwriter {
7909
7959
  * Note: When returning to a byte write, remaining bits are dropped
7910
7960
  *
7911
7961
  * @param {number} value - value as int
7912
- * @param {string} endian - ``big`` or ``little`
7962
+ * @param {string} endian - ``big`` or ``little``
7913
7963
  * @returns number
7914
7964
  */
7915
7965
  ubit15(value, endian) {
@@ -7944,7 +7994,7 @@ class biwriter {
7944
7994
  *
7945
7995
  * @param {number} value - value as int
7946
7996
  * @param {boolean} unsigned - if the value is unsigned
7947
- * @param {string} endian - ``big`` or ``little`
7997
+ * @param {string} endian - ``big`` or ``little``
7948
7998
  * @returns number
7949
7999
  */
7950
8000
  bit16(value, unsigned, endian) {
@@ -7980,7 +8030,7 @@ class biwriter {
7980
8030
  * Note: When returning to a byte write, remaining bits are dropped
7981
8031
  *
7982
8032
  * @param {number} value - value as int
7983
- * @param {string} endian - ``big`` or ``little`
8033
+ * @param {string} endian - ``big`` or ``little``
7984
8034
  * @returns number
7985
8035
  */
7986
8036
  ubit16(value, endian) {
@@ -8015,7 +8065,7 @@ class biwriter {
8015
8065
  *
8016
8066
  * @param {number} value - value as int
8017
8067
  * @param {boolean} unsigned - if the value is unsigned
8018
- * @param {string} endian - ``big`` or ``little`
8068
+ * @param {string} endian - ``big`` or ``little``
8019
8069
  * @returns number
8020
8070
  */
8021
8071
  bit17(value, unsigned, endian) {
@@ -8051,7 +8101,7 @@ class biwriter {
8051
8101
  * Note: When returning to a byte write, remaining bits are dropped
8052
8102
  *
8053
8103
  * @param {number} value - value as int
8054
- * @param {string} endian - ``big`` or ``little`
8104
+ * @param {string} endian - ``big`` or ``little``
8055
8105
  * @returns number
8056
8106
  */
8057
8107
  ubit17(value, endian) {
@@ -8086,7 +8136,7 @@ class biwriter {
8086
8136
  *
8087
8137
  * @param {number} value - value as int
8088
8138
  * @param {boolean} unsigned - if the value is unsigned
8089
- * @param {string} endian - ``big`` or ``little`
8139
+ * @param {string} endian - ``big`` or ``little``
8090
8140
  * @returns number
8091
8141
  */
8092
8142
  bit18(value, unsigned, endian) {
@@ -8122,7 +8172,7 @@ class biwriter {
8122
8172
  * Note: When returning to a byte write, remaining bits are dropped
8123
8173
  *
8124
8174
  * @param {number} value - value as int
8125
- * @param {string} endian - ``big`` or ``little`
8175
+ * @param {string} endian - ``big`` or ``little``
8126
8176
  * @returns number
8127
8177
  */
8128
8178
  ubit18(value, endian) {
@@ -8157,7 +8207,7 @@ class biwriter {
8157
8207
  *
8158
8208
  * @param {number} value - value as int
8159
8209
  * @param {boolean} unsigned - if the value is unsigned
8160
- * @param {string} endian - ``big`` or ``little`
8210
+ * @param {string} endian - ``big`` or ``little``
8161
8211
  * @returns number
8162
8212
  */
8163
8213
  bit19(value, unsigned, endian) {
@@ -8193,7 +8243,7 @@ class biwriter {
8193
8243
  * Note: When returning to a byte write, remaining bits are dropped
8194
8244
  *
8195
8245
  * @param {number} value - value as int
8196
- * @param {string} endian - ``big`` or ``little`
8246
+ * @param {string} endian - ``big`` or ``little``
8197
8247
  * @returns number
8198
8248
  */
8199
8249
  ubit19(value, endian) {
@@ -8228,7 +8278,7 @@ class biwriter {
8228
8278
  *
8229
8279
  * @param {number} value - value as int
8230
8280
  * @param {boolean} unsigned - if the value is unsigned
8231
- * @param {string} endian - ``big`` or ``little`
8281
+ * @param {string} endian - ``big`` or ``little``
8232
8282
  * @returns number
8233
8283
  */
8234
8284
  bit20(value, unsigned, endian) {
@@ -8264,7 +8314,7 @@ class biwriter {
8264
8314
  * Note: When returning to a byte write, remaining bits are dropped
8265
8315
  *
8266
8316
  * @param {number} value - value as int
8267
- * @param {string} endian - ``big`` or ``little`
8317
+ * @param {string} endian - ``big`` or ``little``
8268
8318
  * @returns number
8269
8319
  */
8270
8320
  ubit20(value, endian) {
@@ -8299,7 +8349,7 @@ class biwriter {
8299
8349
  *
8300
8350
  * @param {number} value - value as int
8301
8351
  * @param {boolean} unsigned - if the value is unsigned
8302
- * @param {string} endian - ``big`` or ``little`
8352
+ * @param {string} endian - ``big`` or ``little``
8303
8353
  * @returns number
8304
8354
  */
8305
8355
  bit21(value, unsigned, endian) {
@@ -8335,7 +8385,7 @@ class biwriter {
8335
8385
  * Note: When returning to a byte write, remaining bits are dropped
8336
8386
  *
8337
8387
  * @param {number} value - value as int
8338
- * @param {string} endian - ``big`` or ``little`
8388
+ * @param {string} endian - ``big`` or ``little``
8339
8389
  * @returns number
8340
8390
  */
8341
8391
  ubit21(value, endian) {
@@ -8370,7 +8420,7 @@ class biwriter {
8370
8420
  *
8371
8421
  * @param {number} value - value as int
8372
8422
  * @param {boolean} unsigned - if the value is unsigned
8373
- * @param {string} endian - ``big`` or ``little`
8423
+ * @param {string} endian - ``big`` or ``little``
8374
8424
  * @returns number
8375
8425
  */
8376
8426
  bit22(value, unsigned, endian) {
@@ -8406,7 +8456,7 @@ class biwriter {
8406
8456
  * Note: When returning to a byte write, remaining bits are dropped
8407
8457
  *
8408
8458
  * @param {number} value - value as int
8409
- * @param {string} endian - ``big`` or ``little`
8459
+ * @param {string} endian - ``big`` or ``little``
8410
8460
  * @returns number
8411
8461
  */
8412
8462
  ubit22(value, endian) {
@@ -8441,7 +8491,7 @@ class biwriter {
8441
8491
  *
8442
8492
  * @param {number} value - value as int
8443
8493
  * @param {boolean} unsigned - if the value is unsigned
8444
- * @param {string} endian - ``big`` or ``little`
8494
+ * @param {string} endian - ``big`` or ``little``
8445
8495
  * @returns number
8446
8496
  */
8447
8497
  bit23(value, unsigned, endian) {
@@ -8477,7 +8527,7 @@ class biwriter {
8477
8527
  * Note: When returning to a byte write, remaining bits are dropped
8478
8528
  *
8479
8529
  * @param {number} value - value as int
8480
- * @param {string} endian - ``big`` or ``little`
8530
+ * @param {string} endian - ``big`` or ``little``
8481
8531
  * @returns number
8482
8532
  */
8483
8533
  ubit23(value, endian) {
@@ -8512,7 +8562,7 @@ class biwriter {
8512
8562
  *
8513
8563
  * @param {number} value - value as int
8514
8564
  * @param {boolean} unsigned - if the value is unsigned
8515
- * @param {string} endian - ``big`` or ``little`
8565
+ * @param {string} endian - ``big`` or ``little``
8516
8566
  * @returns number
8517
8567
  */
8518
8568
  bit24(value, unsigned, endian) {
@@ -8548,7 +8598,7 @@ class biwriter {
8548
8598
  * Note: When returning to a byte write, remaining bits are dropped
8549
8599
  *
8550
8600
  * @param {number} value - value as int
8551
- * @param {string} endian - ``big`` or ``little`
8601
+ * @param {string} endian - ``big`` or ``little``
8552
8602
  * @returns number
8553
8603
  */
8554
8604
  ubit24(value, endian) {
@@ -8583,7 +8633,7 @@ class biwriter {
8583
8633
  *
8584
8634
  * @param {number} value - value as int
8585
8635
  * @param {boolean} unsigned - if the value is unsigned
8586
- * @param {string} endian - ``big`` or ``little`
8636
+ * @param {string} endian - ``big`` or ``little``
8587
8637
  * @returns number
8588
8638
  */
8589
8639
  bit25(value, unsigned, endian) {
@@ -8619,7 +8669,7 @@ class biwriter {
8619
8669
  * Note: When returning to a byte write, remaining bits are dropped
8620
8670
  *
8621
8671
  * @param {number} value - value as int
8622
- * @param {string} endian - ``big`` or ``little`
8672
+ * @param {string} endian - ``big`` or ``little``
8623
8673
  * @returns number
8624
8674
  */
8625
8675
  ubit25(value, endian) {
@@ -8654,7 +8704,7 @@ class biwriter {
8654
8704
  *
8655
8705
  * @param {number} value - value as int
8656
8706
  * @param {boolean} unsigned - if the value is unsigned
8657
- * @param {string} endian - ``big`` or ``little`
8707
+ * @param {string} endian - ``big`` or ``little``
8658
8708
  * @returns number
8659
8709
  */
8660
8710
  bit26(value, unsigned, endian) {
@@ -8690,7 +8740,7 @@ class biwriter {
8690
8740
  * Note: When returning to a byte write, remaining bits are dropped
8691
8741
  *
8692
8742
  * @param {number} value - value as int
8693
- * @param {string} endian - ``big`` or ``little`
8743
+ * @param {string} endian - ``big`` or ``little``
8694
8744
  * @returns number
8695
8745
  */
8696
8746
  ubit26(value, endian) {
@@ -8725,7 +8775,7 @@ class biwriter {
8725
8775
  *
8726
8776
  * @param {number} value - value as int
8727
8777
  * @param {boolean} unsigned - if the value is unsigned
8728
- * @param {string} endian - ``big`` or ``little`
8778
+ * @param {string} endian - ``big`` or ``little``
8729
8779
  * @returns number
8730
8780
  */
8731
8781
  bit27(value, unsigned, endian) {
@@ -8761,7 +8811,7 @@ class biwriter {
8761
8811
  * Note: When returning to a byte write, remaining bits are dropped
8762
8812
  *
8763
8813
  * @param {number} value - value as int
8764
- * @param {string} endian - ``big`` or ``little`
8814
+ * @param {string} endian - ``big`` or ``little``
8765
8815
  * @returns number
8766
8816
  */
8767
8817
  ubit27(value, endian) {
@@ -8796,7 +8846,7 @@ class biwriter {
8796
8846
  *
8797
8847
  * @param {number} value - value as int
8798
8848
  * @param {boolean} unsigned - if the value is unsigned
8799
- * @param {string} endian - ``big`` or ``little`
8849
+ * @param {string} endian - ``big`` or ``little``
8800
8850
  * @returns number
8801
8851
  */
8802
8852
  bit28(value, unsigned, endian) {
@@ -8832,7 +8882,7 @@ class biwriter {
8832
8882
  * Note: When returning to a byte write, remaining bits are dropped
8833
8883
  *
8834
8884
  * @param {number} value - value as int
8835
- * @param {string} endian - ``big`` or ``little`
8885
+ * @param {string} endian - ``big`` or ``little``
8836
8886
  * @returns number
8837
8887
  */
8838
8888
  ubit28(value, endian) {
@@ -8867,7 +8917,7 @@ class biwriter {
8867
8917
  *
8868
8918
  * @param {number} value - value as int
8869
8919
  * @param {boolean} unsigned - if the value is unsigned
8870
- * @param {string} endian - ``big`` or ``little`
8920
+ * @param {string} endian - ``big`` or ``little``
8871
8921
  * @returns number
8872
8922
  */
8873
8923
  bit29(value, unsigned, endian) {
@@ -8903,7 +8953,7 @@ class biwriter {
8903
8953
  * Note: When returning to a byte write, remaining bits are dropped
8904
8954
  *
8905
8955
  * @param {number} value - value as int
8906
- * @param {string} endian - ``big`` or ``little`
8956
+ * @param {string} endian - ``big`` or ``little``
8907
8957
  * @returns number
8908
8958
  */
8909
8959
  ubit29(value, endian) {
@@ -8938,7 +8988,7 @@ class biwriter {
8938
8988
  *
8939
8989
  * @param {number} value - value as int
8940
8990
  * @param {boolean} unsigned - if the value is unsigned
8941
- * @param {string} endian - ``big`` or ``little`
8991
+ * @param {string} endian - ``big`` or ``little``
8942
8992
  * @returns number
8943
8993
  */
8944
8994
  bit30(value, unsigned, endian) {
@@ -8974,7 +9024,7 @@ class biwriter {
8974
9024
  * Note: When returning to a byte write, remaining bits are dropped
8975
9025
  *
8976
9026
  * @param {number} value - value as int
8977
- * @param {string} endian - ``big`` or ``little`
9027
+ * @param {string} endian - ``big`` or ``little``
8978
9028
  * @returns number
8979
9029
  */
8980
9030
  ubit30(value, endian) {
@@ -9009,7 +9059,7 @@ class biwriter {
9009
9059
  *
9010
9060
  * @param {number} value - value as int
9011
9061
  * @param {boolean} unsigned - if the value is unsigned
9012
- * @param {string} endian - ``big`` or ``little`
9062
+ * @param {string} endian - ``big`` or ``little``
9013
9063
  * @returns number
9014
9064
  */
9015
9065
  bit31(value, unsigned, endian) {
@@ -9045,7 +9095,7 @@ class biwriter {
9045
9095
  * Note: When returning to a byte write, remaining bits are dropped
9046
9096
  *
9047
9097
  * @param {number} value - value as int
9048
- * @param {string} endian - ``big`` or ``little`
9098
+ * @param {string} endian - ``big`` or ``little``
9049
9099
  * @returns number
9050
9100
  */
9051
9101
  ubit31(value, endian) {
@@ -9080,7 +9130,7 @@ class biwriter {
9080
9130
  *
9081
9131
  * @param {number} value - value as int
9082
9132
  * @param {boolean} unsigned - if the value is unsigned
9083
- * @param {string} endian - ``big`` or ``little`
9133
+ * @param {string} endian - ``big`` or ``little``
9084
9134
  * @returns number
9085
9135
  */
9086
9136
  bit32(value, unsigned, endian) {
@@ -9116,7 +9166,7 @@ class biwriter {
9116
9166
  * Note: When returning to a byte write, remaining bits are dropped
9117
9167
  *
9118
9168
  * @param {number} value - value as int
9119
- * @param {string} endian - ``big`` or ``little`
9169
+ * @param {string} endian - ``big`` or ``little``
9120
9170
  * @returns number
9121
9171
  */
9122
9172
  ubit32(value, endian) {
@@ -9166,6 +9216,14 @@ class biwriter {
9166
9216
  return rbyte(this, unsigned);
9167
9217
  }
9168
9218
  /**
9219
+ * Read unsigned byte
9220
+ *
9221
+ * @returns number
9222
+ */
9223
+ readUByte() {
9224
+ return rbyte(this, true);
9225
+ }
9226
+ /**
9169
9227
  * Write byte
9170
9228
  *
9171
9229
  * @param {number} value - value as int
@@ -9215,7 +9273,7 @@ class biwriter {
9215
9273
  *
9216
9274
  * @param {number} value - value as int
9217
9275
  * @param {boolean} unsigned - if the value is unsigned
9218
- * @param {string} endian - ``big`` or ``little`
9276
+ * @param {string} endian - ``big`` or ``little``
9219
9277
  */
9220
9278
  writeInt16(value, unsigned, endian) {
9221
9279
  return wint16(this, value, unsigned, endian);
@@ -9224,7 +9282,7 @@ class biwriter {
9224
9282
  * Read short
9225
9283
  *
9226
9284
  * @param {boolean} unsigned - if value is unsigned or not
9227
- * @param {string} endian - ```big``` or ```little```
9285
+ * @param {string} endian - ``big`` or ``little``
9228
9286
  * @returns number
9229
9287
  */
9230
9288
  readInt16(unsigned, endian) {
@@ -9235,7 +9293,7 @@ class biwriter {
9235
9293
  *
9236
9294
  * @param {number} value - value as int
9237
9295
  * @param {boolean} unsigned - if the value is unsigned
9238
- * @param {string} endian - ``big`` or ``little`
9296
+ * @param {string} endian - ``big`` or ``little``
9239
9297
  */
9240
9298
  int16(value, unsigned, endian) {
9241
9299
  return this.writeInt16(value, unsigned, endian);
@@ -9245,7 +9303,7 @@ class biwriter {
9245
9303
  *
9246
9304
  * @param {number} value - value as int
9247
9305
  * @param {boolean} unsigned - if the value is unsigned
9248
- * @param {string} endian - ``big`` or ``little`
9306
+ * @param {string} endian - ``big`` or ``little``
9249
9307
  */
9250
9308
  short(value, unsigned, endian) {
9251
9309
  return this.writeInt16(value, unsigned, endian);
@@ -9255,7 +9313,7 @@ class biwriter {
9255
9313
  *
9256
9314
  * @param {number} value - value as int
9257
9315
  * @param {boolean} unsigned - if the value is unsigned
9258
- * @param {string} endian - ``big`` or ``little`
9316
+ * @param {string} endian - ``big`` or ``little``
9259
9317
  */
9260
9318
  word(value, unsigned, endian) {
9261
9319
  return this.writeInt16(value, unsigned, endian);
@@ -9264,7 +9322,7 @@ class biwriter {
9264
9322
  * Write unsigned int16
9265
9323
  *
9266
9324
  * @param {number} value - value as int
9267
- * @param {string} endian - ``big`` or ``little`
9325
+ * @param {string} endian - ``big`` or ``little``
9268
9326
  */
9269
9327
  writeUInt16(value, endian) {
9270
9328
  return this.writeInt16(value, true, endian);
@@ -9273,7 +9331,7 @@ class biwriter {
9273
9331
  * Write unsigned int16
9274
9332
  *
9275
9333
  * @param {number} value - value as int
9276
- * @param {string} endian - ``big`` or ``little`
9334
+ * @param {string} endian - ``big`` or ``little``
9277
9335
  */
9278
9336
  uint16(value, endian) {
9279
9337
  return this.writeInt16(value, true, endian);
@@ -9282,7 +9340,7 @@ class biwriter {
9282
9340
  * Write unsigned int16
9283
9341
  *
9284
9342
  * @param {number} value - value as int
9285
- * @param {string} endian - ``big`` or ``little`
9343
+ * @param {string} endian - ``big`` or ``little``
9286
9344
  */
9287
9345
  ushort(value, endian) {
9288
9346
  return this.writeInt16(value, true, endian);
@@ -9291,7 +9349,7 @@ class biwriter {
9291
9349
  * Write unsigned int16
9292
9350
  *
9293
9351
  * @param {number} value - value as int
9294
- * @param {string} endian - ``big`` or ``little`
9352
+ * @param {string} endian - ``big`` or ``little``
9295
9353
  */
9296
9354
  uword(value, endian) {
9297
9355
  return this.writeInt16(value, true, endian);
@@ -9431,7 +9489,7 @@ class biwriter {
9431
9489
  * Writes half float
9432
9490
  *
9433
9491
  * @param {number} value - value as int
9434
- * @param {string} endian - ``big`` or ``little`
9492
+ * @param {string} endian - ``big`` or ``little``
9435
9493
  */
9436
9494
  writeHalfFloat(value, endian) {
9437
9495
  return whalffloat(this, value, endian);
@@ -9439,7 +9497,7 @@ class biwriter {
9439
9497
  /**
9440
9498
  * Read half float
9441
9499
  *
9442
- * @param {string} endian - ```big``` or ```little```
9500
+ * @param {string} endian - ``big`` or ``little``
9443
9501
  * @returns number
9444
9502
  */
9445
9503
  readHalfFloat(endian) {
@@ -9449,7 +9507,7 @@ class biwriter {
9449
9507
  * Writes half float
9450
9508
  *
9451
9509
  * @param {number} value - value as int
9452
- * @param {string} endian - ``big`` or ``little`
9510
+ * @param {string} endian - ``big`` or ``little``
9453
9511
  */
9454
9512
  half(value, endian) {
9455
9513
  return this.writeHalfFloat(value, endian);
@@ -9458,7 +9516,7 @@ class biwriter {
9458
9516
  * Writes half float
9459
9517
  *
9460
9518
  * @param {number} value - value as int
9461
- * @param {string} endian - ``big`` or ``little`
9519
+ * @param {string} endian - ``big`` or ``little``
9462
9520
  */
9463
9521
  halffloat(value, endian) {
9464
9522
  return this.writeHalfFloat(value, endian);
@@ -9519,7 +9577,7 @@ class biwriter {
9519
9577
  *
9520
9578
  * @param {number} value - value as int
9521
9579
  * @param {boolean} unsigned - if the value is unsigned
9522
- * @param {string} endian - ``big`` or ``little`
9580
+ * @param {string} endian - ``big`` or ``little``
9523
9581
  */
9524
9582
  writeInt32(value, unsigned, endian) {
9525
9583
  return wint32(this, value, unsigned, endian);
@@ -9528,7 +9586,7 @@ class biwriter {
9528
9586
  * Read 32 bit integer
9529
9587
  *
9530
9588
  * @param {boolean} unsigned - if value is unsigned or not
9531
- * @param {string} endian - ```big``` or ```little```
9589
+ * @param {string} endian - ``big`` or ``little``
9532
9590
  * @returns number
9533
9591
  */
9534
9592
  readInt32(unsigned, endian) {
@@ -9539,7 +9597,7 @@ class biwriter {
9539
9597
  *
9540
9598
  * @param {number} value - value as int
9541
9599
  * @param {boolean} unsigned - if the value is unsigned
9542
- * @param {string} endian - ``big`` or ``little`
9600
+ * @param {string} endian - ``big`` or ``little``
9543
9601
  */
9544
9602
  int(value, unsigned, endian) {
9545
9603
  return this.writeInt32(value, unsigned, endian);
@@ -9549,7 +9607,7 @@ class biwriter {
9549
9607
  *
9550
9608
  * @param {number} value - value as int
9551
9609
  * @param {boolean} unsigned - if the value is unsigned
9552
- * @param {string} endian - ``big`` or ``little`
9610
+ * @param {string} endian - ``big`` or ``little``
9553
9611
  */
9554
9612
  int32(value, unsigned, endian) {
9555
9613
  return this.writeInt32(value, unsigned, endian);
@@ -9559,7 +9617,7 @@ class biwriter {
9559
9617
  *
9560
9618
  * @param {number} value - value as int
9561
9619
  * @param {boolean} unsigned - if the value is unsigned
9562
- * @param {string} endian - ``big`` or ``little`
9620
+ * @param {string} endian - ``big`` or ``little``
9563
9621
  */
9564
9622
  double(value, unsigned, endian) {
9565
9623
  return this.writeInt32(value, unsigned, endian);
@@ -9569,7 +9627,7 @@ class biwriter {
9569
9627
  *
9570
9628
  * @param {number} value - value as int
9571
9629
  * @param {boolean} unsigned - if the value is unsigned
9572
- * @param {string} endian - ``big`` or ``little`
9630
+ * @param {string} endian - ``big`` or ``little``
9573
9631
  */
9574
9632
  long(value, unsigned, endian) {
9575
9633
  return this.writeInt32(value, unsigned, endian);
@@ -9786,7 +9844,7 @@ class biwriter {
9786
9844
  * Write float
9787
9845
  *
9788
9846
  * @param {number} value - value as int
9789
- * @param {string} endian - ``big`` or ``little`
9847
+ * @param {string} endian - ``big`` or ``little``
9790
9848
  */
9791
9849
  writeFloat(value, endian) {
9792
9850
  return wfloat(this, value, endian);
@@ -9794,7 +9852,7 @@ class biwriter {
9794
9852
  /**
9795
9853
  * Read float
9796
9854
  *
9797
- * @param {string} endian - ```big``` or ```little```
9855
+ * @param {string} endian - ``big`` or ``little``
9798
9856
  * @returns number
9799
9857
  */
9800
9858
  readFloat(endian) {
@@ -9804,7 +9862,7 @@ class biwriter {
9804
9862
  * Write float
9805
9863
  *
9806
9864
  * @param {number} value - value as int
9807
- * @param {string} endian - ``big`` or ``little`
9865
+ * @param {string} endian - ``big`` or ``little``
9808
9866
  */
9809
9867
  float(value, endian) {
9810
9868
  return this.writeFloat(value, endian);
@@ -9849,7 +9907,7 @@ class biwriter {
9849
9907
  *
9850
9908
  * @param {number} value - value as int
9851
9909
  * @param {boolean} unsigned - if the value is unsigned
9852
- * @param {string} endian - ``big`` or ``little`
9910
+ * @param {string} endian - ``big`` or ``little``
9853
9911
  */
9854
9912
  writeInt64(value, unsigned, endian) {
9855
9913
  return wint64(this, value, unsigned, endian);
@@ -9857,7 +9915,7 @@ class biwriter {
9857
9915
  /**
9858
9916
  * Read signed 64 bit integer
9859
9917
  * @param {boolean} unsigned - if value is unsigned or not
9860
- * @param {string} endian - ```big``` or ```little```
9918
+ * @param {string} endian - ``big`` or ``little``
9861
9919
  * @returns number
9862
9920
  */
9863
9921
  readInt64(unsigned, endian) {
@@ -9868,7 +9926,7 @@ class biwriter {
9868
9926
  *
9869
9927
  * @param {number} value - value as int
9870
9928
  * @param {boolean} unsigned - if the value is unsigned
9871
- * @param {string} endian - ``big`` or ``little`
9929
+ * @param {string} endian - ``big`` or ``little``
9872
9930
  */
9873
9931
  int64(value, unsigned, endian) {
9874
9932
  return this.writeInt64(value, unsigned, endian);
@@ -9878,7 +9936,7 @@ class biwriter {
9878
9936
  *
9879
9937
  * @param {number} value - value as int
9880
9938
  * @param {boolean} unsigned - if the value is unsigned
9881
- * @param {string} endian - ``big`` or ``little`
9939
+ * @param {string} endian - ``big`` or ``little``
9882
9940
  */
9883
9941
  quad(value, unsigned, endian) {
9884
9942
  return this.writeInt64(value, unsigned, endian);
@@ -9888,7 +9946,7 @@ class biwriter {
9888
9946
  *
9889
9947
  * @param {number} value - value as int
9890
9948
  * @param {boolean} unsigned - if the value is unsigned
9891
- * @param {string} endian - ``big`` or ``little`
9949
+ * @param {string} endian - ``big`` or ``little``
9892
9950
  */
9893
9951
  bigint(value, unsigned, endian) {
9894
9952
  return this.writeInt64(value, unsigned, endian);
@@ -9897,7 +9955,7 @@ class biwriter {
9897
9955
  * Write unsigned 64 bit integer
9898
9956
  *
9899
9957
  * @param {number} value - value as int
9900
- * @param {string} endian - ``big`` or ``little`
9958
+ * @param {string} endian - ``big`` or ``little``
9901
9959
  */
9902
9960
  writeUInt64(value, endian) {
9903
9961
  return this.writeInt64(value, true, endian);
@@ -9906,7 +9964,7 @@ class biwriter {
9906
9964
  * Write unsigned 64 bit integer
9907
9965
  *
9908
9966
  * @param {number} value - value as int
9909
- * @param {string} endian - ``big`` or ``little`
9967
+ * @param {string} endian - ``big`` or ``little``
9910
9968
  */
9911
9969
  uint64(value, endian) {
9912
9970
  return this.writeInt64(value, true, endian);
@@ -9915,7 +9973,7 @@ class biwriter {
9915
9973
  * Write unsigned 64 bit integer
9916
9974
  *
9917
9975
  * @param {number} value - value as int
9918
- * @param {string} endian - ``big`` or ``little`
9976
+ * @param {string} endian - ``big`` or ``little``
9919
9977
  */
9920
9978
  ubigint(value, endian) {
9921
9979
  return this.writeInt64(value, true, endian);
@@ -9924,7 +9982,7 @@ class biwriter {
9924
9982
  * Write unsigned 64 bit integer
9925
9983
  *
9926
9984
  * @param {number} value - value as int
9927
- * @param {string} endian - ``big`` or ``little`
9985
+ * @param {string} endian - ``big`` or ``little``
9928
9986
  */
9929
9987
  uquad(value, endian) {
9930
9988
  return this.writeInt64(value, true, endian);
@@ -10064,8 +10122,7 @@ class biwriter {
10064
10122
  * Writes double float
10065
10123
  *
10066
10124
  * @param {number} value - value as int
10067
- * @param {number} offset - byte offset (default last write position)
10068
- * @param {string} endian - ``big`` or ``little`
10125
+ * @param {string} endian - ``big`` or ``little``
10069
10126
  */
10070
10127
  writeDoubleFloat(value, endian) {
10071
10128
  return wdfloat(this, value, endian);
@@ -10073,7 +10130,7 @@ class biwriter {
10073
10130
  /**
10074
10131
  * Read double float
10075
10132
  *
10076
- * @param {string} endian - ```big``` or ```little```
10133
+ * @param {string} endian - ``big`` or ``little``
10077
10134
  * @returns number
10078
10135
  */
10079
10136
  readDoubleFloat(endian) {
@@ -10083,7 +10140,7 @@ class biwriter {
10083
10140
  * Writes double float
10084
10141
  *
10085
10142
  * @param {number} value - value as int
10086
- * @param {string} endian - ``big`` or ``little`
10143
+ * @param {string} endian - ``big`` or ``little``
10087
10144
  */
10088
10145
  doublefloat(value, endian) {
10089
10146
  return this.writeDoubleFloat(value, endian);
@@ -10092,7 +10149,7 @@ class biwriter {
10092
10149
  * Writes double float
10093
10150
  *
10094
10151
  * @param {number} value - value as int
10095
- * @param {string} endian - ``big`` or ``little`
10152
+ * @param {string} endian - ``big`` or ``little``
10096
10153
  */
10097
10154
  dfloat(value, endian) {
10098
10155
  return this.writeDoubleFloat(value, endian);