bireader 1.0.38 → 1.0.40
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 +174 -175
- package/lib/cjs/index.d.ts.map +1 -1
- package/lib/cjs/index.js +188 -179
- package/lib/cjs/index.js.map +1 -1
- package/lib/esm/index.d.ts +174 -175
- package/lib/esm/index.d.ts.map +1 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/index.mjs +188 -179
- package/package.json +1 -1
package/lib/esm/index.mjs
CHANGED
|
@@ -80,8 +80,11 @@ function alignRev(_this, n) {
|
|
|
80
80
|
_this.skip(a * -1);
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
function goto(_this,
|
|
84
|
-
|
|
83
|
+
function goto(_this, bytes, bits) {
|
|
84
|
+
var new_size = (((bytes || 0)) + Math.ceil(((bits || 0)) / 8));
|
|
85
|
+
if (bits && bits < 0) {
|
|
86
|
+
new_size = Math.floor(((((bytes || 0)) * 8) + (bits || 0)) / 8);
|
|
87
|
+
}
|
|
85
88
|
if (new_size > _this.size) {
|
|
86
89
|
if (_this.strict == false) {
|
|
87
90
|
_this.extendArray(new_size - _this.size);
|
|
@@ -91,8 +94,15 @@ function goto(_this, byte, bit) {
|
|
|
91
94
|
throw new Error("\x1b[33m[Strict mode]\x1b[0m: Goto utside of range of data: goto " + new_size + " of " + _this.size);
|
|
92
95
|
}
|
|
93
96
|
}
|
|
94
|
-
_this.offset =
|
|
95
|
-
|
|
97
|
+
_this.offset = bytes;
|
|
98
|
+
// Adjust byte offset based on bit overflow
|
|
99
|
+
_this.offset += Math.floor(((bits || 0)) / 8);
|
|
100
|
+
// Adjust bit offset
|
|
101
|
+
_this.bitoffset = ((bits || 0) + 64) % 8;
|
|
102
|
+
// Ensure bit offset stays between 0-7
|
|
103
|
+
_this.bitoffset = Math.min(Math.max(_this.bitoffset, 0), 7);
|
|
104
|
+
// Ensure offset doesn't go negative
|
|
105
|
+
_this.offset = Math.max(_this.offset, 0);
|
|
96
106
|
}
|
|
97
107
|
function remove(_this, startOffset, endOffset, consume, remove, fillValue) {
|
|
98
108
|
const new_start = Math.abs(startOffset || 0);
|
|
@@ -1391,10 +1401,10 @@ function wstring(_this, string, options) {
|
|
|
1391
1401
|
/**
|
|
1392
1402
|
* Binary reader, includes bitfields and strings
|
|
1393
1403
|
*
|
|
1394
|
-
* @param {Buffer|Uint8Array} data -
|
|
1404
|
+
* @param {Buffer|Uint8Array} data - ``Buffer`` or ``Uint8Array``. Always found in ``biwriter.data``
|
|
1395
1405
|
* @param {number} byteOffset - Byte offset to start reader (default 0)
|
|
1396
1406
|
* @param {number} bitOffset - Bit offset 0-7 to start reader (default 0)
|
|
1397
|
-
* @param {string} endianness - Endianness
|
|
1407
|
+
* @param {string} endianness - Endianness ``big`` or ``little`` (default ``little``)
|
|
1398
1408
|
* @param {boolean} strict - Strict mode: if true does not extend supplied array on outside write (default true)
|
|
1399
1409
|
*/
|
|
1400
1410
|
export class bireader {
|
|
@@ -1407,10 +1417,10 @@ export class bireader {
|
|
|
1407
1417
|
/**
|
|
1408
1418
|
* Binary reader, includes bitfields and strings
|
|
1409
1419
|
*
|
|
1410
|
-
* @param {Buffer|Uint8Array} data -
|
|
1420
|
+
* @param {Buffer|Uint8Array} data - ``Buffer`` or ``Uint8Array``. Always found in ``biwriter.data``
|
|
1411
1421
|
* @param {number} byteOffset - Byte offset to start reader (default 0)
|
|
1412
1422
|
* @param {number} bitOffset - Bit offset 0-7 to start reader (default 0)
|
|
1413
|
-
* @param {string} endianness - Endianness
|
|
1423
|
+
* @param {string} endianness - Endianness ``big`` or ``little`` (default ``little``)
|
|
1414
1424
|
* @param {boolean} strict - Strict mode: if true does not extend supplied array on outside write (default true)
|
|
1415
1425
|
*/
|
|
1416
1426
|
constructor(data, byteOffset, bitOffset, endianness, strict) {
|
|
@@ -1464,7 +1474,7 @@ export class bireader {
|
|
|
1464
1474
|
*
|
|
1465
1475
|
* Can be changed at any time, doesn't loose position
|
|
1466
1476
|
*
|
|
1467
|
-
* @param {string} endian - endianness
|
|
1477
|
+
* @param {string} endian - endianness ``big`` or ``little``
|
|
1468
1478
|
*/
|
|
1469
1479
|
endianness(endian) {
|
|
1470
1480
|
if (endian == undefined || typeof endian != "string") {
|
|
@@ -2091,7 +2101,7 @@ export class bireader {
|
|
|
2091
2101
|
* @param {number} endOffset - End location (default end of data)
|
|
2092
2102
|
* @param {boolean} consume - Move position to end of lifted data (default false)
|
|
2093
2103
|
* @param {number} fillValue - Byte value to to fill returned data (does NOT fill unless supplied)
|
|
2094
|
-
* @returns {Buffer|Uint8Array} Selected data as
|
|
2104
|
+
* @returns {Buffer|Uint8Array} Selected data as ``Uint8Array`` or ``Buffer``
|
|
2095
2105
|
*/
|
|
2096
2106
|
lift(startOffset, endOffset, consume, fillValue) {
|
|
2097
2107
|
return remove(this, startOffset || this.offset, endOffset || this.size, consume || false, false, fillValue);
|
|
@@ -2103,7 +2113,7 @@ export class bireader {
|
|
|
2103
2113
|
* @param {number} endOffset - End location (default end of data)
|
|
2104
2114
|
* @param {boolean} consume - Move position to end of lifted data (default false)
|
|
2105
2115
|
* @param {number} fillValue - Byte value to to fill returned data (does NOT fill unless supplied)
|
|
2106
|
-
* @returns {Buffer|Uint8Array} Selected data as
|
|
2116
|
+
* @returns {Buffer|Uint8Array} Selected data as ``Uint8Array`` or ``Buffer``
|
|
2107
2117
|
*/
|
|
2108
2118
|
fill(startOffset, endOffset, consume, fillValue) {
|
|
2109
2119
|
return remove(this, startOffset || this.offset, endOffset || this.size, consume || false, false, fillValue);
|
|
@@ -2114,7 +2124,7 @@ export class bireader {
|
|
|
2114
2124
|
*
|
|
2115
2125
|
* @param {number} length - Length of data in bytes to copy from current offset
|
|
2116
2126
|
* @param {number} consume - Moves offset to end of length
|
|
2117
|
-
* @returns {Buffer|Uint8Array} Selected data as
|
|
2127
|
+
* @returns {Buffer|Uint8Array} Selected data as ``Uint8Array`` or ``Buffer``
|
|
2118
2128
|
*/
|
|
2119
2129
|
extract(length, consume) {
|
|
2120
2130
|
return remove(this, this.offset, this.offset + (length || 0), consume || false, false);
|
|
@@ -2125,7 +2135,7 @@ export class bireader {
|
|
|
2125
2135
|
*
|
|
2126
2136
|
* @param {number} length - Length of data in bytes to copy from current offset
|
|
2127
2137
|
* @param {number} consume - Moves offset to end of length
|
|
2128
|
-
* @returns {Buffer|Uint8Array} Selected data as
|
|
2138
|
+
* @returns {Buffer|Uint8Array} Selected data as ``Uint8Array`` or ``Buffer``
|
|
2129
2139
|
*/
|
|
2130
2140
|
slice(length, consume) {
|
|
2131
2141
|
return remove(this, this.offset, this.offset + (length || 0), consume || false, false);
|
|
@@ -2136,7 +2146,7 @@ export class bireader {
|
|
|
2136
2146
|
*
|
|
2137
2147
|
* @param {number} length - Length of data in bytes to copy from current offset
|
|
2138
2148
|
* @param {number} consume - Moves offset to end of length
|
|
2139
|
-
* @returns {Buffer|Uint8Array} Selected data as
|
|
2149
|
+
* @returns {Buffer|Uint8Array} Selected data as ``Uint8Array`` or ``Buffer``
|
|
2140
2150
|
*/
|
|
2141
2151
|
wrap(length, consume) {
|
|
2142
2152
|
return remove(this, this.offset, this.offset + (length || 0), consume || false, false);
|
|
@@ -2148,7 +2158,7 @@ export class bireader {
|
|
|
2148
2158
|
* Inserts data into data
|
|
2149
2159
|
* Note: Must be same data type as supplied data. Errors on strict mode.
|
|
2150
2160
|
*
|
|
2151
|
-
* @param {Buffer|Uint8Array} data -
|
|
2161
|
+
* @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
2152
2162
|
* @param {boolean} consume - Move current byte position to end of data (default false)
|
|
2153
2163
|
* @param {number} offset - Byte position to add at (defaults to current position)
|
|
2154
2164
|
*/
|
|
@@ -2159,7 +2169,7 @@ export class bireader {
|
|
|
2159
2169
|
* Inserts data into data
|
|
2160
2170
|
* Note: Must be same data type as supplied data. Errors on strict mode.
|
|
2161
2171
|
*
|
|
2162
|
-
* @param {Buffer|Uint8Array} data -
|
|
2172
|
+
* @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
2163
2173
|
* @param {boolean} consume - Move current byte position to end of data (default false)
|
|
2164
2174
|
* @param {number} offset - Byte position to add at (defaults to current position)
|
|
2165
2175
|
*/
|
|
@@ -2170,7 +2180,7 @@ export class bireader {
|
|
|
2170
2180
|
* Replaces data in data
|
|
2171
2181
|
* Note: Must be same data type as supplied data. Errors on strict mode.
|
|
2172
2182
|
*
|
|
2173
|
-
* @param {Buffer|Uint8Array} data -
|
|
2183
|
+
* @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to replace in data
|
|
2174
2184
|
* @param {boolean} consume - Move current byte position to end of data (default false)
|
|
2175
2185
|
* @param {number} offset - Offset to add it at (defaults to current position)
|
|
2176
2186
|
*/
|
|
@@ -2181,7 +2191,7 @@ export class bireader {
|
|
|
2181
2191
|
* Replaces data in data
|
|
2182
2192
|
* Note: Must be same data type as supplied data. Errors on strict mode.
|
|
2183
2193
|
*
|
|
2184
|
-
* @param {Buffer|Uint8Array} data -
|
|
2194
|
+
* @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to replace in data
|
|
2185
2195
|
* @param {boolean} consume - Move current byte position to end of data (default false)
|
|
2186
2196
|
* @param {number} offset - Offset to add it at (defaults to current position)
|
|
2187
2197
|
*/
|
|
@@ -2192,7 +2202,7 @@ export class bireader {
|
|
|
2192
2202
|
* Adds data to start of supplied data
|
|
2193
2203
|
* Note: Must be same data type as supplied data. Errors on strict mode.
|
|
2194
2204
|
*
|
|
2195
|
-
* @param {Buffer|Uint8Array} data -
|
|
2205
|
+
* @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
2196
2206
|
* @param {boolean} consume - Move current write position to end of data (default false)
|
|
2197
2207
|
*/
|
|
2198
2208
|
unshift(data, consume) {
|
|
@@ -2202,7 +2212,7 @@ export class bireader {
|
|
|
2202
2212
|
* Adds data to start of supplied data
|
|
2203
2213
|
* Note: Must be same data type as supplied data. Errors on strict mode.
|
|
2204
2214
|
*
|
|
2205
|
-
* @param {Buffer|Uint8Array} data -
|
|
2215
|
+
* @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
2206
2216
|
* @param {boolean} consume - Move current write position to end of data (default false)
|
|
2207
2217
|
*/
|
|
2208
2218
|
prepend(data, consume) {
|
|
@@ -2212,7 +2222,7 @@ export class bireader {
|
|
|
2212
2222
|
* Adds data to end of supplied data
|
|
2213
2223
|
* Note: Must be same data type as supplied data. Errors on strict mode.
|
|
2214
2224
|
*
|
|
2215
|
-
* @param {Buffer|Uint8Array} data -
|
|
2225
|
+
* @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
2216
2226
|
* @param {boolean} consume - Move current write position to end of data (default false)
|
|
2217
2227
|
*/
|
|
2218
2228
|
push(data, consume) {
|
|
@@ -2222,7 +2232,7 @@ export class bireader {
|
|
|
2222
2232
|
* Adds data to end of supplied data
|
|
2223
2233
|
* Note: Must be same data type as supplied data. Errors on strict mode.
|
|
2224
2234
|
*
|
|
2225
|
-
* @param {Buffer|Uint8Array} data -
|
|
2235
|
+
* @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
2226
2236
|
* @param {boolean} consume - Move current write position to end of data (default false)
|
|
2227
2237
|
*/
|
|
2228
2238
|
append(data, consume) {
|
|
@@ -2322,7 +2332,7 @@ export class bireader {
|
|
|
2322
2332
|
*
|
|
2323
2333
|
* @param {number} bits - bits to read
|
|
2324
2334
|
* @param {boolean} unsigned - if the value is unsigned
|
|
2325
|
-
* @param {string} endian - ``big`` or ``little
|
|
2335
|
+
* @param {string} endian - ``big`` or ``little``
|
|
2326
2336
|
* @returns number
|
|
2327
2337
|
*/
|
|
2328
2338
|
readBit(bits, unsigned, endian) {
|
|
@@ -2335,7 +2345,7 @@ export class bireader {
|
|
|
2335
2345
|
*
|
|
2336
2346
|
* @param {number} bits - bits to read
|
|
2337
2347
|
* @param {boolean} unsigned - if the value is unsigned
|
|
2338
|
-
* @param {string} endian - ``big`` or ``little
|
|
2348
|
+
* @param {string} endian - ``big`` or ``little``
|
|
2339
2349
|
* @returns number
|
|
2340
2350
|
*/
|
|
2341
2351
|
bit(bits, unsigned, endian) {
|
|
@@ -2347,7 +2357,7 @@ export class bireader {
|
|
|
2347
2357
|
* Note: When returning to a byte read, remaining bits are dropped
|
|
2348
2358
|
*
|
|
2349
2359
|
* @param {number} bits - bits to read
|
|
2350
|
-
* @param {string} endian - ``big`` or ``little
|
|
2360
|
+
* @param {string} endian - ``big`` or ``little``
|
|
2351
2361
|
* @returns number
|
|
2352
2362
|
*/
|
|
2353
2363
|
ubit(bits, endian) {
|
|
@@ -2359,7 +2369,7 @@ export class bireader {
|
|
|
2359
2369
|
* Note: When returning to a byte read, remaining bits are dropped
|
|
2360
2370
|
*
|
|
2361
2371
|
* @param {boolean} unsigned - if the value is unsigned
|
|
2362
|
-
* @param {string} endian - ``big`` or ``little
|
|
2372
|
+
* @param {string} endian - ``big`` or ``little``
|
|
2363
2373
|
* @returns number
|
|
2364
2374
|
*/
|
|
2365
2375
|
bit1(unsigned, endian) {
|
|
@@ -4540,7 +4550,7 @@ export class bireader {
|
|
|
4540
4550
|
* Read short
|
|
4541
4551
|
*
|
|
4542
4552
|
* @param {boolean} unsigned - if value is unsigned or not
|
|
4543
|
-
* @param {string} endian -
|
|
4553
|
+
* @param {string} endian - ``big`` or ``little``
|
|
4544
4554
|
* @returns number
|
|
4545
4555
|
*/
|
|
4546
4556
|
readInt16(unsigned, endian) {
|
|
@@ -4551,7 +4561,7 @@ export class bireader {
|
|
|
4551
4561
|
*
|
|
4552
4562
|
* @param {number} value - value as int
|
|
4553
4563
|
* @param {boolean} unsigned - if the value is unsigned
|
|
4554
|
-
* @param {string} endian - ``big`` or ``little
|
|
4564
|
+
* @param {string} endian - ``big`` or ``little``
|
|
4555
4565
|
*/
|
|
4556
4566
|
writeInt16(value, unsigned, endian) {
|
|
4557
4567
|
return wint16(this, value, unsigned, endian);
|
|
@@ -4560,7 +4570,7 @@ export class bireader {
|
|
|
4560
4570
|
* Write unsigned int16
|
|
4561
4571
|
*
|
|
4562
4572
|
* @param {number} value - value as int
|
|
4563
|
-
* @param {string} endian - ``big`` or ``little
|
|
4573
|
+
* @param {string} endian - ``big`` or ``little``
|
|
4564
4574
|
*/
|
|
4565
4575
|
writeUInt16(value, endian) {
|
|
4566
4576
|
return wint16(this, value, true, endian);
|
|
@@ -4569,7 +4579,7 @@ export class bireader {
|
|
|
4569
4579
|
* Read short
|
|
4570
4580
|
*
|
|
4571
4581
|
* @param {boolean} unsigned - if value is unsigned or not
|
|
4572
|
-
* @param {string} endian -
|
|
4582
|
+
* @param {string} endian - ``big`` or ``little``
|
|
4573
4583
|
* @returns number
|
|
4574
4584
|
*/
|
|
4575
4585
|
int16(unsigned, endian) {
|
|
@@ -4579,7 +4589,7 @@ export class bireader {
|
|
|
4579
4589
|
* Read short
|
|
4580
4590
|
*
|
|
4581
4591
|
* @param {boolean} unsigned - if value is unsigned or not
|
|
4582
|
-
* @param {string} endian -
|
|
4592
|
+
* @param {string} endian - ``big`` or ``little``
|
|
4583
4593
|
* @returns number
|
|
4584
4594
|
*/
|
|
4585
4595
|
short(unsigned, endian) {
|
|
@@ -4589,7 +4599,7 @@ export class bireader {
|
|
|
4589
4599
|
* Read short
|
|
4590
4600
|
*
|
|
4591
4601
|
* @param {boolean} unsigned - if value is unsigned or not
|
|
4592
|
-
* @param {string} endian -
|
|
4602
|
+
* @param {string} endian - ``big`` or ``little``
|
|
4593
4603
|
* @returns number
|
|
4594
4604
|
*/
|
|
4595
4605
|
word(unsigned, endian) {
|
|
@@ -4598,7 +4608,7 @@ export class bireader {
|
|
|
4598
4608
|
/**
|
|
4599
4609
|
* Read unsigned short
|
|
4600
4610
|
*
|
|
4601
|
-
* @param {string} endian -
|
|
4611
|
+
* @param {string} endian - ``big`` or ``little``
|
|
4602
4612
|
*
|
|
4603
4613
|
* @returns number
|
|
4604
4614
|
*/
|
|
@@ -4608,7 +4618,7 @@ export class bireader {
|
|
|
4608
4618
|
/**
|
|
4609
4619
|
* Read unsigned short
|
|
4610
4620
|
*
|
|
4611
|
-
* @param {string} endian -
|
|
4621
|
+
* @param {string} endian - ``big`` or ``little``
|
|
4612
4622
|
*
|
|
4613
4623
|
* @returns number
|
|
4614
4624
|
*/
|
|
@@ -4618,7 +4628,7 @@ export class bireader {
|
|
|
4618
4628
|
/**
|
|
4619
4629
|
* Read unsigned short
|
|
4620
4630
|
*
|
|
4621
|
-
* @param {string} endian -
|
|
4631
|
+
* @param {string} endian - ``big`` or ``little``
|
|
4622
4632
|
*
|
|
4623
4633
|
* @returns number
|
|
4624
4634
|
*/
|
|
@@ -4628,7 +4638,7 @@ export class bireader {
|
|
|
4628
4638
|
/**
|
|
4629
4639
|
* Read unsigned short
|
|
4630
4640
|
*
|
|
4631
|
-
* @param {string} endian -
|
|
4641
|
+
* @param {string} endian - ``big`` or ``little``
|
|
4632
4642
|
*
|
|
4633
4643
|
* @returns number
|
|
4634
4644
|
*/
|
|
@@ -4769,7 +4779,7 @@ export class bireader {
|
|
|
4769
4779
|
/**
|
|
4770
4780
|
* Read half float
|
|
4771
4781
|
*
|
|
4772
|
-
* @param {string} endian -
|
|
4782
|
+
* @param {string} endian - ``big`` or ``little``
|
|
4773
4783
|
* @returns number
|
|
4774
4784
|
*/
|
|
4775
4785
|
readHalfFloat(endian) {
|
|
@@ -4779,7 +4789,7 @@ export class bireader {
|
|
|
4779
4789
|
* Writes half float
|
|
4780
4790
|
*
|
|
4781
4791
|
* @param {number} value - value as int
|
|
4782
|
-
* @param {string} endian - ``big`` or ``little
|
|
4792
|
+
* @param {string} endian - ``big`` or ``little``
|
|
4783
4793
|
*/
|
|
4784
4794
|
writeHalfFloat(value, endian) {
|
|
4785
4795
|
return whalffloat(this, value, endian);
|
|
@@ -4787,7 +4797,7 @@ export class bireader {
|
|
|
4787
4797
|
/**
|
|
4788
4798
|
* Read half float
|
|
4789
4799
|
*
|
|
4790
|
-
* @param {string} endian -
|
|
4800
|
+
* @param {string} endian - ``big`` or ``little``
|
|
4791
4801
|
* @returns number
|
|
4792
4802
|
*/
|
|
4793
4803
|
halffloat(endian) {
|
|
@@ -4796,7 +4806,7 @@ export class bireader {
|
|
|
4796
4806
|
/**
|
|
4797
4807
|
* Read half float
|
|
4798
4808
|
*
|
|
4799
|
-
* @param {string} endian -
|
|
4809
|
+
* @param {string} endian - ``big`` or ``little``
|
|
4800
4810
|
* @returns number
|
|
4801
4811
|
*/
|
|
4802
4812
|
half(endian) {
|
|
@@ -4857,7 +4867,7 @@ export class bireader {
|
|
|
4857
4867
|
* Read 32 bit integer
|
|
4858
4868
|
*
|
|
4859
4869
|
* @param {boolean} unsigned - if value is unsigned or not
|
|
4860
|
-
* @param {string} endian -
|
|
4870
|
+
* @param {string} endian - ``big`` or ``little``
|
|
4861
4871
|
* @returns number
|
|
4862
4872
|
*/
|
|
4863
4873
|
readInt32(unsigned, endian) {
|
|
@@ -4868,7 +4878,7 @@ export class bireader {
|
|
|
4868
4878
|
*
|
|
4869
4879
|
* @param {number} value - value as int
|
|
4870
4880
|
* @param {boolean} unsigned - if the value is unsigned
|
|
4871
|
-
* @param {string} endian - ``big`` or ``little
|
|
4881
|
+
* @param {string} endian - ``big`` or ``little``
|
|
4872
4882
|
*/
|
|
4873
4883
|
writeInt32(value, unsigned, endian) {
|
|
4874
4884
|
return wint32(this, value, unsigned, endian);
|
|
@@ -4886,7 +4896,7 @@ export class bireader {
|
|
|
4886
4896
|
* Read 32 bit integer
|
|
4887
4897
|
*
|
|
4888
4898
|
* @param {boolean} unsigned - if value is unsigned or not
|
|
4889
|
-
* @param {string} endian -
|
|
4899
|
+
* @param {string} endian - ``big`` or ``little``
|
|
4890
4900
|
* @returns number
|
|
4891
4901
|
*/
|
|
4892
4902
|
int(unsigned, endian) {
|
|
@@ -4896,7 +4906,7 @@ export class bireader {
|
|
|
4896
4906
|
* Read 32 bit integer
|
|
4897
4907
|
*
|
|
4898
4908
|
* @param {boolean} unsigned - if value is unsigned or not
|
|
4899
|
-
* @param {string} endian -
|
|
4909
|
+
* @param {string} endian - ``big`` or ``little``
|
|
4900
4910
|
* @returns number
|
|
4901
4911
|
*/
|
|
4902
4912
|
double(unsigned, endian) {
|
|
@@ -4906,7 +4916,7 @@ export class bireader {
|
|
|
4906
4916
|
* Read 32 bit integer
|
|
4907
4917
|
*
|
|
4908
4918
|
* @param {boolean} unsigned - if value is unsigned or not
|
|
4909
|
-
* @param {string} endian -
|
|
4919
|
+
* @param {string} endian - ``big`` or ``little``
|
|
4910
4920
|
* @returns number
|
|
4911
4921
|
*/
|
|
4912
4922
|
int32(unsigned, endian) {
|
|
@@ -4916,7 +4926,7 @@ export class bireader {
|
|
|
4916
4926
|
* Read 32 bit integer
|
|
4917
4927
|
*
|
|
4918
4928
|
* @param {boolean} unsigned - if value is unsigned or not
|
|
4919
|
-
* @param {string} endian -
|
|
4929
|
+
* @param {string} endian - ``big`` or ``little``
|
|
4920
4930
|
* @returns number
|
|
4921
4931
|
*/
|
|
4922
4932
|
long(unsigned, endian) {
|
|
@@ -5128,25 +5138,25 @@ export class bireader {
|
|
|
5128
5138
|
/**
|
|
5129
5139
|
* Read float
|
|
5130
5140
|
*
|
|
5131
|
-
* @param {string} endian -
|
|
5141
|
+
* @param {string} endian - ``big`` or ``little``
|
|
5132
5142
|
* @returns number
|
|
5133
5143
|
*/
|
|
5134
5144
|
readFloat(endian) {
|
|
5135
5145
|
return rfloat(this, endian);
|
|
5136
5146
|
}
|
|
5137
5147
|
/**
|
|
5138
|
-
|
|
5139
|
-
|
|
5140
|
-
|
|
5141
|
-
|
|
5142
|
-
|
|
5148
|
+
* Write float
|
|
5149
|
+
*
|
|
5150
|
+
* @param {number} value - value as int
|
|
5151
|
+
* @param {string} endian - ``big`` or ``little``
|
|
5152
|
+
*/
|
|
5143
5153
|
writeFloat(value, endian) {
|
|
5144
5154
|
return wfloat(this, value, endian);
|
|
5145
5155
|
}
|
|
5146
5156
|
/**
|
|
5147
5157
|
* Read float
|
|
5148
5158
|
*
|
|
5149
|
-
* @param {string} endian -
|
|
5159
|
+
* @param {string} endian - ``big`` or ``little``
|
|
5150
5160
|
* @returns number
|
|
5151
5161
|
*/
|
|
5152
5162
|
float(endian) {
|
|
@@ -5190,7 +5200,7 @@ export class bireader {
|
|
|
5190
5200
|
/**
|
|
5191
5201
|
* Read signed 64 bit integer
|
|
5192
5202
|
* @param {boolean} unsigned - if value is unsigned or not
|
|
5193
|
-
* @param {string} endian -
|
|
5203
|
+
* @param {string} endian - ``big`` or ``little``
|
|
5194
5204
|
* @returns number
|
|
5195
5205
|
*/
|
|
5196
5206
|
readInt64(unsigned, endian) {
|
|
@@ -5201,7 +5211,7 @@ export class bireader {
|
|
|
5201
5211
|
*
|
|
5202
5212
|
* @param {number} value - value as int
|
|
5203
5213
|
* @param {boolean} unsigned - if the value is unsigned
|
|
5204
|
-
* @param {string} endian - ``big`` or ``little
|
|
5214
|
+
* @param {string} endian - ``big`` or ``little``
|
|
5205
5215
|
*/
|
|
5206
5216
|
writeInt64(value, unsigned, endian) {
|
|
5207
5217
|
return wint64(this, value, unsigned, endian);
|
|
@@ -5209,7 +5219,7 @@ export class bireader {
|
|
|
5209
5219
|
/**
|
|
5210
5220
|
* Read signed 64 bit integer
|
|
5211
5221
|
* @param {boolean} unsigned - if value is unsigned or not
|
|
5212
|
-
* @param {string} endian -
|
|
5222
|
+
* @param {string} endian - ``big`` or ``little``
|
|
5213
5223
|
* @returns number
|
|
5214
5224
|
*/
|
|
5215
5225
|
int64(unsigned, endian) {
|
|
@@ -5218,7 +5228,7 @@ export class bireader {
|
|
|
5218
5228
|
/**
|
|
5219
5229
|
* Read signed 64 bit integer
|
|
5220
5230
|
* @param {boolean} unsigned - if value is unsigned or not
|
|
5221
|
-
* @param {string} endian -
|
|
5231
|
+
* @param {string} endian - ``big`` or ``little``
|
|
5222
5232
|
* @returns number
|
|
5223
5233
|
*/
|
|
5224
5234
|
bigint(unsigned, endian) {
|
|
@@ -5227,7 +5237,7 @@ export class bireader {
|
|
|
5227
5237
|
/**
|
|
5228
5238
|
* Read signed 64 bit integer
|
|
5229
5239
|
* @param {boolean} unsigned - if value is unsigned or not
|
|
5230
|
-
* @param {string} endian -
|
|
5240
|
+
* @param {string} endian - ``big`` or ``little``
|
|
5231
5241
|
* @returns number
|
|
5232
5242
|
*/
|
|
5233
5243
|
quad(unsigned, endian) {
|
|
@@ -5399,7 +5409,7 @@ export class bireader {
|
|
|
5399
5409
|
/**
|
|
5400
5410
|
* Read double float
|
|
5401
5411
|
*
|
|
5402
|
-
* @param {string} endian -
|
|
5412
|
+
* @param {string} endian - ``big`` or ``little``
|
|
5403
5413
|
* @returns number
|
|
5404
5414
|
*/
|
|
5405
5415
|
readDoubleFloat(endian) {
|
|
@@ -5410,7 +5420,7 @@ export class bireader {
|
|
|
5410
5420
|
*
|
|
5411
5421
|
* @param {number} value - value as int
|
|
5412
5422
|
* @param {number} offset - byte offset (default last write position)
|
|
5413
|
-
* @param {string} endian - ``big`` or ``little
|
|
5423
|
+
* @param {string} endian - ``big`` or ``little``
|
|
5414
5424
|
*/
|
|
5415
5425
|
writeDoubleFloat(value, endian) {
|
|
5416
5426
|
return wdfloat(this, value, endian);
|
|
@@ -5418,7 +5428,7 @@ export class bireader {
|
|
|
5418
5428
|
/**
|
|
5419
5429
|
* Read double float
|
|
5420
5430
|
*
|
|
5421
|
-
* @param {string} endian -
|
|
5431
|
+
* @param {string} endian - ``big`` or ``little``
|
|
5422
5432
|
* @returns number
|
|
5423
5433
|
*/
|
|
5424
5434
|
doublefloat(endian) {
|
|
@@ -5427,7 +5437,7 @@ export class bireader {
|
|
|
5427
5437
|
/**
|
|
5428
5438
|
* Read double float
|
|
5429
5439
|
*
|
|
5430
|
-
* @param {string} endian -
|
|
5440
|
+
* @param {string} endian - ``big`` or ``little``
|
|
5431
5441
|
* @returns number
|
|
5432
5442
|
*/
|
|
5433
5443
|
dfloat(endian) {
|
|
@@ -5920,7 +5930,7 @@ export class biwriter {
|
|
|
5920
5930
|
*
|
|
5921
5931
|
* Can be changed at any time, doesn't loose position
|
|
5922
5932
|
*
|
|
5923
|
-
* @param {string} endian - Endianness
|
|
5933
|
+
* @param {string} endian - Endianness ``big`` or ``little``
|
|
5924
5934
|
*/
|
|
5925
5935
|
endianness(endian) {
|
|
5926
5936
|
if (endian == undefined || typeof endian != "string") {
|
|
@@ -6554,7 +6564,7 @@ export class biwriter {
|
|
|
6554
6564
|
* @param {number} endOffset - End location (default end of data)
|
|
6555
6565
|
* @param {boolean} consume - Move position to end of lifted data (default false)
|
|
6556
6566
|
* @param {number} fillValue - Byte value to to fill returned data (does NOT fill unless supplied)
|
|
6557
|
-
* @returns {Buffer|Uint8Array} Selected data as
|
|
6567
|
+
* @returns {Buffer|Uint8Array} Selected data as ``Uint8Array`` or ``Buffer``
|
|
6558
6568
|
*/
|
|
6559
6569
|
lift(startOffset, endOffset, consume, fillValue) {
|
|
6560
6570
|
return remove(this, startOffset || this.offset, endOffset || this.size, consume || false, false, fillValue);
|
|
@@ -6566,7 +6576,7 @@ export class biwriter {
|
|
|
6566
6576
|
* @param {number} endOffset - End location (default end of data)
|
|
6567
6577
|
* @param {boolean} consume - Move position to end of lifted data (default false)
|
|
6568
6578
|
* @param {number} fillValue - Byte value to to fill returned data (does NOT fill unless supplied)
|
|
6569
|
-
* @returns {Buffer|Uint8Array} Selected data as
|
|
6579
|
+
* @returns {Buffer|Uint8Array} Selected data as ``Uint8Array`` or ``Buffer``
|
|
6570
6580
|
*/
|
|
6571
6581
|
fill(startOffset, endOffset, consume, fillValue) {
|
|
6572
6582
|
return remove(this, startOffset || this.offset, endOffset || this.size, consume || false, false, fillValue);
|
|
@@ -6577,7 +6587,7 @@ export class biwriter {
|
|
|
6577
6587
|
*
|
|
6578
6588
|
* @param {number} length - Length of data in bytes to copy from current offset
|
|
6579
6589
|
* @param {number} consume - Moves offset to end of length
|
|
6580
|
-
* @returns {Buffer|Uint8Array} Selected data as
|
|
6590
|
+
* @returns {Buffer|Uint8Array} Selected data as ``Uint8Array`` or ``Buffer``
|
|
6581
6591
|
*/
|
|
6582
6592
|
extract(length, consume) {
|
|
6583
6593
|
return remove(this, this.offset, this.offset + (length || 0), consume || false, false);
|
|
@@ -6588,7 +6598,7 @@ export class biwriter {
|
|
|
6588
6598
|
*
|
|
6589
6599
|
* @param {number} length - Length of data in bytes to copy from current offset
|
|
6590
6600
|
* @param {number} consume - Moves offset to end of length
|
|
6591
|
-
* @returns {Buffer|Uint8Array} Selected data as
|
|
6601
|
+
* @returns {Buffer|Uint8Array} Selected data as ``Uint8Array`` or ``Buffer``
|
|
6592
6602
|
*/
|
|
6593
6603
|
slice(length, consume) {
|
|
6594
6604
|
return remove(this, this.offset, this.offset + (length || 0), consume || false, false);
|
|
@@ -6599,7 +6609,7 @@ export class biwriter {
|
|
|
6599
6609
|
*
|
|
6600
6610
|
* @param {number} length - Length of data in bytes to copy from current offset
|
|
6601
6611
|
* @param {number} consume - Moves offset to end of length
|
|
6602
|
-
* @returns {Buffer|Uint8Array} Selected data as
|
|
6612
|
+
* @returns {Buffer|Uint8Array} Selected data as ``Uint8Array`` or ``Buffer``
|
|
6603
6613
|
*/
|
|
6604
6614
|
wrap(length, consume) {
|
|
6605
6615
|
return remove(this, this.offset, this.offset + (length || 0), consume || false, false);
|
|
@@ -6611,7 +6621,7 @@ export class biwriter {
|
|
|
6611
6621
|
* Inserts data into data
|
|
6612
6622
|
* Note: Must be same data type as supplied data. Errors on strict mode.
|
|
6613
6623
|
*
|
|
6614
|
-
* @param {Buffer|Uint8Array} data -
|
|
6624
|
+
* @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
6615
6625
|
* @param {boolean} consume - Move current byte position to end of data (default false)
|
|
6616
6626
|
* @param {number} offset - Byte position to add at (defaults to current position)
|
|
6617
6627
|
*/
|
|
@@ -6622,7 +6632,7 @@ export class biwriter {
|
|
|
6622
6632
|
* Inserts data into data
|
|
6623
6633
|
* Note: Must be same data type as supplied data. Errors on strict mode.
|
|
6624
6634
|
*
|
|
6625
|
-
* @param {Buffer|Uint8Array} data -
|
|
6635
|
+
* @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
6626
6636
|
* @param {boolean} consume - Move current byte position to end of data (default false)
|
|
6627
6637
|
* @param {number} offset - Byte position to add at (defaults to current position)
|
|
6628
6638
|
*/
|
|
@@ -6633,7 +6643,7 @@ export class biwriter {
|
|
|
6633
6643
|
* Replaces data in data
|
|
6634
6644
|
* Note: Must be same data type as supplied data. Errors on strict mode.
|
|
6635
6645
|
*
|
|
6636
|
-
* @param {Buffer|Uint8Array} data -
|
|
6646
|
+
* @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to replace in data
|
|
6637
6647
|
* @param {boolean} consume - Move current byte position to end of data (default false)
|
|
6638
6648
|
* @param {number} offset - Offset to add it at (defaults to current position)
|
|
6639
6649
|
*/
|
|
@@ -6644,7 +6654,7 @@ export class biwriter {
|
|
|
6644
6654
|
* Replaces data in data
|
|
6645
6655
|
* Note: Must be same data type as supplied data. Errors on strict mode.
|
|
6646
6656
|
*
|
|
6647
|
-
* @param {Buffer|Uint8Array} data -
|
|
6657
|
+
* @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to replace in data
|
|
6648
6658
|
* @param {boolean} consume - Move current byte position to end of data (default false)
|
|
6649
6659
|
* @param {number} offset - Offset to add it at (defaults to current position)
|
|
6650
6660
|
*/
|
|
@@ -6655,7 +6665,7 @@ export class biwriter {
|
|
|
6655
6665
|
* Adds data to start of supplied data
|
|
6656
6666
|
* Note: Must be same data type as supplied data. Errors on strict mode.
|
|
6657
6667
|
*
|
|
6658
|
-
* @param {Buffer|Uint8Array} data -
|
|
6668
|
+
* @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
6659
6669
|
* @param {boolean} consume - Move current write position to end of data (default false)
|
|
6660
6670
|
*/
|
|
6661
6671
|
unshift(data, consume) {
|
|
@@ -6665,7 +6675,7 @@ export class biwriter {
|
|
|
6665
6675
|
* Adds data to start of supplied data
|
|
6666
6676
|
* Note: Must be same data type as supplied data. Errors on strict mode.
|
|
6667
6677
|
*
|
|
6668
|
-
* @param {Buffer|Uint8Array} data -
|
|
6678
|
+
* @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
6669
6679
|
* @param {boolean} consume - Move current write position to end of data (default false)
|
|
6670
6680
|
*/
|
|
6671
6681
|
prepend(data, consume) {
|
|
@@ -6675,7 +6685,7 @@ export class biwriter {
|
|
|
6675
6685
|
* Adds data to end of supplied data
|
|
6676
6686
|
* Note: Must be same data type as supplied data. Errors on strict mode.
|
|
6677
6687
|
*
|
|
6678
|
-
* @param {Buffer|Uint8Array} data -
|
|
6688
|
+
* @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
6679
6689
|
* @param {boolean} consume - Move current write position to end of data (default false)
|
|
6680
6690
|
*/
|
|
6681
6691
|
push(data, consume) {
|
|
@@ -6685,7 +6695,7 @@ export class biwriter {
|
|
|
6685
6695
|
* Adds data to end of supplied data
|
|
6686
6696
|
* Note: Must be same data type as supplied data. Errors on strict mode.
|
|
6687
6697
|
*
|
|
6688
|
-
* @param {Buffer|Uint8Array} data -
|
|
6698
|
+
* @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
6689
6699
|
* @param {boolean} consume - Move current write position to end of data (default false)
|
|
6690
6700
|
*/
|
|
6691
6701
|
append(data, consume) {
|
|
@@ -6785,7 +6795,7 @@ export class biwriter {
|
|
|
6785
6795
|
*
|
|
6786
6796
|
* @param {number} bits - bits to read
|
|
6787
6797
|
* @param {boolean} unsigned - if the value is unsigned
|
|
6788
|
-
* @param {string} endian - ``big`` or ``little
|
|
6798
|
+
* @param {string} endian - ``big`` or ``little``
|
|
6789
6799
|
* @returns number
|
|
6790
6800
|
*/
|
|
6791
6801
|
readBit(bits, unsigned, endian) {
|
|
@@ -6799,7 +6809,7 @@ export class biwriter {
|
|
|
6799
6809
|
* @param {number} value - value as int
|
|
6800
6810
|
* @param {number} bits - bits to write
|
|
6801
6811
|
* @param {boolean} unsigned - if the value is unsigned
|
|
6802
|
-
* @param {string} endian - ``big`` or ``little
|
|
6812
|
+
* @param {string} endian - ``big`` or ``little``
|
|
6803
6813
|
* @returns number
|
|
6804
6814
|
*/
|
|
6805
6815
|
bit(value, bits, unsigned, endian) {
|
|
@@ -6812,7 +6822,7 @@ export class biwriter {
|
|
|
6812
6822
|
*
|
|
6813
6823
|
* @param {number} value - value as int
|
|
6814
6824
|
* @param {number} bits - bits to write
|
|
6815
|
-
* @param {string} endian - ``big`` or ``little
|
|
6825
|
+
* @param {string} endian - ``big`` or ``little``
|
|
6816
6826
|
* @returns number
|
|
6817
6827
|
*/
|
|
6818
6828
|
ubit(value, bits, endian) {
|
|
@@ -6925,7 +6935,7 @@ export class biwriter {
|
|
|
6925
6935
|
*
|
|
6926
6936
|
* @param {number} value - value as int
|
|
6927
6937
|
* @param {boolean} unsigned - if the value is unsigned
|
|
6928
|
-
* @param {string} endian - ``big`` or ``little
|
|
6938
|
+
* @param {string} endian - ``big`` or ``little``
|
|
6929
6939
|
* @returns number
|
|
6930
6940
|
*/
|
|
6931
6941
|
bit1(value, unsigned, endian) {
|
|
@@ -6961,7 +6971,7 @@ export class biwriter {
|
|
|
6961
6971
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
6962
6972
|
*
|
|
6963
6973
|
* @param {number} value - value as int
|
|
6964
|
-
* @param {string} endian - ``big`` or ``little
|
|
6974
|
+
* @param {string} endian - ``big`` or ``little``
|
|
6965
6975
|
* @returns number
|
|
6966
6976
|
*/
|
|
6967
6977
|
ubit1(value, endian) {
|
|
@@ -6996,7 +7006,7 @@ export class biwriter {
|
|
|
6996
7006
|
*
|
|
6997
7007
|
* @param {number} value - value as int
|
|
6998
7008
|
* @param {boolean} unsigned - if the value is unsigned
|
|
6999
|
-
* @param {string} endian - ``big`` or ``little
|
|
7009
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7000
7010
|
* @returns number
|
|
7001
7011
|
*/
|
|
7002
7012
|
bit2(value, unsigned, endian) {
|
|
@@ -7032,7 +7042,7 @@ export class biwriter {
|
|
|
7032
7042
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
7033
7043
|
*
|
|
7034
7044
|
* @param {number} value - value as int
|
|
7035
|
-
* @param {string} endian - ``big`` or ``little
|
|
7045
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7036
7046
|
* @returns number
|
|
7037
7047
|
*/
|
|
7038
7048
|
ubit2(value, endian) {
|
|
@@ -7067,7 +7077,7 @@ export class biwriter {
|
|
|
7067
7077
|
*
|
|
7068
7078
|
* @param {number} value - value as int
|
|
7069
7079
|
* @param {boolean} unsigned - if the value is unsigned
|
|
7070
|
-
* @param {string} endian - ``big`` or ``little
|
|
7080
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7071
7081
|
* @returns number
|
|
7072
7082
|
*/
|
|
7073
7083
|
bit3(value, unsigned, endian) {
|
|
@@ -7103,7 +7113,7 @@ export class biwriter {
|
|
|
7103
7113
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
7104
7114
|
*
|
|
7105
7115
|
* @param {number} value - value as int
|
|
7106
|
-
* @param {string} endian - ``big`` or ``little
|
|
7116
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7107
7117
|
* @returns number
|
|
7108
7118
|
*/
|
|
7109
7119
|
ubit3(value, endian) {
|
|
@@ -7138,7 +7148,7 @@ export class biwriter {
|
|
|
7138
7148
|
*
|
|
7139
7149
|
* @param {number} value - value as int
|
|
7140
7150
|
* @param {boolean} unsigned - if the value is unsigned
|
|
7141
|
-
* @param {string} endian - ``big`` or ``little
|
|
7151
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7142
7152
|
* @returns number
|
|
7143
7153
|
*/
|
|
7144
7154
|
bit4(value, unsigned, endian) {
|
|
@@ -7174,7 +7184,7 @@ export class biwriter {
|
|
|
7174
7184
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
7175
7185
|
*
|
|
7176
7186
|
* @param {number} value - value as int
|
|
7177
|
-
* @param {string} endian - ``big`` or ``little
|
|
7187
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7178
7188
|
* @returns number
|
|
7179
7189
|
*/
|
|
7180
7190
|
ubit4(value, endian) {
|
|
@@ -7209,7 +7219,7 @@ export class biwriter {
|
|
|
7209
7219
|
*
|
|
7210
7220
|
* @param {number} value - value as int
|
|
7211
7221
|
* @param {boolean} unsigned - if the value is unsigned
|
|
7212
|
-
* @param {string} endian - ``big`` or ``little
|
|
7222
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7213
7223
|
* @returns number
|
|
7214
7224
|
*/
|
|
7215
7225
|
bit5(value, unsigned, endian) {
|
|
@@ -7245,7 +7255,7 @@ export class biwriter {
|
|
|
7245
7255
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
7246
7256
|
*
|
|
7247
7257
|
* @param {number} value - value as int
|
|
7248
|
-
* @param {string} endian - ``big`` or ``little
|
|
7258
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7249
7259
|
* @returns number
|
|
7250
7260
|
*/
|
|
7251
7261
|
ubit5(value, endian) {
|
|
@@ -7280,7 +7290,7 @@ export class biwriter {
|
|
|
7280
7290
|
*
|
|
7281
7291
|
* @param {number} value - value as int
|
|
7282
7292
|
* @param {boolean} unsigned - if the value is unsigned
|
|
7283
|
-
* @param {string} endian - ``big`` or ``little
|
|
7293
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7284
7294
|
* @returns number
|
|
7285
7295
|
*/
|
|
7286
7296
|
bit6(value, unsigned, endian) {
|
|
@@ -7316,7 +7326,7 @@ export class biwriter {
|
|
|
7316
7326
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
7317
7327
|
*
|
|
7318
7328
|
* @param {number} value - value as int
|
|
7319
|
-
* @param {string} endian - ``big`` or ``little
|
|
7329
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7320
7330
|
* @returns number
|
|
7321
7331
|
*/
|
|
7322
7332
|
ubit6(value, endian) {
|
|
@@ -7351,7 +7361,7 @@ export class biwriter {
|
|
|
7351
7361
|
*
|
|
7352
7362
|
* @param {number} value - value as int
|
|
7353
7363
|
* @param {boolean} unsigned - if the value is unsigned
|
|
7354
|
-
* @param {string} endian - ``big`` or ``little
|
|
7364
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7355
7365
|
* @returns number
|
|
7356
7366
|
*/
|
|
7357
7367
|
bit7(value, unsigned, endian) {
|
|
@@ -7387,7 +7397,7 @@ export class biwriter {
|
|
|
7387
7397
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
7388
7398
|
*
|
|
7389
7399
|
* @param {number} value - value as int
|
|
7390
|
-
* @param {string} endian - ``big`` or ``little
|
|
7400
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7391
7401
|
* @returns number
|
|
7392
7402
|
*/
|
|
7393
7403
|
ubit7(value, endian) {
|
|
@@ -7422,7 +7432,7 @@ export class biwriter {
|
|
|
7422
7432
|
*
|
|
7423
7433
|
* @param {number} value - value as int
|
|
7424
7434
|
* @param {boolean} unsigned - if the value is unsigned
|
|
7425
|
-
* @param {string} endian - ``big`` or ``little
|
|
7435
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7426
7436
|
* @returns number
|
|
7427
7437
|
*/
|
|
7428
7438
|
bit8(value, unsigned, endian) {
|
|
@@ -7458,7 +7468,7 @@ export class biwriter {
|
|
|
7458
7468
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
7459
7469
|
*
|
|
7460
7470
|
* @param {number} value - value as int
|
|
7461
|
-
* @param {string} endian - ``big`` or ``little
|
|
7471
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7462
7472
|
* @returns number
|
|
7463
7473
|
*/
|
|
7464
7474
|
ubit8(value, endian) {
|
|
@@ -7493,7 +7503,7 @@ export class biwriter {
|
|
|
7493
7503
|
*
|
|
7494
7504
|
* @param {number} value - value as int
|
|
7495
7505
|
* @param {boolean} unsigned - if the value is unsigned
|
|
7496
|
-
* @param {string} endian - ``big`` or ``little
|
|
7506
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7497
7507
|
* @returns number
|
|
7498
7508
|
*/
|
|
7499
7509
|
bit9(value, unsigned, endian) {
|
|
@@ -7529,7 +7539,7 @@ export class biwriter {
|
|
|
7529
7539
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
7530
7540
|
*
|
|
7531
7541
|
* @param {number} value - value as int
|
|
7532
|
-
* @param {string} endian - ``big`` or ``little
|
|
7542
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7533
7543
|
* @returns number
|
|
7534
7544
|
*/
|
|
7535
7545
|
ubit9(value, endian) {
|
|
@@ -7564,7 +7574,7 @@ export class biwriter {
|
|
|
7564
7574
|
*
|
|
7565
7575
|
* @param {number} value - value as int
|
|
7566
7576
|
* @param {boolean} unsigned - if the value is unsigned
|
|
7567
|
-
* @param {string} endian - ``big`` or ``little
|
|
7577
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7568
7578
|
* @returns number
|
|
7569
7579
|
*/
|
|
7570
7580
|
bit10(value, unsigned, endian) {
|
|
@@ -7600,7 +7610,7 @@ export class biwriter {
|
|
|
7600
7610
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
7601
7611
|
*
|
|
7602
7612
|
* @param {number} value - value as int
|
|
7603
|
-
* @param {string} endian - ``big`` or ``little
|
|
7613
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7604
7614
|
* @returns number
|
|
7605
7615
|
*/
|
|
7606
7616
|
ubit10(value, endian) {
|
|
@@ -7635,7 +7645,7 @@ export class biwriter {
|
|
|
7635
7645
|
*
|
|
7636
7646
|
* @param {number} value - value as int
|
|
7637
7647
|
* @param {boolean} unsigned - if the value is unsigned
|
|
7638
|
-
* @param {string} endian - ``big`` or ``little
|
|
7648
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7639
7649
|
* @returns number
|
|
7640
7650
|
*/
|
|
7641
7651
|
bit11(value, unsigned, endian) {
|
|
@@ -7671,7 +7681,7 @@ export class biwriter {
|
|
|
7671
7681
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
7672
7682
|
*
|
|
7673
7683
|
* @param {number} value - value as int
|
|
7674
|
-
* @param {string} endian - ``big`` or ``little
|
|
7684
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7675
7685
|
* @returns number
|
|
7676
7686
|
*/
|
|
7677
7687
|
ubit11(value, endian) {
|
|
@@ -7706,7 +7716,7 @@ export class biwriter {
|
|
|
7706
7716
|
*
|
|
7707
7717
|
* @param {number} value - value as int
|
|
7708
7718
|
* @param {boolean} unsigned - if the value is unsigned
|
|
7709
|
-
* @param {string} endian - ``big`` or ``little
|
|
7719
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7710
7720
|
* @returns number
|
|
7711
7721
|
*/
|
|
7712
7722
|
bit12(value, unsigned, endian) {
|
|
@@ -7742,7 +7752,7 @@ export class biwriter {
|
|
|
7742
7752
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
7743
7753
|
*
|
|
7744
7754
|
* @param {number} value - value as int
|
|
7745
|
-
* @param {string} endian - ``big`` or ``little
|
|
7755
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7746
7756
|
* @returns number
|
|
7747
7757
|
*/
|
|
7748
7758
|
ubit12(value, endian) {
|
|
@@ -7777,7 +7787,7 @@ export class biwriter {
|
|
|
7777
7787
|
*
|
|
7778
7788
|
* @param {number} value - value as int
|
|
7779
7789
|
* @param {boolean} unsigned - if the value is unsigned
|
|
7780
|
-
* @param {string} endian - ``big`` or ``little
|
|
7790
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7781
7791
|
* @returns number
|
|
7782
7792
|
*/
|
|
7783
7793
|
bit13(value, unsigned, endian) {
|
|
@@ -7813,7 +7823,7 @@ export class biwriter {
|
|
|
7813
7823
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
7814
7824
|
*
|
|
7815
7825
|
* @param {number} value - value as int
|
|
7816
|
-
* @param {string} endian - ``big`` or ``little
|
|
7826
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7817
7827
|
* @returns number
|
|
7818
7828
|
*/
|
|
7819
7829
|
ubit13(value, endian) {
|
|
@@ -7848,7 +7858,7 @@ export class biwriter {
|
|
|
7848
7858
|
*
|
|
7849
7859
|
* @param {number} value - value as int
|
|
7850
7860
|
* @param {boolean} unsigned - if the value is unsigned
|
|
7851
|
-
* @param {string} endian - ``big`` or ``little
|
|
7861
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7852
7862
|
* @returns number
|
|
7853
7863
|
*/
|
|
7854
7864
|
bit14(value, unsigned, endian) {
|
|
@@ -7884,7 +7894,7 @@ export class biwriter {
|
|
|
7884
7894
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
7885
7895
|
*
|
|
7886
7896
|
* @param {number} value - value as int
|
|
7887
|
-
* @param {string} endian - ``big`` or ``little
|
|
7897
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7888
7898
|
* @returns number
|
|
7889
7899
|
*/
|
|
7890
7900
|
ubit14(value, endian) {
|
|
@@ -7919,7 +7929,7 @@ export class biwriter {
|
|
|
7919
7929
|
*
|
|
7920
7930
|
* @param {number} value - value as int
|
|
7921
7931
|
* @param {boolean} unsigned - if the value is unsigned
|
|
7922
|
-
* @param {string} endian - ``big`` or ``little
|
|
7932
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7923
7933
|
* @returns number
|
|
7924
7934
|
*/
|
|
7925
7935
|
bit15(value, unsigned, endian) {
|
|
@@ -7955,7 +7965,7 @@ export class biwriter {
|
|
|
7955
7965
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
7956
7966
|
*
|
|
7957
7967
|
* @param {number} value - value as int
|
|
7958
|
-
* @param {string} endian - ``big`` or ``little
|
|
7968
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7959
7969
|
* @returns number
|
|
7960
7970
|
*/
|
|
7961
7971
|
ubit15(value, endian) {
|
|
@@ -7990,7 +8000,7 @@ export class biwriter {
|
|
|
7990
8000
|
*
|
|
7991
8001
|
* @param {number} value - value as int
|
|
7992
8002
|
* @param {boolean} unsigned - if the value is unsigned
|
|
7993
|
-
* @param {string} endian - ``big`` or ``little
|
|
8003
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7994
8004
|
* @returns number
|
|
7995
8005
|
*/
|
|
7996
8006
|
bit16(value, unsigned, endian) {
|
|
@@ -8026,7 +8036,7 @@ export class biwriter {
|
|
|
8026
8036
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
8027
8037
|
*
|
|
8028
8038
|
* @param {number} value - value as int
|
|
8029
|
-
* @param {string} endian - ``big`` or ``little
|
|
8039
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8030
8040
|
* @returns number
|
|
8031
8041
|
*/
|
|
8032
8042
|
ubit16(value, endian) {
|
|
@@ -8061,7 +8071,7 @@ export class biwriter {
|
|
|
8061
8071
|
*
|
|
8062
8072
|
* @param {number} value - value as int
|
|
8063
8073
|
* @param {boolean} unsigned - if the value is unsigned
|
|
8064
|
-
* @param {string} endian - ``big`` or ``little
|
|
8074
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8065
8075
|
* @returns number
|
|
8066
8076
|
*/
|
|
8067
8077
|
bit17(value, unsigned, endian) {
|
|
@@ -8097,7 +8107,7 @@ export class biwriter {
|
|
|
8097
8107
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
8098
8108
|
*
|
|
8099
8109
|
* @param {number} value - value as int
|
|
8100
|
-
* @param {string} endian - ``big`` or ``little
|
|
8110
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8101
8111
|
* @returns number
|
|
8102
8112
|
*/
|
|
8103
8113
|
ubit17(value, endian) {
|
|
@@ -8132,7 +8142,7 @@ export class biwriter {
|
|
|
8132
8142
|
*
|
|
8133
8143
|
* @param {number} value - value as int
|
|
8134
8144
|
* @param {boolean} unsigned - if the value is unsigned
|
|
8135
|
-
* @param {string} endian - ``big`` or ``little
|
|
8145
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8136
8146
|
* @returns number
|
|
8137
8147
|
*/
|
|
8138
8148
|
bit18(value, unsigned, endian) {
|
|
@@ -8168,7 +8178,7 @@ export class biwriter {
|
|
|
8168
8178
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
8169
8179
|
*
|
|
8170
8180
|
* @param {number} value - value as int
|
|
8171
|
-
* @param {string} endian - ``big`` or ``little
|
|
8181
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8172
8182
|
* @returns number
|
|
8173
8183
|
*/
|
|
8174
8184
|
ubit18(value, endian) {
|
|
@@ -8203,7 +8213,7 @@ export class biwriter {
|
|
|
8203
8213
|
*
|
|
8204
8214
|
* @param {number} value - value as int
|
|
8205
8215
|
* @param {boolean} unsigned - if the value is unsigned
|
|
8206
|
-
* @param {string} endian - ``big`` or ``little
|
|
8216
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8207
8217
|
* @returns number
|
|
8208
8218
|
*/
|
|
8209
8219
|
bit19(value, unsigned, endian) {
|
|
@@ -8239,7 +8249,7 @@ export class biwriter {
|
|
|
8239
8249
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
8240
8250
|
*
|
|
8241
8251
|
* @param {number} value - value as int
|
|
8242
|
-
* @param {string} endian - ``big`` or ``little
|
|
8252
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8243
8253
|
* @returns number
|
|
8244
8254
|
*/
|
|
8245
8255
|
ubit19(value, endian) {
|
|
@@ -8274,7 +8284,7 @@ export class biwriter {
|
|
|
8274
8284
|
*
|
|
8275
8285
|
* @param {number} value - value as int
|
|
8276
8286
|
* @param {boolean} unsigned - if the value is unsigned
|
|
8277
|
-
* @param {string} endian - ``big`` or ``little
|
|
8287
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8278
8288
|
* @returns number
|
|
8279
8289
|
*/
|
|
8280
8290
|
bit20(value, unsigned, endian) {
|
|
@@ -8310,7 +8320,7 @@ export class biwriter {
|
|
|
8310
8320
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
8311
8321
|
*
|
|
8312
8322
|
* @param {number} value - value as int
|
|
8313
|
-
* @param {string} endian - ``big`` or ``little
|
|
8323
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8314
8324
|
* @returns number
|
|
8315
8325
|
*/
|
|
8316
8326
|
ubit20(value, endian) {
|
|
@@ -8345,7 +8355,7 @@ export class biwriter {
|
|
|
8345
8355
|
*
|
|
8346
8356
|
* @param {number} value - value as int
|
|
8347
8357
|
* @param {boolean} unsigned - if the value is unsigned
|
|
8348
|
-
* @param {string} endian - ``big`` or ``little
|
|
8358
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8349
8359
|
* @returns number
|
|
8350
8360
|
*/
|
|
8351
8361
|
bit21(value, unsigned, endian) {
|
|
@@ -8381,7 +8391,7 @@ export class biwriter {
|
|
|
8381
8391
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
8382
8392
|
*
|
|
8383
8393
|
* @param {number} value - value as int
|
|
8384
|
-
* @param {string} endian - ``big`` or ``little
|
|
8394
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8385
8395
|
* @returns number
|
|
8386
8396
|
*/
|
|
8387
8397
|
ubit21(value, endian) {
|
|
@@ -8416,7 +8426,7 @@ export class biwriter {
|
|
|
8416
8426
|
*
|
|
8417
8427
|
* @param {number} value - value as int
|
|
8418
8428
|
* @param {boolean} unsigned - if the value is unsigned
|
|
8419
|
-
* @param {string} endian - ``big`` or ``little
|
|
8429
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8420
8430
|
* @returns number
|
|
8421
8431
|
*/
|
|
8422
8432
|
bit22(value, unsigned, endian) {
|
|
@@ -8452,7 +8462,7 @@ export class biwriter {
|
|
|
8452
8462
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
8453
8463
|
*
|
|
8454
8464
|
* @param {number} value - value as int
|
|
8455
|
-
* @param {string} endian - ``big`` or ``little
|
|
8465
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8456
8466
|
* @returns number
|
|
8457
8467
|
*/
|
|
8458
8468
|
ubit22(value, endian) {
|
|
@@ -8487,7 +8497,7 @@ export class biwriter {
|
|
|
8487
8497
|
*
|
|
8488
8498
|
* @param {number} value - value as int
|
|
8489
8499
|
* @param {boolean} unsigned - if the value is unsigned
|
|
8490
|
-
* @param {string} endian - ``big`` or ``little
|
|
8500
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8491
8501
|
* @returns number
|
|
8492
8502
|
*/
|
|
8493
8503
|
bit23(value, unsigned, endian) {
|
|
@@ -8523,7 +8533,7 @@ export class biwriter {
|
|
|
8523
8533
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
8524
8534
|
*
|
|
8525
8535
|
* @param {number} value - value as int
|
|
8526
|
-
* @param {string} endian - ``big`` or ``little
|
|
8536
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8527
8537
|
* @returns number
|
|
8528
8538
|
*/
|
|
8529
8539
|
ubit23(value, endian) {
|
|
@@ -8558,7 +8568,7 @@ export class biwriter {
|
|
|
8558
8568
|
*
|
|
8559
8569
|
* @param {number} value - value as int
|
|
8560
8570
|
* @param {boolean} unsigned - if the value is unsigned
|
|
8561
|
-
* @param {string} endian - ``big`` or ``little
|
|
8571
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8562
8572
|
* @returns number
|
|
8563
8573
|
*/
|
|
8564
8574
|
bit24(value, unsigned, endian) {
|
|
@@ -8594,7 +8604,7 @@ export class biwriter {
|
|
|
8594
8604
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
8595
8605
|
*
|
|
8596
8606
|
* @param {number} value - value as int
|
|
8597
|
-
* @param {string} endian - ``big`` or ``little
|
|
8607
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8598
8608
|
* @returns number
|
|
8599
8609
|
*/
|
|
8600
8610
|
ubit24(value, endian) {
|
|
@@ -8629,7 +8639,7 @@ export class biwriter {
|
|
|
8629
8639
|
*
|
|
8630
8640
|
* @param {number} value - value as int
|
|
8631
8641
|
* @param {boolean} unsigned - if the value is unsigned
|
|
8632
|
-
* @param {string} endian - ``big`` or ``little
|
|
8642
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8633
8643
|
* @returns number
|
|
8634
8644
|
*/
|
|
8635
8645
|
bit25(value, unsigned, endian) {
|
|
@@ -8665,7 +8675,7 @@ export class biwriter {
|
|
|
8665
8675
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
8666
8676
|
*
|
|
8667
8677
|
* @param {number} value - value as int
|
|
8668
|
-
* @param {string} endian - ``big`` or ``little
|
|
8678
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8669
8679
|
* @returns number
|
|
8670
8680
|
*/
|
|
8671
8681
|
ubit25(value, endian) {
|
|
@@ -8700,7 +8710,7 @@ export class biwriter {
|
|
|
8700
8710
|
*
|
|
8701
8711
|
* @param {number} value - value as int
|
|
8702
8712
|
* @param {boolean} unsigned - if the value is unsigned
|
|
8703
|
-
* @param {string} endian - ``big`` or ``little
|
|
8713
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8704
8714
|
* @returns number
|
|
8705
8715
|
*/
|
|
8706
8716
|
bit26(value, unsigned, endian) {
|
|
@@ -8736,7 +8746,7 @@ export class biwriter {
|
|
|
8736
8746
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
8737
8747
|
*
|
|
8738
8748
|
* @param {number} value - value as int
|
|
8739
|
-
* @param {string} endian - ``big`` or ``little
|
|
8749
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8740
8750
|
* @returns number
|
|
8741
8751
|
*/
|
|
8742
8752
|
ubit26(value, endian) {
|
|
@@ -8771,7 +8781,7 @@ export class biwriter {
|
|
|
8771
8781
|
*
|
|
8772
8782
|
* @param {number} value - value as int
|
|
8773
8783
|
* @param {boolean} unsigned - if the value is unsigned
|
|
8774
|
-
* @param {string} endian - ``big`` or ``little
|
|
8784
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8775
8785
|
* @returns number
|
|
8776
8786
|
*/
|
|
8777
8787
|
bit27(value, unsigned, endian) {
|
|
@@ -8807,7 +8817,7 @@ export class biwriter {
|
|
|
8807
8817
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
8808
8818
|
*
|
|
8809
8819
|
* @param {number} value - value as int
|
|
8810
|
-
* @param {string} endian - ``big`` or ``little
|
|
8820
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8811
8821
|
* @returns number
|
|
8812
8822
|
*/
|
|
8813
8823
|
ubit27(value, endian) {
|
|
@@ -8842,7 +8852,7 @@ export class biwriter {
|
|
|
8842
8852
|
*
|
|
8843
8853
|
* @param {number} value - value as int
|
|
8844
8854
|
* @param {boolean} unsigned - if the value is unsigned
|
|
8845
|
-
* @param {string} endian - ``big`` or ``little
|
|
8855
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8846
8856
|
* @returns number
|
|
8847
8857
|
*/
|
|
8848
8858
|
bit28(value, unsigned, endian) {
|
|
@@ -8878,7 +8888,7 @@ export class biwriter {
|
|
|
8878
8888
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
8879
8889
|
*
|
|
8880
8890
|
* @param {number} value - value as int
|
|
8881
|
-
* @param {string} endian - ``big`` or ``little
|
|
8891
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8882
8892
|
* @returns number
|
|
8883
8893
|
*/
|
|
8884
8894
|
ubit28(value, endian) {
|
|
@@ -8913,7 +8923,7 @@ export class biwriter {
|
|
|
8913
8923
|
*
|
|
8914
8924
|
* @param {number} value - value as int
|
|
8915
8925
|
* @param {boolean} unsigned - if the value is unsigned
|
|
8916
|
-
* @param {string} endian - ``big`` or ``little
|
|
8926
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8917
8927
|
* @returns number
|
|
8918
8928
|
*/
|
|
8919
8929
|
bit29(value, unsigned, endian) {
|
|
@@ -8949,7 +8959,7 @@ export class biwriter {
|
|
|
8949
8959
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
8950
8960
|
*
|
|
8951
8961
|
* @param {number} value - value as int
|
|
8952
|
-
* @param {string} endian - ``big`` or ``little
|
|
8962
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8953
8963
|
* @returns number
|
|
8954
8964
|
*/
|
|
8955
8965
|
ubit29(value, endian) {
|
|
@@ -8984,7 +8994,7 @@ export class biwriter {
|
|
|
8984
8994
|
*
|
|
8985
8995
|
* @param {number} value - value as int
|
|
8986
8996
|
* @param {boolean} unsigned - if the value is unsigned
|
|
8987
|
-
* @param {string} endian - ``big`` or ``little
|
|
8997
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8988
8998
|
* @returns number
|
|
8989
8999
|
*/
|
|
8990
9000
|
bit30(value, unsigned, endian) {
|
|
@@ -9020,7 +9030,7 @@ export class biwriter {
|
|
|
9020
9030
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
9021
9031
|
*
|
|
9022
9032
|
* @param {number} value - value as int
|
|
9023
|
-
* @param {string} endian - ``big`` or ``little
|
|
9033
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9024
9034
|
* @returns number
|
|
9025
9035
|
*/
|
|
9026
9036
|
ubit30(value, endian) {
|
|
@@ -9055,7 +9065,7 @@ export class biwriter {
|
|
|
9055
9065
|
*
|
|
9056
9066
|
* @param {number} value - value as int
|
|
9057
9067
|
* @param {boolean} unsigned - if the value is unsigned
|
|
9058
|
-
* @param {string} endian - ``big`` or ``little
|
|
9068
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9059
9069
|
* @returns number
|
|
9060
9070
|
*/
|
|
9061
9071
|
bit31(value, unsigned, endian) {
|
|
@@ -9091,7 +9101,7 @@ export class biwriter {
|
|
|
9091
9101
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
9092
9102
|
*
|
|
9093
9103
|
* @param {number} value - value as int
|
|
9094
|
-
* @param {string} endian - ``big`` or ``little
|
|
9104
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9095
9105
|
* @returns number
|
|
9096
9106
|
*/
|
|
9097
9107
|
ubit31(value, endian) {
|
|
@@ -9126,7 +9136,7 @@ export class biwriter {
|
|
|
9126
9136
|
*
|
|
9127
9137
|
* @param {number} value - value as int
|
|
9128
9138
|
* @param {boolean} unsigned - if the value is unsigned
|
|
9129
|
-
* @param {string} endian - ``big`` or ``little
|
|
9139
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9130
9140
|
* @returns number
|
|
9131
9141
|
*/
|
|
9132
9142
|
bit32(value, unsigned, endian) {
|
|
@@ -9162,7 +9172,7 @@ export class biwriter {
|
|
|
9162
9172
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
9163
9173
|
*
|
|
9164
9174
|
* @param {number} value - value as int
|
|
9165
|
-
* @param {string} endian - ``big`` or ``little
|
|
9175
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9166
9176
|
* @returns number
|
|
9167
9177
|
*/
|
|
9168
9178
|
ubit32(value, endian) {
|
|
@@ -9269,7 +9279,7 @@ export class biwriter {
|
|
|
9269
9279
|
*
|
|
9270
9280
|
* @param {number} value - value as int
|
|
9271
9281
|
* @param {boolean} unsigned - if the value is unsigned
|
|
9272
|
-
* @param {string} endian - ``big`` or ``little
|
|
9282
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9273
9283
|
*/
|
|
9274
9284
|
writeInt16(value, unsigned, endian) {
|
|
9275
9285
|
return wint16(this, value, unsigned, endian);
|
|
@@ -9278,7 +9288,7 @@ export class biwriter {
|
|
|
9278
9288
|
* Read short
|
|
9279
9289
|
*
|
|
9280
9290
|
* @param {boolean} unsigned - if value is unsigned or not
|
|
9281
|
-
* @param {string} endian -
|
|
9291
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9282
9292
|
* @returns number
|
|
9283
9293
|
*/
|
|
9284
9294
|
readInt16(unsigned, endian) {
|
|
@@ -9289,7 +9299,7 @@ export class biwriter {
|
|
|
9289
9299
|
*
|
|
9290
9300
|
* @param {number} value - value as int
|
|
9291
9301
|
* @param {boolean} unsigned - if the value is unsigned
|
|
9292
|
-
* @param {string} endian - ``big`` or ``little
|
|
9302
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9293
9303
|
*/
|
|
9294
9304
|
int16(value, unsigned, endian) {
|
|
9295
9305
|
return this.writeInt16(value, unsigned, endian);
|
|
@@ -9299,7 +9309,7 @@ export class biwriter {
|
|
|
9299
9309
|
*
|
|
9300
9310
|
* @param {number} value - value as int
|
|
9301
9311
|
* @param {boolean} unsigned - if the value is unsigned
|
|
9302
|
-
* @param {string} endian - ``big`` or ``little
|
|
9312
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9303
9313
|
*/
|
|
9304
9314
|
short(value, unsigned, endian) {
|
|
9305
9315
|
return this.writeInt16(value, unsigned, endian);
|
|
@@ -9309,7 +9319,7 @@ export class biwriter {
|
|
|
9309
9319
|
*
|
|
9310
9320
|
* @param {number} value - value as int
|
|
9311
9321
|
* @param {boolean} unsigned - if the value is unsigned
|
|
9312
|
-
* @param {string} endian - ``big`` or ``little
|
|
9322
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9313
9323
|
*/
|
|
9314
9324
|
word(value, unsigned, endian) {
|
|
9315
9325
|
return this.writeInt16(value, unsigned, endian);
|
|
@@ -9318,7 +9328,7 @@ export class biwriter {
|
|
|
9318
9328
|
* Write unsigned int16
|
|
9319
9329
|
*
|
|
9320
9330
|
* @param {number} value - value as int
|
|
9321
|
-
* @param {string} endian - ``big`` or ``little
|
|
9331
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9322
9332
|
*/
|
|
9323
9333
|
writeUInt16(value, endian) {
|
|
9324
9334
|
return this.writeInt16(value, true, endian);
|
|
@@ -9327,7 +9337,7 @@ export class biwriter {
|
|
|
9327
9337
|
* Write unsigned int16
|
|
9328
9338
|
*
|
|
9329
9339
|
* @param {number} value - value as int
|
|
9330
|
-
* @param {string} endian - ``big`` or ``little
|
|
9340
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9331
9341
|
*/
|
|
9332
9342
|
uint16(value, endian) {
|
|
9333
9343
|
return this.writeInt16(value, true, endian);
|
|
@@ -9336,7 +9346,7 @@ export class biwriter {
|
|
|
9336
9346
|
* Write unsigned int16
|
|
9337
9347
|
*
|
|
9338
9348
|
* @param {number} value - value as int
|
|
9339
|
-
* @param {string} endian - ``big`` or ``little
|
|
9349
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9340
9350
|
*/
|
|
9341
9351
|
ushort(value, endian) {
|
|
9342
9352
|
return this.writeInt16(value, true, endian);
|
|
@@ -9345,7 +9355,7 @@ export class biwriter {
|
|
|
9345
9355
|
* Write unsigned int16
|
|
9346
9356
|
*
|
|
9347
9357
|
* @param {number} value - value as int
|
|
9348
|
-
* @param {string} endian - ``big`` or ``little
|
|
9358
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9349
9359
|
*/
|
|
9350
9360
|
uword(value, endian) {
|
|
9351
9361
|
return this.writeInt16(value, true, endian);
|
|
@@ -9485,7 +9495,7 @@ export class biwriter {
|
|
|
9485
9495
|
* Writes half float
|
|
9486
9496
|
*
|
|
9487
9497
|
* @param {number} value - value as int
|
|
9488
|
-
* @param {string} endian - ``big`` or ``little
|
|
9498
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9489
9499
|
*/
|
|
9490
9500
|
writeHalfFloat(value, endian) {
|
|
9491
9501
|
return whalffloat(this, value, endian);
|
|
@@ -9493,7 +9503,7 @@ export class biwriter {
|
|
|
9493
9503
|
/**
|
|
9494
9504
|
* Read half float
|
|
9495
9505
|
*
|
|
9496
|
-
* @param {string} endian -
|
|
9506
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9497
9507
|
* @returns number
|
|
9498
9508
|
*/
|
|
9499
9509
|
readHalfFloat(endian) {
|
|
@@ -9503,7 +9513,7 @@ export class biwriter {
|
|
|
9503
9513
|
* Writes half float
|
|
9504
9514
|
*
|
|
9505
9515
|
* @param {number} value - value as int
|
|
9506
|
-
* @param {string} endian - ``big`` or ``little
|
|
9516
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9507
9517
|
*/
|
|
9508
9518
|
half(value, endian) {
|
|
9509
9519
|
return this.writeHalfFloat(value, endian);
|
|
@@ -9512,7 +9522,7 @@ export class biwriter {
|
|
|
9512
9522
|
* Writes half float
|
|
9513
9523
|
*
|
|
9514
9524
|
* @param {number} value - value as int
|
|
9515
|
-
* @param {string} endian - ``big`` or ``little
|
|
9525
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9516
9526
|
*/
|
|
9517
9527
|
halffloat(value, endian) {
|
|
9518
9528
|
return this.writeHalfFloat(value, endian);
|
|
@@ -9573,7 +9583,7 @@ export class biwriter {
|
|
|
9573
9583
|
*
|
|
9574
9584
|
* @param {number} value - value as int
|
|
9575
9585
|
* @param {boolean} unsigned - if the value is unsigned
|
|
9576
|
-
* @param {string} endian - ``big`` or ``little
|
|
9586
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9577
9587
|
*/
|
|
9578
9588
|
writeInt32(value, unsigned, endian) {
|
|
9579
9589
|
return wint32(this, value, unsigned, endian);
|
|
@@ -9582,7 +9592,7 @@ export class biwriter {
|
|
|
9582
9592
|
* Read 32 bit integer
|
|
9583
9593
|
*
|
|
9584
9594
|
* @param {boolean} unsigned - if value is unsigned or not
|
|
9585
|
-
* @param {string} endian -
|
|
9595
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9586
9596
|
* @returns number
|
|
9587
9597
|
*/
|
|
9588
9598
|
readInt32(unsigned, endian) {
|
|
@@ -9593,7 +9603,7 @@ export class biwriter {
|
|
|
9593
9603
|
*
|
|
9594
9604
|
* @param {number} value - value as int
|
|
9595
9605
|
* @param {boolean} unsigned - if the value is unsigned
|
|
9596
|
-
* @param {string} endian - ``big`` or ``little
|
|
9606
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9597
9607
|
*/
|
|
9598
9608
|
int(value, unsigned, endian) {
|
|
9599
9609
|
return this.writeInt32(value, unsigned, endian);
|
|
@@ -9603,7 +9613,7 @@ export class biwriter {
|
|
|
9603
9613
|
*
|
|
9604
9614
|
* @param {number} value - value as int
|
|
9605
9615
|
* @param {boolean} unsigned - if the value is unsigned
|
|
9606
|
-
* @param {string} endian - ``big`` or ``little
|
|
9616
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9607
9617
|
*/
|
|
9608
9618
|
int32(value, unsigned, endian) {
|
|
9609
9619
|
return this.writeInt32(value, unsigned, endian);
|
|
@@ -9613,7 +9623,7 @@ export class biwriter {
|
|
|
9613
9623
|
*
|
|
9614
9624
|
* @param {number} value - value as int
|
|
9615
9625
|
* @param {boolean} unsigned - if the value is unsigned
|
|
9616
|
-
* @param {string} endian - ``big`` or ``little
|
|
9626
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9617
9627
|
*/
|
|
9618
9628
|
double(value, unsigned, endian) {
|
|
9619
9629
|
return this.writeInt32(value, unsigned, endian);
|
|
@@ -9623,7 +9633,7 @@ export class biwriter {
|
|
|
9623
9633
|
*
|
|
9624
9634
|
* @param {number} value - value as int
|
|
9625
9635
|
* @param {boolean} unsigned - if the value is unsigned
|
|
9626
|
-
* @param {string} endian - ``big`` or ``little
|
|
9636
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9627
9637
|
*/
|
|
9628
9638
|
long(value, unsigned, endian) {
|
|
9629
9639
|
return this.writeInt32(value, unsigned, endian);
|
|
@@ -9840,7 +9850,7 @@ export class biwriter {
|
|
|
9840
9850
|
* Write float
|
|
9841
9851
|
*
|
|
9842
9852
|
* @param {number} value - value as int
|
|
9843
|
-
* @param {string} endian - ``big`` or ``little
|
|
9853
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9844
9854
|
*/
|
|
9845
9855
|
writeFloat(value, endian) {
|
|
9846
9856
|
return wfloat(this, value, endian);
|
|
@@ -9848,7 +9858,7 @@ export class biwriter {
|
|
|
9848
9858
|
/**
|
|
9849
9859
|
* Read float
|
|
9850
9860
|
*
|
|
9851
|
-
* @param {string} endian -
|
|
9861
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9852
9862
|
* @returns number
|
|
9853
9863
|
*/
|
|
9854
9864
|
readFloat(endian) {
|
|
@@ -9858,7 +9868,7 @@ export class biwriter {
|
|
|
9858
9868
|
* Write float
|
|
9859
9869
|
*
|
|
9860
9870
|
* @param {number} value - value as int
|
|
9861
|
-
* @param {string} endian - ``big`` or ``little
|
|
9871
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9862
9872
|
*/
|
|
9863
9873
|
float(value, endian) {
|
|
9864
9874
|
return this.writeFloat(value, endian);
|
|
@@ -9903,7 +9913,7 @@ export class biwriter {
|
|
|
9903
9913
|
*
|
|
9904
9914
|
* @param {number} value - value as int
|
|
9905
9915
|
* @param {boolean} unsigned - if the value is unsigned
|
|
9906
|
-
* @param {string} endian - ``big`` or ``little
|
|
9916
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9907
9917
|
*/
|
|
9908
9918
|
writeInt64(value, unsigned, endian) {
|
|
9909
9919
|
return wint64(this, value, unsigned, endian);
|
|
@@ -9911,7 +9921,7 @@ export class biwriter {
|
|
|
9911
9921
|
/**
|
|
9912
9922
|
* Read signed 64 bit integer
|
|
9913
9923
|
* @param {boolean} unsigned - if value is unsigned or not
|
|
9914
|
-
* @param {string} endian -
|
|
9924
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9915
9925
|
* @returns number
|
|
9916
9926
|
*/
|
|
9917
9927
|
readInt64(unsigned, endian) {
|
|
@@ -9922,7 +9932,7 @@ export class biwriter {
|
|
|
9922
9932
|
*
|
|
9923
9933
|
* @param {number} value - value as int
|
|
9924
9934
|
* @param {boolean} unsigned - if the value is unsigned
|
|
9925
|
-
* @param {string} endian - ``big`` or ``little
|
|
9935
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9926
9936
|
*/
|
|
9927
9937
|
int64(value, unsigned, endian) {
|
|
9928
9938
|
return this.writeInt64(value, unsigned, endian);
|
|
@@ -9932,7 +9942,7 @@ export class biwriter {
|
|
|
9932
9942
|
*
|
|
9933
9943
|
* @param {number} value - value as int
|
|
9934
9944
|
* @param {boolean} unsigned - if the value is unsigned
|
|
9935
|
-
* @param {string} endian - ``big`` or ``little
|
|
9945
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9936
9946
|
*/
|
|
9937
9947
|
quad(value, unsigned, endian) {
|
|
9938
9948
|
return this.writeInt64(value, unsigned, endian);
|
|
@@ -9942,7 +9952,7 @@ export class biwriter {
|
|
|
9942
9952
|
*
|
|
9943
9953
|
* @param {number} value - value as int
|
|
9944
9954
|
* @param {boolean} unsigned - if the value is unsigned
|
|
9945
|
-
* @param {string} endian - ``big`` or ``little
|
|
9955
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9946
9956
|
*/
|
|
9947
9957
|
bigint(value, unsigned, endian) {
|
|
9948
9958
|
return this.writeInt64(value, unsigned, endian);
|
|
@@ -9951,7 +9961,7 @@ export class biwriter {
|
|
|
9951
9961
|
* Write unsigned 64 bit integer
|
|
9952
9962
|
*
|
|
9953
9963
|
* @param {number} value - value as int
|
|
9954
|
-
* @param {string} endian - ``big`` or ``little
|
|
9964
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9955
9965
|
*/
|
|
9956
9966
|
writeUInt64(value, endian) {
|
|
9957
9967
|
return this.writeInt64(value, true, endian);
|
|
@@ -9960,7 +9970,7 @@ export class biwriter {
|
|
|
9960
9970
|
* Write unsigned 64 bit integer
|
|
9961
9971
|
*
|
|
9962
9972
|
* @param {number} value - value as int
|
|
9963
|
-
* @param {string} endian - ``big`` or ``little
|
|
9973
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9964
9974
|
*/
|
|
9965
9975
|
uint64(value, endian) {
|
|
9966
9976
|
return this.writeInt64(value, true, endian);
|
|
@@ -9969,7 +9979,7 @@ export class biwriter {
|
|
|
9969
9979
|
* Write unsigned 64 bit integer
|
|
9970
9980
|
*
|
|
9971
9981
|
* @param {number} value - value as int
|
|
9972
|
-
* @param {string} endian - ``big`` or ``little
|
|
9982
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9973
9983
|
*/
|
|
9974
9984
|
ubigint(value, endian) {
|
|
9975
9985
|
return this.writeInt64(value, true, endian);
|
|
@@ -9978,7 +9988,7 @@ export class biwriter {
|
|
|
9978
9988
|
* Write unsigned 64 bit integer
|
|
9979
9989
|
*
|
|
9980
9990
|
* @param {number} value - value as int
|
|
9981
|
-
* @param {string} endian - ``big`` or ``little
|
|
9991
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9982
9992
|
*/
|
|
9983
9993
|
uquad(value, endian) {
|
|
9984
9994
|
return this.writeInt64(value, true, endian);
|
|
@@ -10118,8 +10128,7 @@ export class biwriter {
|
|
|
10118
10128
|
* Writes double float
|
|
10119
10129
|
*
|
|
10120
10130
|
* @param {number} value - value as int
|
|
10121
|
-
* @param {
|
|
10122
|
-
* @param {string} endian - ``big`` or ``little`
|
|
10131
|
+
* @param {string} endian - ``big`` or ``little``
|
|
10123
10132
|
*/
|
|
10124
10133
|
writeDoubleFloat(value, endian) {
|
|
10125
10134
|
return wdfloat(this, value, endian);
|
|
@@ -10127,7 +10136,7 @@ export class biwriter {
|
|
|
10127
10136
|
/**
|
|
10128
10137
|
* Read double float
|
|
10129
10138
|
*
|
|
10130
|
-
* @param {string} endian -
|
|
10139
|
+
* @param {string} endian - ``big`` or ``little``
|
|
10131
10140
|
* @returns number
|
|
10132
10141
|
*/
|
|
10133
10142
|
readDoubleFloat(endian) {
|
|
@@ -10137,7 +10146,7 @@ export class biwriter {
|
|
|
10137
10146
|
* Writes double float
|
|
10138
10147
|
*
|
|
10139
10148
|
* @param {number} value - value as int
|
|
10140
|
-
* @param {string} endian - ``big`` or ``little
|
|
10149
|
+
* @param {string} endian - ``big`` or ``little``
|
|
10141
10150
|
*/
|
|
10142
10151
|
doublefloat(value, endian) {
|
|
10143
10152
|
return this.writeDoubleFloat(value, endian);
|
|
@@ -10146,7 +10155,7 @@ export class biwriter {
|
|
|
10146
10155
|
* Writes double float
|
|
10147
10156
|
*
|
|
10148
10157
|
* @param {number} value - value as int
|
|
10149
|
-
* @param {string} endian - ``big`` or ``little
|
|
10158
|
+
* @param {string} endian - ``big`` or ``little``
|
|
10150
10159
|
*/
|
|
10151
10160
|
dfloat(value, endian) {
|
|
10152
10161
|
return this.writeDoubleFloat(value, endian);
|