bireader 1.0.24 → 1.0.26
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.d.ts +3 -0
- package/lib/cjs/index.d.ts.map +1 -0
- package/lib/cjs/index.js +4 -4
- package/lib/cjs/index.js.map +1 -1
- package/lib/{esm/types → cjs}/src/common.d.ts +2 -0
- package/lib/cjs/src/common.d.ts.map +1 -0
- package/lib/cjs/src/common.js +29 -21
- package/lib/cjs/src/common.js.map +1 -1
- package/lib/cjs/{types/src → src}/reader.d.ts +0 -2
- package/lib/cjs/src/reader.d.ts.map +1 -0
- package/lib/cjs/src/reader.js +56 -62
- package/lib/cjs/src/reader.js.map +1 -1
- package/lib/cjs/{types/src → src}/writer.d.ts +6 -8
- package/lib/cjs/src/writer.d.ts.map +1 -0
- package/lib/cjs/src/writer.js +62 -68
- package/lib/cjs/src/writer.js.map +1 -1
- package/lib/esm/index.d.ts +3 -0
- package/lib/esm/index.d.ts.map +1 -0
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/index.mjs +2 -2
- package/lib/{cjs/types → esm}/src/common.d.ts +2 -0
- package/lib/esm/src/common.d.ts.map +1 -0
- package/lib/esm/src/common.js +26 -20
- package/lib/esm/src/common.js.map +1 -1
- package/lib/esm/{types/src → src}/reader.d.ts +0 -2
- package/lib/esm/src/reader.d.ts.map +1 -0
- package/lib/esm/src/reader.js +1 -7
- package/lib/esm/src/reader.js.map +1 -1
- package/lib/esm/{types/src → src}/writer.d.ts +6 -8
- package/lib/esm/src/writer.d.ts.map +1 -0
- package/lib/esm/src/writer.js +7 -13
- package/lib/esm/src/writer.js.map +1 -1
- package/package.json +12 -5
- package/src/common.ts +1408 -0
- package/src/reader.ts +4853 -0
- package/src/writer.ts +5149 -0
- package/lib/cjs/types/index.d.ts +0 -3
- package/lib/cjs/types/index.d.ts.map +0 -1
- package/lib/cjs/types/src/common.d.ts.map +0 -1
- package/lib/cjs/types/src/reader.d.ts.map +0 -1
- package/lib/cjs/types/src/writer.d.ts.map +0 -1
- package/lib/esm/types/index.d.ts +0 -3
- package/lib/esm/types/index.d.ts.map +0 -1
- package/lib/esm/types/src/common.d.ts.map +0 -1
- package/lib/esm/types/src/reader.d.ts.map +0 -1
- package/lib/esm/types/src/writer.d.ts.map +0 -1
package/lib/cjs/src/writer.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.biwriter = void 0;
|
|
4
|
-
const
|
|
4
|
+
const common_js_1 = require("./common.js");
|
|
5
5
|
/**
|
|
6
6
|
* Binary writer, includes bitfields and strings
|
|
7
7
|
*
|
|
@@ -12,17 +12,11 @@ const common_1 = require("./common");
|
|
|
12
12
|
* @param {boolean} strict - Strict mode: if true does not extend supplied array on outside write (default false)
|
|
13
13
|
*/
|
|
14
14
|
class biwriter {
|
|
15
|
-
isBuffer(obj) {
|
|
16
|
-
return (0, common_1.buffcheck)(obj);
|
|
17
|
-
}
|
|
18
15
|
isBufferOrUint8Array(obj) {
|
|
19
|
-
return (0,
|
|
16
|
+
return (0, common_js_1.arraybuffcheck)(this, obj);
|
|
20
17
|
}
|
|
21
18
|
extendArray(to_padd) {
|
|
22
|
-
return (0,
|
|
23
|
-
}
|
|
24
|
-
check_size(write_bytes, write_bit, offset) {
|
|
25
|
-
return (0, common_1.checkSize)(this, write_bytes || 0, write_bit || 0, offset || this.offset);
|
|
19
|
+
return (0, common_js_1.extendarray)(this, to_padd);
|
|
26
20
|
}
|
|
27
21
|
/**
|
|
28
22
|
* Binary writer, includes bitfields and strings
|
|
@@ -147,7 +141,7 @@ class biwriter {
|
|
|
147
141
|
* @param {number} bits - Bits to skip (0-7)
|
|
148
142
|
*/
|
|
149
143
|
skip(bytes, bits) {
|
|
150
|
-
return (0,
|
|
144
|
+
return (0, common_js_1.skip)(this, bytes, bits);
|
|
151
145
|
}
|
|
152
146
|
/**
|
|
153
147
|
* Offset current byte or bit position
|
|
@@ -170,7 +164,7 @@ class biwriter {
|
|
|
170
164
|
* @param {number} bit - bit to set to (0-7)
|
|
171
165
|
*/
|
|
172
166
|
goto(byte, bit) {
|
|
173
|
-
return (0,
|
|
167
|
+
return (0, common_js_1.goto)(this, byte, bit);
|
|
174
168
|
}
|
|
175
169
|
/**
|
|
176
170
|
* Offset current byte or bit position
|
|
@@ -334,7 +328,7 @@ class biwriter {
|
|
|
334
328
|
else {
|
|
335
329
|
throw new Error("XOR must be a number, string, Uint8Array or Buffer");
|
|
336
330
|
}
|
|
337
|
-
return (0,
|
|
331
|
+
return (0, common_js_1.XOR)(this, xorKey, startOffset || this.offset, endOffset || this.size, consume || false);
|
|
338
332
|
}
|
|
339
333
|
/**
|
|
340
334
|
* XOR data
|
|
@@ -360,7 +354,7 @@ class biwriter {
|
|
|
360
354
|
else {
|
|
361
355
|
throw new Error("XOR must be a number, string, Uint8Array or Buffer");
|
|
362
356
|
}
|
|
363
|
-
return (0,
|
|
357
|
+
return (0, common_js_1.XOR)(this, XORKey, this.offset, this.offset + Length, consume || false);
|
|
364
358
|
}
|
|
365
359
|
/**
|
|
366
360
|
* OR data
|
|
@@ -384,7 +378,7 @@ class biwriter {
|
|
|
384
378
|
else {
|
|
385
379
|
throw new Error("OR must be a number, string, Uint8Array or Buffer");
|
|
386
380
|
}
|
|
387
|
-
return (0,
|
|
381
|
+
return (0, common_js_1.OR)(this, orKey, startOffset || this.offset, endOffset || this.size, consume || false);
|
|
388
382
|
}
|
|
389
383
|
/**
|
|
390
384
|
* OR data
|
|
@@ -410,7 +404,7 @@ class biwriter {
|
|
|
410
404
|
else {
|
|
411
405
|
throw new Error("OR must be a number, string, Uint8Array or Buffer");
|
|
412
406
|
}
|
|
413
|
-
return (0,
|
|
407
|
+
return (0, common_js_1.OR)(this, ORKey, this.offset, this.offset + Length, consume || false);
|
|
414
408
|
}
|
|
415
409
|
/**
|
|
416
410
|
* AND data
|
|
@@ -434,7 +428,7 @@ class biwriter {
|
|
|
434
428
|
else {
|
|
435
429
|
throw new Error("AND must be a number, string, number array or Buffer");
|
|
436
430
|
}
|
|
437
|
-
return (0,
|
|
431
|
+
return (0, common_js_1.AND)(this, andKey, startOffset || this.offset, endOffset || this.size, consume || false);
|
|
438
432
|
}
|
|
439
433
|
/**
|
|
440
434
|
* AND data
|
|
@@ -460,7 +454,7 @@ class biwriter {
|
|
|
460
454
|
else {
|
|
461
455
|
throw new Error("AND must be a number, string, number array or Buffer");
|
|
462
456
|
}
|
|
463
|
-
return (0,
|
|
457
|
+
return (0, common_js_1.AND)(this, ANDKey, this.offset, this.offset + Length, consume || false);
|
|
464
458
|
}
|
|
465
459
|
/**
|
|
466
460
|
* Not data
|
|
@@ -470,7 +464,7 @@ class biwriter {
|
|
|
470
464
|
* @param {boolean} consume - Move current position to end of data (default false)
|
|
471
465
|
*/
|
|
472
466
|
not(startOffset, endOffset, consume) {
|
|
473
|
-
return (0,
|
|
467
|
+
return (0, common_js_1.NOT)(this, startOffset || this.offset, endOffset || this.size, consume || false);
|
|
474
468
|
}
|
|
475
469
|
/**
|
|
476
470
|
* Not data
|
|
@@ -479,7 +473,7 @@ class biwriter {
|
|
|
479
473
|
* @param {boolean} consume - Move current position to end of data (default false)
|
|
480
474
|
*/
|
|
481
475
|
notThis(length, consume) {
|
|
482
|
-
return (0,
|
|
476
|
+
return (0, common_js_1.NOT)(this, this.offset, this.offset + (length || 1), consume || false);
|
|
483
477
|
}
|
|
484
478
|
/**
|
|
485
479
|
* Left shift data
|
|
@@ -503,7 +497,7 @@ class biwriter {
|
|
|
503
497
|
else {
|
|
504
498
|
throw new Error("Left shift must be a number, string, number array or Buffer");
|
|
505
499
|
}
|
|
506
|
-
return (0,
|
|
500
|
+
return (0, common_js_1.LSHIFT)(this, lShiftKey, startOffset || this.offset, endOffset || this.size, consume || false);
|
|
507
501
|
}
|
|
508
502
|
/**
|
|
509
503
|
* Left shift data
|
|
@@ -529,7 +523,7 @@ class biwriter {
|
|
|
529
523
|
else {
|
|
530
524
|
throw new Error("Left shift must be a number, string, number array or Buffer");
|
|
531
525
|
}
|
|
532
|
-
return (0,
|
|
526
|
+
return (0, common_js_1.LSHIFT)(this, shiftKey, this.offset, this.offset + Length, consume || false);
|
|
533
527
|
}
|
|
534
528
|
/**
|
|
535
529
|
* Right shift data
|
|
@@ -553,7 +547,7 @@ class biwriter {
|
|
|
553
547
|
else {
|
|
554
548
|
throw new Error("Right shift must be a number, string, number array or Buffer");
|
|
555
549
|
}
|
|
556
|
-
return (0,
|
|
550
|
+
return (0, common_js_1.RSHIFT)(this, rShiftKey, startOffset || this.offset, endOffset || this.size, consume || false);
|
|
557
551
|
}
|
|
558
552
|
/**
|
|
559
553
|
* Right shift data
|
|
@@ -579,7 +573,7 @@ class biwriter {
|
|
|
579
573
|
else {
|
|
580
574
|
throw new Error("Right shift must be a number, string, number array or Buffer");
|
|
581
575
|
}
|
|
582
|
-
return (0,
|
|
576
|
+
return (0, common_js_1.RSHIFT)(this, lShiftKey, this.offset, this.offset + Length, consume || false);
|
|
583
577
|
}
|
|
584
578
|
/**
|
|
585
579
|
* Add value to data
|
|
@@ -603,7 +597,7 @@ class biwriter {
|
|
|
603
597
|
else {
|
|
604
598
|
throw new Error("Add key must be a number, string, number array or Buffer");
|
|
605
599
|
}
|
|
606
|
-
return (0,
|
|
600
|
+
return (0, common_js_1.ADD)(this, addedKey, startOffset || this.offset, endOffset || this.size, consume || false);
|
|
607
601
|
}
|
|
608
602
|
/**
|
|
609
603
|
* Add value to data
|
|
@@ -629,7 +623,7 @@ class biwriter {
|
|
|
629
623
|
else {
|
|
630
624
|
throw new Error("Add key must be a number, string, number array or Buffer");
|
|
631
625
|
}
|
|
632
|
-
return (0,
|
|
626
|
+
return (0, common_js_1.ADD)(this, AddedKey, this.offset, this.offset + Length, consume || false);
|
|
633
627
|
}
|
|
634
628
|
//
|
|
635
629
|
//remove part of data
|
|
@@ -644,7 +638,7 @@ class biwriter {
|
|
|
644
638
|
* @returns {Buffer|Uint8Array} Removed data as ``Buffer`` or ``Uint8Array``
|
|
645
639
|
*/
|
|
646
640
|
delete(startOffset, endOffset, consume) {
|
|
647
|
-
return (0,
|
|
641
|
+
return (0, common_js_1.remove)(this, startOffset || 0, endOffset || this.offset, consume || false, true);
|
|
648
642
|
}
|
|
649
643
|
/**
|
|
650
644
|
* Deletes part of data from current byte position to end, returns removed
|
|
@@ -653,7 +647,7 @@ class biwriter {
|
|
|
653
647
|
* @returns {Buffer|Uint8Array} Removed data as ``Buffer`` or ``Uint8Array``
|
|
654
648
|
*/
|
|
655
649
|
clip() {
|
|
656
|
-
return (0,
|
|
650
|
+
return (0, common_js_1.remove)(this, this.offset, this.size, false, true);
|
|
657
651
|
}
|
|
658
652
|
/**
|
|
659
653
|
* Deletes part of data from current byte position to end, returns removed
|
|
@@ -662,7 +656,7 @@ class biwriter {
|
|
|
662
656
|
* @returns {Buffer|Uint8Array} Removed data as ``Buffer`` or ``Uint8Array``
|
|
663
657
|
*/
|
|
664
658
|
trim() {
|
|
665
|
-
return (0,
|
|
659
|
+
return (0, common_js_1.remove)(this, this.offset, this.size, false, true);
|
|
666
660
|
}
|
|
667
661
|
/**
|
|
668
662
|
* Deletes part of data from current byte position to supplied length, returns removed
|
|
@@ -673,7 +667,7 @@ class biwriter {
|
|
|
673
667
|
* @returns {Buffer|Uint8Array} Removed data as ``Buffer`` or ``Uint8Array``
|
|
674
668
|
*/
|
|
675
669
|
crop(length, consume) {
|
|
676
|
-
return (0,
|
|
670
|
+
return (0, common_js_1.remove)(this, this.offset, this.offset + (length || 0), consume || false, true);
|
|
677
671
|
}
|
|
678
672
|
/**
|
|
679
673
|
* Deletes part of data from current position to supplied length, returns removed
|
|
@@ -684,7 +678,7 @@ class biwriter {
|
|
|
684
678
|
* @returns {Buffer|Uint8Array} Removed data as ``Buffer`` or ``Uint8Array``
|
|
685
679
|
*/
|
|
686
680
|
drop(length, consume) {
|
|
687
|
-
return (0,
|
|
681
|
+
return (0, common_js_1.remove)(this, this.offset, this.offset + (length || 0), consume || false, true);
|
|
688
682
|
}
|
|
689
683
|
//
|
|
690
684
|
//copy out
|
|
@@ -699,7 +693,7 @@ class biwriter {
|
|
|
699
693
|
* @returns {Buffer|Uint8Array} Selected data as ```Uint8Array``` or ```Buffer```
|
|
700
694
|
*/
|
|
701
695
|
lift(startOffset, endOffset, consume, fillValue) {
|
|
702
|
-
return (0,
|
|
696
|
+
return (0, common_js_1.remove)(this, startOffset || this.offset, endOffset || this.size, consume || false, false, fillValue);
|
|
703
697
|
}
|
|
704
698
|
/**
|
|
705
699
|
* Returns part of data from current byte position to end of data unless supplied
|
|
@@ -711,7 +705,7 @@ class biwriter {
|
|
|
711
705
|
* @returns {Buffer|Uint8Array} Selected data as ```Uint8Array``` or ```Buffer```
|
|
712
706
|
*/
|
|
713
707
|
fill(startOffset, endOffset, consume, fillValue) {
|
|
714
|
-
return (0,
|
|
708
|
+
return (0, common_js_1.remove)(this, startOffset || this.offset, endOffset || this.size, consume || false, false, fillValue);
|
|
715
709
|
}
|
|
716
710
|
/**
|
|
717
711
|
* Extract data from current position to length supplied
|
|
@@ -722,7 +716,7 @@ class biwriter {
|
|
|
722
716
|
* @returns {Buffer|Uint8Array} Selected data as ```Uint8Array``` or ```Buffer```
|
|
723
717
|
*/
|
|
724
718
|
extract(length, consume) {
|
|
725
|
-
return (0,
|
|
719
|
+
return (0, common_js_1.remove)(this, this.offset, this.offset + (length || 0), consume || false, false);
|
|
726
720
|
}
|
|
727
721
|
/**
|
|
728
722
|
* Extract data from current position to length supplied
|
|
@@ -733,7 +727,7 @@ class biwriter {
|
|
|
733
727
|
* @returns {Buffer|Uint8Array} Selected data as ```Uint8Array``` or ```Buffer```
|
|
734
728
|
*/
|
|
735
729
|
slice(length, consume) {
|
|
736
|
-
return (0,
|
|
730
|
+
return (0, common_js_1.remove)(this, this.offset, this.offset + (length || 0), consume || false, false);
|
|
737
731
|
}
|
|
738
732
|
/**
|
|
739
733
|
* Extract data from current position to length supplied
|
|
@@ -744,7 +738,7 @@ class biwriter {
|
|
|
744
738
|
* @returns {Buffer|Uint8Array} Selected data as ```Uint8Array``` or ```Buffer```
|
|
745
739
|
*/
|
|
746
740
|
wrap(length, consume) {
|
|
747
|
-
return (0,
|
|
741
|
+
return (0, common_js_1.remove)(this, this.offset, this.offset + (length || 0), consume || false, false);
|
|
748
742
|
}
|
|
749
743
|
//
|
|
750
744
|
//insert
|
|
@@ -758,7 +752,7 @@ class biwriter {
|
|
|
758
752
|
* @param {number} offset - Byte position to add at (defaults to current position)
|
|
759
753
|
*/
|
|
760
754
|
insert(data, consume, offset) {
|
|
761
|
-
return (0,
|
|
755
|
+
return (0, common_js_1.addData)(this, data, consume || false, offset || this.offset);
|
|
762
756
|
}
|
|
763
757
|
/**
|
|
764
758
|
* Inserts data into data
|
|
@@ -769,7 +763,7 @@ class biwriter {
|
|
|
769
763
|
* @param {number} offset - Byte position to add at (defaults to current position)
|
|
770
764
|
*/
|
|
771
765
|
place(data, consume, offset) {
|
|
772
|
-
return (0,
|
|
766
|
+
return (0, common_js_1.addData)(this, data, consume || false, offset || this.offset);
|
|
773
767
|
}
|
|
774
768
|
/**
|
|
775
769
|
* Replaces data in data
|
|
@@ -780,7 +774,7 @@ class biwriter {
|
|
|
780
774
|
* @param {number} offset - Offset to add it at (defaults to current position)
|
|
781
775
|
*/
|
|
782
776
|
replace(data, consume, offset) {
|
|
783
|
-
return (0,
|
|
777
|
+
return (0, common_js_1.addData)(this, data, consume || false, offset || this.offset, true);
|
|
784
778
|
}
|
|
785
779
|
/**
|
|
786
780
|
* Replaces data in data
|
|
@@ -791,7 +785,7 @@ class biwriter {
|
|
|
791
785
|
* @param {number} offset - Offset to add it at (defaults to current position)
|
|
792
786
|
*/
|
|
793
787
|
overwrite(data, consume, offset) {
|
|
794
|
-
return (0,
|
|
788
|
+
return (0, common_js_1.addData)(this, data, consume || false, offset || this.offset, true);
|
|
795
789
|
}
|
|
796
790
|
/**
|
|
797
791
|
* Adds data to start of supplied data
|
|
@@ -801,7 +795,7 @@ class biwriter {
|
|
|
801
795
|
* @param {boolean} consume - Move current write position to end of data (default false)
|
|
802
796
|
*/
|
|
803
797
|
unshift(data, consume) {
|
|
804
|
-
return (0,
|
|
798
|
+
return (0, common_js_1.addData)(this, data, consume || false, 0);
|
|
805
799
|
}
|
|
806
800
|
/**
|
|
807
801
|
* Adds data to start of supplied data
|
|
@@ -811,7 +805,7 @@ class biwriter {
|
|
|
811
805
|
* @param {boolean} consume - Move current write position to end of data (default false)
|
|
812
806
|
*/
|
|
813
807
|
prepend(data, consume) {
|
|
814
|
-
return (0,
|
|
808
|
+
return (0, common_js_1.addData)(this, data, consume || false, 0);
|
|
815
809
|
}
|
|
816
810
|
/**
|
|
817
811
|
* Adds data to end of supplied data
|
|
@@ -821,7 +815,7 @@ class biwriter {
|
|
|
821
815
|
* @param {boolean} consume - Move current write position to end of data (default false)
|
|
822
816
|
*/
|
|
823
817
|
push(data, consume) {
|
|
824
|
-
return (0,
|
|
818
|
+
return (0, common_js_1.addData)(this, data, consume || false, this.size);
|
|
825
819
|
}
|
|
826
820
|
/**
|
|
827
821
|
* Adds data to end of supplied data
|
|
@@ -831,7 +825,7 @@ class biwriter {
|
|
|
831
825
|
* @param {boolean} consume - Move current write position to end of data (default false)
|
|
832
826
|
*/
|
|
833
827
|
append(data, consume) {
|
|
834
|
-
return (0,
|
|
828
|
+
return (0, common_js_1.addData)(this, data, consume || false, this.size);
|
|
835
829
|
}
|
|
836
830
|
//
|
|
837
831
|
//finishing
|
|
@@ -889,7 +883,7 @@ class biwriter {
|
|
|
889
883
|
* ```
|
|
890
884
|
*/
|
|
891
885
|
hexdump(options) {
|
|
892
|
-
return (0,
|
|
886
|
+
return (0, common_js_1.hexDump)(this, options);
|
|
893
887
|
}
|
|
894
888
|
/**
|
|
895
889
|
* Turn hexdump on error off (default on)
|
|
@@ -918,7 +912,7 @@ class biwriter {
|
|
|
918
912
|
* @param {string} endian - ``big`` or ``little``
|
|
919
913
|
*/
|
|
920
914
|
writeBit(value, bits, unsigned, endian) {
|
|
921
|
-
return (0,
|
|
915
|
+
return (0, common_js_1.wbit)(this, value, bits, unsigned, endian);
|
|
922
916
|
}
|
|
923
917
|
/**
|
|
924
918
|
* Bit field reader
|
|
@@ -931,7 +925,7 @@ class biwriter {
|
|
|
931
925
|
* @returns number
|
|
932
926
|
*/
|
|
933
927
|
readBit(bits, unsigned, endian) {
|
|
934
|
-
return (0,
|
|
928
|
+
return (0, common_js_1.rbit)(this, bits, unsigned, endian);
|
|
935
929
|
}
|
|
936
930
|
/**
|
|
937
931
|
* Bit field writer
|
|
@@ -3329,7 +3323,7 @@ class biwriter {
|
|
|
3329
3323
|
* @param {boolean} unsigned - if the value is unsigned
|
|
3330
3324
|
*/
|
|
3331
3325
|
writeByte(value, unsigned) {
|
|
3332
|
-
return (0,
|
|
3326
|
+
return (0, common_js_1.wbyte)(this, value, unsigned);
|
|
3333
3327
|
}
|
|
3334
3328
|
/**
|
|
3335
3329
|
* Read byte
|
|
@@ -3338,7 +3332,7 @@ class biwriter {
|
|
|
3338
3332
|
* @returns number
|
|
3339
3333
|
*/
|
|
3340
3334
|
readByte(unsigned) {
|
|
3341
|
-
return (0,
|
|
3335
|
+
return (0, common_js_1.rbyte)(this, unsigned);
|
|
3342
3336
|
}
|
|
3343
3337
|
/**
|
|
3344
3338
|
* Write byte
|
|
@@ -3393,7 +3387,7 @@ class biwriter {
|
|
|
3393
3387
|
* @param {string} endian - ``big`` or ``little`
|
|
3394
3388
|
*/
|
|
3395
3389
|
writeInt16(value, unsigned, endian) {
|
|
3396
|
-
return (0,
|
|
3390
|
+
return (0, common_js_1.wint16)(this, value, unsigned, endian);
|
|
3397
3391
|
}
|
|
3398
3392
|
/**
|
|
3399
3393
|
* Read short
|
|
@@ -3403,7 +3397,7 @@ class biwriter {
|
|
|
3403
3397
|
* @returns number
|
|
3404
3398
|
*/
|
|
3405
3399
|
readInt16(unsigned, endian) {
|
|
3406
|
-
return (0,
|
|
3400
|
+
return (0, common_js_1.rint16)(this, unsigned, endian);
|
|
3407
3401
|
}
|
|
3408
3402
|
/**
|
|
3409
3403
|
* Write int16
|
|
@@ -3459,7 +3453,7 @@ class biwriter {
|
|
|
3459
3453
|
* @param {number} value - value as int
|
|
3460
3454
|
* @param {string} endian - ``big`` or ``little`
|
|
3461
3455
|
*/
|
|
3462
|
-
ushort(value,
|
|
3456
|
+
ushort(value, endian) {
|
|
3463
3457
|
return this.writeInt16(value, true, endian);
|
|
3464
3458
|
}
|
|
3465
3459
|
/**
|
|
@@ -3468,7 +3462,7 @@ class biwriter {
|
|
|
3468
3462
|
* @param {number} value - value as int
|
|
3469
3463
|
* @param {string} endian - ``big`` or ``little`
|
|
3470
3464
|
*/
|
|
3471
|
-
uword(value,
|
|
3465
|
+
uword(value, endian) {
|
|
3472
3466
|
return this.writeInt16(value, true, endian);
|
|
3473
3467
|
}
|
|
3474
3468
|
/**
|
|
@@ -3609,7 +3603,7 @@ class biwriter {
|
|
|
3609
3603
|
* @param {string} endian - ``big`` or ``little`
|
|
3610
3604
|
*/
|
|
3611
3605
|
writeHalfFloat(value, endian) {
|
|
3612
|
-
return (0,
|
|
3606
|
+
return (0, common_js_1.whalffloat)(this, value, endian);
|
|
3613
3607
|
}
|
|
3614
3608
|
/**
|
|
3615
3609
|
* Read half float
|
|
@@ -3618,7 +3612,7 @@ class biwriter {
|
|
|
3618
3612
|
* @returns number
|
|
3619
3613
|
*/
|
|
3620
3614
|
readHalfFloat(endian) {
|
|
3621
|
-
return (0,
|
|
3615
|
+
return (0, common_js_1.rhalffloat)(this, endian);
|
|
3622
3616
|
}
|
|
3623
3617
|
/**
|
|
3624
3618
|
* Writes half float
|
|
@@ -3643,7 +3637,7 @@ class biwriter {
|
|
|
3643
3637
|
*
|
|
3644
3638
|
* @param {number} value - value as int
|
|
3645
3639
|
*/
|
|
3646
|
-
writeHalfFloatBE(value
|
|
3640
|
+
writeHalfFloatBE(value) {
|
|
3647
3641
|
return this.writeHalfFloat(value, "big");
|
|
3648
3642
|
}
|
|
3649
3643
|
/**
|
|
@@ -3651,7 +3645,7 @@ class biwriter {
|
|
|
3651
3645
|
*
|
|
3652
3646
|
* @param {number} value - value as int
|
|
3653
3647
|
*/
|
|
3654
|
-
halffloatbe(value
|
|
3648
|
+
halffloatbe(value) {
|
|
3655
3649
|
return this.writeHalfFloat(value, "big");
|
|
3656
3650
|
}
|
|
3657
3651
|
/**
|
|
@@ -3697,7 +3691,7 @@ class biwriter {
|
|
|
3697
3691
|
* @param {string} endian - ``big`` or ``little`
|
|
3698
3692
|
*/
|
|
3699
3693
|
writeInt32(value, unsigned, endian) {
|
|
3700
|
-
return (0,
|
|
3694
|
+
return (0, common_js_1.wint32)(this, value, unsigned, endian);
|
|
3701
3695
|
}
|
|
3702
3696
|
/**
|
|
3703
3697
|
* Read 32 bit integer
|
|
@@ -3707,7 +3701,7 @@ class biwriter {
|
|
|
3707
3701
|
* @returns number
|
|
3708
3702
|
*/
|
|
3709
3703
|
readInt32(unsigned, endian) {
|
|
3710
|
-
return (0,
|
|
3704
|
+
return (0, common_js_1.rint32)(this, unsigned, endian);
|
|
3711
3705
|
}
|
|
3712
3706
|
/**
|
|
3713
3707
|
* Write int32
|
|
@@ -3919,7 +3913,7 @@ class biwriter {
|
|
|
3919
3913
|
*
|
|
3920
3914
|
* @param {number} value - value as int
|
|
3921
3915
|
*/
|
|
3922
|
-
writeUInt32BE(value
|
|
3916
|
+
writeUInt32BE(value) {
|
|
3923
3917
|
return this.writeInt32(value, true, "big");
|
|
3924
3918
|
}
|
|
3925
3919
|
/**
|
|
@@ -3927,7 +3921,7 @@ class biwriter {
|
|
|
3927
3921
|
*
|
|
3928
3922
|
* @param {number} value - value as int
|
|
3929
3923
|
*/
|
|
3930
|
-
uint32be(value
|
|
3924
|
+
uint32be(value) {
|
|
3931
3925
|
return this.writeInt32(value, true, "big");
|
|
3932
3926
|
}
|
|
3933
3927
|
/**
|
|
@@ -3964,7 +3958,7 @@ class biwriter {
|
|
|
3964
3958
|
* @param {string} endian - ``big`` or ``little`
|
|
3965
3959
|
*/
|
|
3966
3960
|
writeFloat(value, endian) {
|
|
3967
|
-
return (0,
|
|
3961
|
+
return (0, common_js_1.wfloat)(this, value, endian);
|
|
3968
3962
|
}
|
|
3969
3963
|
/**
|
|
3970
3964
|
* Read float
|
|
@@ -3973,7 +3967,7 @@ class biwriter {
|
|
|
3973
3967
|
* @returns number
|
|
3974
3968
|
*/
|
|
3975
3969
|
readFloat(endian) {
|
|
3976
|
-
return (0,
|
|
3970
|
+
return (0, common_js_1.rfloat)(this, endian);
|
|
3977
3971
|
}
|
|
3978
3972
|
/**
|
|
3979
3973
|
* Write float
|
|
@@ -4027,7 +4021,7 @@ class biwriter {
|
|
|
4027
4021
|
* @param {string} endian - ``big`` or ``little`
|
|
4028
4022
|
*/
|
|
4029
4023
|
writeInt64(value, unsigned, endian) {
|
|
4030
|
-
return (0,
|
|
4024
|
+
return (0, common_js_1.wint64)(this, value, unsigned, endian);
|
|
4031
4025
|
}
|
|
4032
4026
|
/**
|
|
4033
4027
|
* Read signed 64 bit integer
|
|
@@ -4036,7 +4030,7 @@ class biwriter {
|
|
|
4036
4030
|
* @returns number
|
|
4037
4031
|
*/
|
|
4038
4032
|
readInt64(unsigned, endian) {
|
|
4039
|
-
return (0,
|
|
4033
|
+
return (0, common_js_1.rint64)(this, unsigned, endian);
|
|
4040
4034
|
}
|
|
4041
4035
|
/**
|
|
4042
4036
|
* Write 64 bit integer
|
|
@@ -4243,7 +4237,7 @@ class biwriter {
|
|
|
4243
4237
|
* @param {string} endian - ``big`` or ``little`
|
|
4244
4238
|
*/
|
|
4245
4239
|
writeDoubleFloat(value, endian) {
|
|
4246
|
-
return (0,
|
|
4240
|
+
return (0, common_js_1.wdfloat)(this, value, endian);
|
|
4247
4241
|
}
|
|
4248
4242
|
/**
|
|
4249
4243
|
* Read double float
|
|
@@ -4252,7 +4246,7 @@ class biwriter {
|
|
|
4252
4246
|
* @returns number
|
|
4253
4247
|
*/
|
|
4254
4248
|
readDoubleFloat(endian) {
|
|
4255
|
-
return (0,
|
|
4249
|
+
return (0, common_js_1.rdfloat)(this, endian);
|
|
4256
4250
|
}
|
|
4257
4251
|
/**
|
|
4258
4252
|
* Writes double float
|
|
@@ -4341,7 +4335,7 @@ class biwriter {
|
|
|
4341
4335
|
* ```
|
|
4342
4336
|
*/
|
|
4343
4337
|
writeString(string, options) {
|
|
4344
|
-
return (0,
|
|
4338
|
+
return (0, common_js_1.wstring)(this, string, options);
|
|
4345
4339
|
}
|
|
4346
4340
|
/**
|
|
4347
4341
|
* Reads string, use options object for different types
|
|
@@ -4361,7 +4355,7 @@ class biwriter {
|
|
|
4361
4355
|
* @return string
|
|
4362
4356
|
*/
|
|
4363
4357
|
readString(options) {
|
|
4364
|
-
return (0,
|
|
4358
|
+
return (0, common_js_1.rstring)(this, options);
|
|
4365
4359
|
}
|
|
4366
4360
|
/**
|
|
4367
4361
|
* Writes string, use options object for different types
|