bireader 3.1.1 → 3.1.2
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/README.md +1 -1
- package/dist/core/BiBase.d.ts +38 -48
- package/dist/core/BiBaseStream.d.ts +10 -10
- package/dist/index.browser.d.ts +38 -7
- package/dist/index.browser.js +96 -46
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs.d.ts +48 -17
- package/dist/index.cjs.js +142 -109
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +48 -17
- package/dist/index.esm.d.ts +48 -17
- package/dist/index.esm.js +142 -109
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/tsconfig.json +0 -15
package/dist/index.cjs.d.ts
CHANGED
|
@@ -118,9 +118,9 @@ declare class BiBase {
|
|
|
118
118
|
errorDump: boolean;
|
|
119
119
|
/**
|
|
120
120
|
* Current buffer data.
|
|
121
|
-
* @type {Buffer|Uint8Array}
|
|
121
|
+
* @type {Buffer|Uint8Array|null}
|
|
122
122
|
*/
|
|
123
|
-
data:
|
|
123
|
+
data: Buffer | Uint8Array | null;
|
|
124
124
|
/**
|
|
125
125
|
* When the data buffer needs to be extended while strict mode is ``false``, this will be the amount it extends.
|
|
126
126
|
*
|
|
@@ -131,18 +131,53 @@ declare class BiBase {
|
|
|
131
131
|
* NOTE: Using ``BiWriter.get`` or ``BiWriter.return`` will now remove all data after the current write position. Use ``BiWriter.data`` to get the full buffer instead.
|
|
132
132
|
*/
|
|
133
133
|
extendBufferSize: number;
|
|
134
|
+
fd: any;
|
|
135
|
+
filePath: string;
|
|
136
|
+
fsMode: string;
|
|
134
137
|
/**
|
|
135
138
|
* The settings that used when using the .str getter / setter
|
|
136
139
|
*/
|
|
137
140
|
private strDefaults;
|
|
141
|
+
maxFileSize: number | null;
|
|
142
|
+
constructor();
|
|
138
143
|
/**
|
|
139
144
|
* Settings for when using .str
|
|
140
145
|
*
|
|
141
146
|
* @param {stringOptions} settings options to use with .str
|
|
142
147
|
*/
|
|
143
148
|
set strSettings(settings: stringOptions);
|
|
144
|
-
|
|
149
|
+
/**
|
|
150
|
+
* Enables expanding in reader (changes strict)
|
|
151
|
+
*
|
|
152
|
+
* @param {boolean} mode - Enable expanding in reader (changes strict)
|
|
153
|
+
*/
|
|
154
|
+
writeMode(mode: boolean): void;
|
|
155
|
+
/**
|
|
156
|
+
* Dummy function, not needed on Non-Stream
|
|
157
|
+
*/
|
|
158
|
+
open(): number;
|
|
159
|
+
/**
|
|
160
|
+
* Dummy function, not needed on Non-Stream
|
|
161
|
+
*/
|
|
162
|
+
updateSize(): void;
|
|
163
|
+
/**
|
|
164
|
+
* removes data.
|
|
165
|
+
*/
|
|
166
|
+
close(): void;
|
|
167
|
+
/**
|
|
168
|
+
* Dummy function, not needed on Non-Stream
|
|
169
|
+
*/
|
|
170
|
+
read(start: number, length: number, consume?: boolean): Buffer | Uint8Array;
|
|
171
|
+
/**
|
|
172
|
+
* Dummy function, not needed on Non-Stream
|
|
173
|
+
*/
|
|
174
|
+
write(start: number, data: Buffer, consume?: boolean): number;
|
|
175
|
+
/**
|
|
176
|
+
* Dummy function, not needed on Non-Stream
|
|
177
|
+
*/
|
|
178
|
+
commit(consume?: boolean): number;
|
|
145
179
|
extendArray(to_padd: number): void;
|
|
180
|
+
isBufferOrUint8Array(obj: Buffer | Uint8Array): boolean;
|
|
146
181
|
/**
|
|
147
182
|
*
|
|
148
183
|
* Change endian, defaults to little.
|
|
@@ -383,10 +418,6 @@ declare class BiBase {
|
|
|
383
418
|
* removes data.
|
|
384
419
|
*/
|
|
385
420
|
end(): void;
|
|
386
|
-
/**
|
|
387
|
-
* removes data.
|
|
388
|
-
*/
|
|
389
|
-
close(): void;
|
|
390
421
|
/**
|
|
391
422
|
* removes data.
|
|
392
423
|
*/
|
|
@@ -1424,7 +1455,7 @@ declare class BiBaseStreamer {
|
|
|
1424
1455
|
/**
|
|
1425
1456
|
* Current buffer chunk.
|
|
1426
1457
|
*
|
|
1427
|
-
* @type {Buffer}
|
|
1458
|
+
* @type {Buffer|null}
|
|
1428
1459
|
*/
|
|
1429
1460
|
data: Buffer | null;
|
|
1430
1461
|
/**
|
|
@@ -1718,15 +1749,15 @@ declare class BiBaseStreamer {
|
|
|
1718
1749
|
*/
|
|
1719
1750
|
get return(): Buffer;
|
|
1720
1751
|
/**
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1752
|
+
* Creates hex dump string. Will console log or return string if set in options.
|
|
1753
|
+
*
|
|
1754
|
+
* @param {object} options
|
|
1755
|
+
* @param {hexdumpOptions?} options - hex dump options
|
|
1756
|
+
* @param {number?} options.length - number of bytes to log, default ``192`` or end of data
|
|
1757
|
+
* @param {number?} options.startByte - byte to start dump (default ``0``)
|
|
1758
|
+
* @param {boolean?} options.supressUnicode - Supress unicode character preview for even columns.
|
|
1759
|
+
* @param {boolean?} options.returnString - Returns the hex dump string instead of logging it.
|
|
1760
|
+
*/
|
|
1730
1761
|
hexdump(options?: hexdumpOptions): void | string;
|
|
1731
1762
|
/**
|
|
1732
1763
|
* Turn hexdump on error off (default on).
|
package/dist/index.cjs.js
CHANGED
|
@@ -1751,9 +1751,9 @@ class BiBase {
|
|
|
1751
1751
|
this.errorDump = true;
|
|
1752
1752
|
/**
|
|
1753
1753
|
* Current buffer data.
|
|
1754
|
-
* @type {Buffer|Uint8Array}
|
|
1754
|
+
* @type {Buffer|Uint8Array|null}
|
|
1755
1755
|
*/
|
|
1756
|
-
this.data =
|
|
1756
|
+
this.data = null;
|
|
1757
1757
|
/**
|
|
1758
1758
|
* When the data buffer needs to be extended while strict mode is ``false``, this will be the amount it extends.
|
|
1759
1759
|
*
|
|
@@ -1764,10 +1764,14 @@ class BiBase {
|
|
|
1764
1764
|
* NOTE: Using ``BiWriter.get`` or ``BiWriter.return`` will now remove all data after the current write position. Use ``BiWriter.data`` to get the full buffer instead.
|
|
1765
1765
|
*/
|
|
1766
1766
|
this.extendBufferSize = 0;
|
|
1767
|
+
this.fd = null;
|
|
1768
|
+
this.filePath = "";
|
|
1769
|
+
this.fsMode = "";
|
|
1767
1770
|
/**
|
|
1768
1771
|
* The settings that used when using the .str getter / setter
|
|
1769
1772
|
*/
|
|
1770
1773
|
this.strDefaults = { stringType: "utf-8", terminateValue: 0x0 };
|
|
1774
|
+
this.maxFileSize = null;
|
|
1771
1775
|
}
|
|
1772
1776
|
/**
|
|
1773
1777
|
* Settings for when using .str
|
|
@@ -1784,12 +1788,67 @@ class BiBase {
|
|
|
1784
1788
|
this.strDefaults.stripNull = settings.stripNull;
|
|
1785
1789
|
this.strDefaults.terminateValue = settings.terminateValue;
|
|
1786
1790
|
}
|
|
1787
|
-
|
|
1788
|
-
|
|
1791
|
+
/**
|
|
1792
|
+
* Enables expanding in reader (changes strict)
|
|
1793
|
+
*
|
|
1794
|
+
* @param {boolean} mode - Enable expanding in reader (changes strict)
|
|
1795
|
+
*/
|
|
1796
|
+
writeMode(mode) {
|
|
1797
|
+
if (mode) {
|
|
1798
|
+
this.strict = false;
|
|
1799
|
+
return;
|
|
1800
|
+
}
|
|
1801
|
+
else {
|
|
1802
|
+
this.strict = true;
|
|
1803
|
+
return;
|
|
1804
|
+
}
|
|
1805
|
+
}
|
|
1806
|
+
/**
|
|
1807
|
+
* Dummy function, not needed on Non-Stream
|
|
1808
|
+
*/
|
|
1809
|
+
open() {
|
|
1810
|
+
return this.size;
|
|
1811
|
+
}
|
|
1812
|
+
/**
|
|
1813
|
+
* Dummy function, not needed on Non-Stream
|
|
1814
|
+
*/
|
|
1815
|
+
updateSize() {
|
|
1816
|
+
this.return;
|
|
1817
|
+
}
|
|
1818
|
+
/**
|
|
1819
|
+
* removes data.
|
|
1820
|
+
*/
|
|
1821
|
+
close() {
|
|
1822
|
+
this.data = undefined;
|
|
1823
|
+
}
|
|
1824
|
+
/**
|
|
1825
|
+
* Dummy function, not needed on Non-Stream
|
|
1826
|
+
*/
|
|
1827
|
+
read(start, length, consume = false) {
|
|
1828
|
+
return this.lift(start, start + length, consume);
|
|
1829
|
+
}
|
|
1830
|
+
/**
|
|
1831
|
+
* Dummy function, not needed on Non-Stream
|
|
1832
|
+
*/
|
|
1833
|
+
write(start, data, consume = false) {
|
|
1834
|
+
this.insert(data, consume, start);
|
|
1835
|
+
return data.length;
|
|
1836
|
+
}
|
|
1837
|
+
/**
|
|
1838
|
+
* Dummy function, not needed on Non-Stream
|
|
1839
|
+
*/
|
|
1840
|
+
commit(consume = true) {
|
|
1841
|
+
return consume ? 0 : 1;
|
|
1789
1842
|
}
|
|
1790
1843
|
extendArray(to_padd) {
|
|
1791
1844
|
return extendarray(this, to_padd);
|
|
1792
1845
|
}
|
|
1846
|
+
isBufferOrUint8Array(obj) {
|
|
1847
|
+
return arraybuffcheck(obj);
|
|
1848
|
+
}
|
|
1849
|
+
///////////////////////////////
|
|
1850
|
+
// ENDIANNESS //
|
|
1851
|
+
///////////////////////////////
|
|
1793
1852
|
/**
|
|
1794
1853
|
*
|
|
1795
1854
|
* Change endian, defaults to little.
|
|
@@ -1843,6 +1902,9 @@ class BiBase {
|
|
|
1843
1902
|
le() {
|
|
1844
1903
|
this.endianness("little");
|
|
1845
1904
|
}
|
|
1905
|
+
///////////////////////////////
|
|
1906
|
+
// SIZE //
|
|
1907
|
+
///////////////////////////////
|
|
1846
1908
|
/**
|
|
1847
1909
|
* Size in bytes of the current buffer.
|
|
1848
1910
|
*
|
|
@@ -1891,9 +1953,9 @@ class BiBase {
|
|
|
1891
1953
|
get lenb() {
|
|
1892
1954
|
return this.sizeB;
|
|
1893
1955
|
}
|
|
1894
|
-
|
|
1895
|
-
//
|
|
1896
|
-
|
|
1956
|
+
///////////////////////////////
|
|
1957
|
+
// POSITION //
|
|
1958
|
+
///////////////////////////////
|
|
1897
1959
|
/**
|
|
1898
1960
|
* Get the current byte position.
|
|
1899
1961
|
*
|
|
@@ -2054,9 +2116,9 @@ class BiBase {
|
|
|
2054
2116
|
get row() {
|
|
2055
2117
|
return Math.abs(Math.floor((this.offset - 1) / 16));
|
|
2056
2118
|
}
|
|
2057
|
-
|
|
2058
|
-
//
|
|
2059
|
-
|
|
2119
|
+
///////////////////////////////
|
|
2120
|
+
// FINISHING //
|
|
2121
|
+
///////////////////////////////
|
|
2060
2122
|
/**
|
|
2061
2123
|
* Returns current data.
|
|
2062
2124
|
*
|
|
@@ -2112,9 +2174,9 @@ class BiBase {
|
|
|
2112
2174
|
errorDumpOn() {
|
|
2113
2175
|
this.errorDump = true;
|
|
2114
2176
|
}
|
|
2115
|
-
|
|
2116
|
-
//
|
|
2117
|
-
|
|
2177
|
+
///////////////////////////////
|
|
2178
|
+
// STRICTMODE //
|
|
2179
|
+
///////////////////////////////
|
|
2118
2180
|
/**
|
|
2119
2181
|
* Disallows extending data if position is outside of max size.
|
|
2120
2182
|
*/
|
|
@@ -2133,12 +2195,6 @@ class BiBase {
|
|
|
2133
2195
|
end() {
|
|
2134
2196
|
this.data = undefined;
|
|
2135
2197
|
}
|
|
2136
|
-
/**
|
|
2137
|
-
* removes data.
|
|
2138
|
-
*/
|
|
2139
|
-
close() {
|
|
2140
|
-
this.data = undefined;
|
|
2141
|
-
}
|
|
2142
2198
|
/**
|
|
2143
2199
|
* removes data.
|
|
2144
2200
|
*/
|
|
@@ -2151,9 +2207,9 @@ class BiBase {
|
|
|
2151
2207
|
finished() {
|
|
2152
2208
|
this.data = undefined;
|
|
2153
2209
|
}
|
|
2154
|
-
|
|
2155
|
-
//
|
|
2156
|
-
|
|
2210
|
+
///////////////////////////////
|
|
2211
|
+
// FIND //
|
|
2212
|
+
///////////////////////////////
|
|
2157
2213
|
/**
|
|
2158
2214
|
* Searches for byte position of string from current read position.
|
|
2159
2215
|
*
|
|
@@ -2261,9 +2317,9 @@ class BiBase {
|
|
|
2261
2317
|
findDoubleFloat(value, endian) {
|
|
2262
2318
|
return fDoubleFloat$1(this, value, endian);
|
|
2263
2319
|
}
|
|
2264
|
-
|
|
2265
|
-
//
|
|
2266
|
-
|
|
2320
|
+
///////////////////////////////
|
|
2321
|
+
// MOVE TO //
|
|
2322
|
+
///////////////////////////////
|
|
2267
2323
|
/**
|
|
2268
2324
|
* Aligns current byte position.
|
|
2269
2325
|
*
|
|
@@ -2284,9 +2340,6 @@ class BiBase {
|
|
|
2284
2340
|
alignRev(number) {
|
|
2285
2341
|
return alignRev$1(this, number);
|
|
2286
2342
|
}
|
|
2287
|
-
//
|
|
2288
|
-
// directly set current position
|
|
2289
|
-
//
|
|
2290
2343
|
/**
|
|
2291
2344
|
* Offset current byte or bit position.
|
|
2292
2345
|
*
|
|
@@ -2364,9 +2417,6 @@ class BiBase {
|
|
|
2364
2417
|
warp(byte, bit) {
|
|
2365
2418
|
return this.goto(byte, bit);
|
|
2366
2419
|
}
|
|
2367
|
-
//
|
|
2368
|
-
// go to start
|
|
2369
|
-
//
|
|
2370
2420
|
/**
|
|
2371
2421
|
* Set byte and bit position to start of data.
|
|
2372
2422
|
*/
|
|
@@ -2401,9 +2451,9 @@ class BiBase {
|
|
|
2401
2451
|
this.offset = this.size;
|
|
2402
2452
|
this.bitoffset = 0;
|
|
2403
2453
|
}
|
|
2404
|
-
|
|
2405
|
-
//
|
|
2406
|
-
|
|
2454
|
+
///////////////////////////////
|
|
2455
|
+
// REMOVE //
|
|
2456
|
+
///////////////////////////////
|
|
2407
2457
|
/**
|
|
2408
2458
|
* Deletes part of data from start to current byte position unless supplied, returns removed.
|
|
2409
2459
|
*
|
|
@@ -2485,9 +2535,9 @@ class BiBase {
|
|
|
2485
2535
|
overwrite(data, consume, offset) {
|
|
2486
2536
|
return addData$1(this, data, consume || false, offset || this.offset, true);
|
|
2487
2537
|
}
|
|
2488
|
-
|
|
2489
|
-
//
|
|
2490
|
-
|
|
2538
|
+
///////////////////////////////
|
|
2539
|
+
// COPY OUT //
|
|
2540
|
+
///////////////////////////////
|
|
2491
2541
|
/**
|
|
2492
2542
|
* Returns part of data from current byte position to end of data unless supplied.
|
|
2493
2543
|
*
|
|
@@ -2548,9 +2598,9 @@ class BiBase {
|
|
|
2548
2598
|
wrap(length, consume) {
|
|
2549
2599
|
return remove$1(this, this.offset, this.offset + (length || 0), consume || false, false);
|
|
2550
2600
|
}
|
|
2551
|
-
|
|
2552
|
-
//
|
|
2553
|
-
|
|
2601
|
+
///////////////////////////////
|
|
2602
|
+
// INSERT //
|
|
2603
|
+
///////////////////////////////
|
|
2554
2604
|
/**
|
|
2555
2605
|
* Inserts data into data.
|
|
2556
2606
|
*
|
|
@@ -2619,9 +2669,9 @@ class BiBase {
|
|
|
2619
2669
|
append(data, consume) {
|
|
2620
2670
|
return addData$1(this, data, consume || false, this.size, false);
|
|
2621
2671
|
}
|
|
2622
|
-
|
|
2623
|
-
//
|
|
2624
|
-
|
|
2672
|
+
///////////////////////////////
|
|
2673
|
+
// MATH //
|
|
2674
|
+
///////////////////////////////
|
|
2625
2675
|
/**
|
|
2626
2676
|
* XOR data.
|
|
2627
2677
|
*
|
|
@@ -2917,9 +2967,9 @@ class BiBase {
|
|
|
2917
2967
|
}
|
|
2918
2968
|
return RSHIFT$1(this, lShiftKey, this.offset, this.offset + Length, consume || false);
|
|
2919
2969
|
}
|
|
2920
|
-
|
|
2921
|
-
//
|
|
2922
|
-
|
|
2970
|
+
///////////////////////////////
|
|
2971
|
+
// BIT READER //
|
|
2972
|
+
///////////////////////////////
|
|
2923
2973
|
/**
|
|
2924
2974
|
*
|
|
2925
2975
|
* Write bits, must have at least value and number of bits.
|
|
@@ -13335,7 +13385,7 @@ class BiBaseStreamer {
|
|
|
13335
13385
|
/**
|
|
13336
13386
|
* Current buffer chunk.
|
|
13337
13387
|
*
|
|
13338
|
-
* @type {Buffer}
|
|
13388
|
+
* @type {Buffer|null}
|
|
13339
13389
|
*/
|
|
13340
13390
|
this.data = null;
|
|
13341
13391
|
/**
|
|
@@ -13577,28 +13627,14 @@ class BiBaseStreamer {
|
|
|
13577
13627
|
}
|
|
13578
13628
|
}
|
|
13579
13629
|
fs.ftruncateSync(this.fd, this.size + length);
|
|
13580
|
-
//if (this.maxFileSize && this.maxFileSize > length) {
|
|
13581
|
-
// // stream extend
|
|
13582
|
-
// const CHUNK_SIZE = 64 * 1024;
|
|
13583
|
-
// const buffer = Buffer.alloc(CHUNK_SIZE);
|
|
13584
|
-
// var amount = length;
|
|
13585
|
-
// var start = this.size;
|
|
13586
|
-
// while (amount) {
|
|
13587
|
-
// const toWrite = Math.min(CHUNK_SIZE, amount);
|
|
13588
|
-
// fs.writeSync(this.fd, buffer, 0, toWrite, start);
|
|
13589
|
-
// start += toWrite;
|
|
13590
|
-
// amount -= toWrite;
|
|
13591
|
-
// }
|
|
13592
|
-
//}
|
|
13593
|
-
//else {
|
|
13594
|
-
// const buffer = Buffer.alloc(length);
|
|
13595
|
-
// fs.writeSync(this.fd, buffer, 0, buffer.length, this.size);
|
|
13596
|
-
//}
|
|
13597
13630
|
this.updateSize();
|
|
13598
13631
|
}
|
|
13599
13632
|
isBufferOrUint8Array(obj) {
|
|
13600
13633
|
return arraybuffcheck(obj);
|
|
13601
13634
|
}
|
|
13635
|
+
///////////////////////////////
|
|
13636
|
+
// ENDIANNESS //
|
|
13637
|
+
///////////////////////////////
|
|
13602
13638
|
/**
|
|
13603
13639
|
*
|
|
13604
13640
|
* Change endian, defaults to little.
|
|
@@ -13652,6 +13688,9 @@ class BiBaseStreamer {
|
|
|
13652
13688
|
le() {
|
|
13653
13689
|
this.endianness("little");
|
|
13654
13690
|
}
|
|
13691
|
+
///////////////////////////////
|
|
13692
|
+
// SIZE //
|
|
13693
|
+
///////////////////////////////
|
|
13655
13694
|
/**
|
|
13656
13695
|
* Size in bytes of the current buffer.
|
|
13657
13696
|
*
|
|
@@ -13700,9 +13739,9 @@ class BiBaseStreamer {
|
|
|
13700
13739
|
get lenb() {
|
|
13701
13740
|
return this.sizeB;
|
|
13702
13741
|
}
|
|
13703
|
-
|
|
13704
|
-
//
|
|
13705
|
-
|
|
13742
|
+
///////////////////////////////
|
|
13743
|
+
// POSITION //
|
|
13744
|
+
///////////////////////////////
|
|
13706
13745
|
/**
|
|
13707
13746
|
* Get the current byte position.
|
|
13708
13747
|
*
|
|
@@ -13863,9 +13902,9 @@ class BiBaseStreamer {
|
|
|
13863
13902
|
get row() {
|
|
13864
13903
|
return Math.abs(Math.floor((this.offset - 1) / 16));
|
|
13865
13904
|
}
|
|
13866
|
-
|
|
13867
|
-
//
|
|
13868
|
-
|
|
13905
|
+
///////////////////////////////
|
|
13906
|
+
// FINISHING //
|
|
13907
|
+
///////////////////////////////
|
|
13869
13908
|
/**
|
|
13870
13909
|
* Returns current data.
|
|
13871
13910
|
*
|
|
@@ -13897,15 +13936,15 @@ class BiBaseStreamer {
|
|
|
13897
13936
|
return this.data || Buffer.alloc(0);
|
|
13898
13937
|
}
|
|
13899
13938
|
/**
|
|
13900
|
-
|
|
13901
|
-
|
|
13902
|
-
|
|
13903
|
-
|
|
13904
|
-
|
|
13905
|
-
|
|
13906
|
-
|
|
13907
|
-
|
|
13908
|
-
|
|
13939
|
+
* Creates hex dump string. Will console log or return string if set in options.
|
|
13940
|
+
*
|
|
13941
|
+
* @param {object} options
|
|
13942
|
+
* @param {hexdumpOptions?} options - hex dump options
|
|
13943
|
+
* @param {number?} options.length - number of bytes to log, default ``192`` or end of data
|
|
13944
|
+
* @param {number?} options.startByte - byte to start dump (default ``0``)
|
|
13945
|
+
* @param {boolean?} options.supressUnicode - Supress unicode character preview for even columns.
|
|
13946
|
+
* @param {boolean?} options.returnString - Returns the hex dump string instead of logging it.
|
|
13947
|
+
*/
|
|
13909
13948
|
hexdump(options = {}) {
|
|
13910
13949
|
return hexDump(this, options);
|
|
13911
13950
|
}
|
|
@@ -13921,9 +13960,9 @@ class BiBaseStreamer {
|
|
|
13921
13960
|
errorDumpOn() {
|
|
13922
13961
|
this.errorDump = true;
|
|
13923
13962
|
}
|
|
13924
|
-
|
|
13925
|
-
//
|
|
13926
|
-
|
|
13963
|
+
///////////////////////////////
|
|
13964
|
+
// STRICTMODE //
|
|
13965
|
+
///////////////////////////////
|
|
13927
13966
|
/**
|
|
13928
13967
|
* Disallows extending data if position is outside of max size.
|
|
13929
13968
|
*/
|
|
@@ -13954,9 +13993,9 @@ class BiBaseStreamer {
|
|
|
13954
13993
|
finished() {
|
|
13955
13994
|
this.data = null;
|
|
13956
13995
|
}
|
|
13957
|
-
|
|
13958
|
-
//
|
|
13959
|
-
|
|
13996
|
+
///////////////////////////////
|
|
13997
|
+
// FIND //
|
|
13998
|
+
///////////////////////////////
|
|
13960
13999
|
/**
|
|
13961
14000
|
* Searches for byte position of string from current read position.
|
|
13962
14001
|
*
|
|
@@ -14064,9 +14103,9 @@ class BiBaseStreamer {
|
|
|
14064
14103
|
findDoubleFloat(value, endian) {
|
|
14065
14104
|
return fDoubleFloat(this, value, endian);
|
|
14066
14105
|
}
|
|
14067
|
-
|
|
14068
|
-
//
|
|
14069
|
-
|
|
14106
|
+
///////////////////////////////
|
|
14107
|
+
// MOVE TO //
|
|
14108
|
+
///////////////////////////////
|
|
14070
14109
|
/**
|
|
14071
14110
|
* Aligns current byte position.
|
|
14072
14111
|
*
|
|
@@ -14087,9 +14126,6 @@ class BiBaseStreamer {
|
|
|
14087
14126
|
alignRev(number) {
|
|
14088
14127
|
return alignRev(this, number);
|
|
14089
14128
|
}
|
|
14090
|
-
//
|
|
14091
|
-
// directly set current position
|
|
14092
|
-
//
|
|
14093
14129
|
/**
|
|
14094
14130
|
* Offset current byte or bit position.
|
|
14095
14131
|
*
|
|
@@ -14167,9 +14203,6 @@ class BiBaseStreamer {
|
|
|
14167
14203
|
warp(byte, bit) {
|
|
14168
14204
|
return this.goto(byte, bit);
|
|
14169
14205
|
}
|
|
14170
|
-
//
|
|
14171
|
-
// go to start
|
|
14172
|
-
//
|
|
14173
14206
|
/**
|
|
14174
14207
|
* Set byte and bit position to start of data.
|
|
14175
14208
|
*/
|
|
@@ -14204,9 +14237,9 @@ class BiBaseStreamer {
|
|
|
14204
14237
|
this.offset = this.size;
|
|
14205
14238
|
this.bitoffset = 0;
|
|
14206
14239
|
}
|
|
14207
|
-
|
|
14208
|
-
//
|
|
14209
|
-
|
|
14240
|
+
///////////////////////////////
|
|
14241
|
+
// REMOVE //
|
|
14242
|
+
///////////////////////////////
|
|
14210
14243
|
/**
|
|
14211
14244
|
* Deletes part of data from start to current byte position unless supplied, returns removed.
|
|
14212
14245
|
*
|
|
@@ -14288,9 +14321,9 @@ class BiBaseStreamer {
|
|
|
14288
14321
|
overwrite(data, consume, offset) {
|
|
14289
14322
|
return addData(this, data, consume || false, offset || this.offset, true);
|
|
14290
14323
|
}
|
|
14291
|
-
|
|
14292
|
-
//
|
|
14293
|
-
|
|
14324
|
+
///////////////////////////////
|
|
14325
|
+
// COPY OUT //
|
|
14326
|
+
///////////////////////////////
|
|
14294
14327
|
/**
|
|
14295
14328
|
* Returns part of data from current byte position to end of data unless supplied.
|
|
14296
14329
|
*
|
|
@@ -14351,9 +14384,9 @@ class BiBaseStreamer {
|
|
|
14351
14384
|
wrap(length, consume) {
|
|
14352
14385
|
return remove(this, this.offset, this.offset + (length || 0), consume || false, false);
|
|
14353
14386
|
}
|
|
14354
|
-
|
|
14355
|
-
//
|
|
14356
|
-
|
|
14387
|
+
///////////////////////////////
|
|
14388
|
+
// INSERT //
|
|
14389
|
+
///////////////////////////////
|
|
14357
14390
|
/**
|
|
14358
14391
|
* Inserts data into data.
|
|
14359
14392
|
*
|
|
@@ -14422,9 +14455,9 @@ class BiBaseStreamer {
|
|
|
14422
14455
|
append(data, consume) {
|
|
14423
14456
|
return addData(this, data, consume || false, this.size, false);
|
|
14424
14457
|
}
|
|
14425
|
-
|
|
14426
|
-
//
|
|
14427
|
-
|
|
14458
|
+
///////////////////////////////
|
|
14459
|
+
// MATH //
|
|
14460
|
+
///////////////////////////////
|
|
14428
14461
|
/**
|
|
14429
14462
|
* XOR data.
|
|
14430
14463
|
*
|
|
@@ -14720,9 +14753,9 @@ class BiBaseStreamer {
|
|
|
14720
14753
|
}
|
|
14721
14754
|
return RSHIFT(this, lShiftKey, this.offset, this.offset + Length, consume || false);
|
|
14722
14755
|
}
|
|
14723
|
-
|
|
14724
|
-
//
|
|
14725
|
-
|
|
14756
|
+
///////////////////////////////
|
|
14757
|
+
// BIT READER //
|
|
14758
|
+
///////////////////////////////
|
|
14726
14759
|
/**
|
|
14727
14760
|
*
|
|
14728
14761
|
* Write bits, must have at least value and number of bits.
|