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/cjs/index.js
CHANGED
|
@@ -83,8 +83,11 @@ function alignRev(_this, n) {
|
|
|
83
83
|
_this.skip(a * -1);
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
function goto(_this,
|
|
87
|
-
|
|
86
|
+
function goto(_this, bytes, bits) {
|
|
87
|
+
var new_size = (((bytes || 0)) + Math.ceil(((bits || 0)) / 8));
|
|
88
|
+
if (bits && bits < 0) {
|
|
89
|
+
new_size = Math.floor(((((bytes || 0)) * 8) + (bits || 0)) / 8);
|
|
90
|
+
}
|
|
88
91
|
if (new_size > _this.size) {
|
|
89
92
|
if (_this.strict == false) {
|
|
90
93
|
_this.extendArray(new_size - _this.size);
|
|
@@ -94,8 +97,15 @@ function goto(_this, byte, bit) {
|
|
|
94
97
|
throw new Error("\x1b[33m[Strict mode]\x1b[0m: Goto utside of range of data: goto " + new_size + " of " + _this.size);
|
|
95
98
|
}
|
|
96
99
|
}
|
|
97
|
-
_this.offset =
|
|
98
|
-
|
|
100
|
+
_this.offset = bytes;
|
|
101
|
+
// Adjust byte offset based on bit overflow
|
|
102
|
+
_this.offset += Math.floor(((bits || 0)) / 8);
|
|
103
|
+
// Adjust bit offset
|
|
104
|
+
_this.bitoffset = ((bits || 0) + 64) % 8;
|
|
105
|
+
// Ensure bit offset stays between 0-7
|
|
106
|
+
_this.bitoffset = Math.min(Math.max(_this.bitoffset, 0), 7);
|
|
107
|
+
// Ensure offset doesn't go negative
|
|
108
|
+
_this.offset = Math.max(_this.offset, 0);
|
|
99
109
|
}
|
|
100
110
|
function remove(_this, startOffset, endOffset, consume, remove, fillValue) {
|
|
101
111
|
const new_start = Math.abs(startOffset || 0);
|
|
@@ -1394,10 +1404,10 @@ function wstring(_this, string, options) {
|
|
|
1394
1404
|
/**
|
|
1395
1405
|
* Binary reader, includes bitfields and strings
|
|
1396
1406
|
*
|
|
1397
|
-
* @param {Buffer|Uint8Array} data -
|
|
1407
|
+
* @param {Buffer|Uint8Array} data - ``Buffer`` or ``Uint8Array``. Always found in ``biwriter.data``
|
|
1398
1408
|
* @param {number} byteOffset - Byte offset to start reader (default 0)
|
|
1399
1409
|
* @param {number} bitOffset - Bit offset 0-7 to start reader (default 0)
|
|
1400
|
-
* @param {string} endianness - Endianness
|
|
1410
|
+
* @param {string} endianness - Endianness ``big`` or ``little`` (default ``little``)
|
|
1401
1411
|
* @param {boolean} strict - Strict mode: if true does not extend supplied array on outside write (default true)
|
|
1402
1412
|
*/
|
|
1403
1413
|
class bireader {
|
|
@@ -1410,10 +1420,10 @@ class bireader {
|
|
|
1410
1420
|
/**
|
|
1411
1421
|
* Binary reader, includes bitfields and strings
|
|
1412
1422
|
*
|
|
1413
|
-
* @param {Buffer|Uint8Array} data -
|
|
1423
|
+
* @param {Buffer|Uint8Array} data - ``Buffer`` or ``Uint8Array``. Always found in ``biwriter.data``
|
|
1414
1424
|
* @param {number} byteOffset - Byte offset to start reader (default 0)
|
|
1415
1425
|
* @param {number} bitOffset - Bit offset 0-7 to start reader (default 0)
|
|
1416
|
-
* @param {string} endianness - Endianness
|
|
1426
|
+
* @param {string} endianness - Endianness ``big`` or ``little`` (default ``little``)
|
|
1417
1427
|
* @param {boolean} strict - Strict mode: if true does not extend supplied array on outside write (default true)
|
|
1418
1428
|
*/
|
|
1419
1429
|
constructor(data, byteOffset, bitOffset, endianness, strict) {
|
|
@@ -1467,7 +1477,7 @@ class bireader {
|
|
|
1467
1477
|
*
|
|
1468
1478
|
* Can be changed at any time, doesn't loose position
|
|
1469
1479
|
*
|
|
1470
|
-
* @param {string} endian - endianness
|
|
1480
|
+
* @param {string} endian - endianness ``big`` or ``little``
|
|
1471
1481
|
*/
|
|
1472
1482
|
endianness(endian) {
|
|
1473
1483
|
if (endian == undefined || typeof endian != "string") {
|
|
@@ -2094,7 +2104,7 @@ class bireader {
|
|
|
2094
2104
|
* @param {number} endOffset - End location (default end of data)
|
|
2095
2105
|
* @param {boolean} consume - Move position to end of lifted data (default false)
|
|
2096
2106
|
* @param {number} fillValue - Byte value to to fill returned data (does NOT fill unless supplied)
|
|
2097
|
-
* @returns {Buffer|Uint8Array} Selected data as
|
|
2107
|
+
* @returns {Buffer|Uint8Array} Selected data as ``Uint8Array`` or ``Buffer``
|
|
2098
2108
|
*/
|
|
2099
2109
|
lift(startOffset, endOffset, consume, fillValue) {
|
|
2100
2110
|
return remove(this, startOffset || this.offset, endOffset || this.size, consume || false, false, fillValue);
|
|
@@ -2106,7 +2116,7 @@ class bireader {
|
|
|
2106
2116
|
* @param {number} endOffset - End location (default end of data)
|
|
2107
2117
|
* @param {boolean} consume - Move position to end of lifted data (default false)
|
|
2108
2118
|
* @param {number} fillValue - Byte value to to fill returned data (does NOT fill unless supplied)
|
|
2109
|
-
* @returns {Buffer|Uint8Array} Selected data as
|
|
2119
|
+
* @returns {Buffer|Uint8Array} Selected data as ``Uint8Array`` or ``Buffer``
|
|
2110
2120
|
*/
|
|
2111
2121
|
fill(startOffset, endOffset, consume, fillValue) {
|
|
2112
2122
|
return remove(this, startOffset || this.offset, endOffset || this.size, consume || false, false, fillValue);
|
|
@@ -2117,7 +2127,7 @@ class bireader {
|
|
|
2117
2127
|
*
|
|
2118
2128
|
* @param {number} length - Length of data in bytes to copy from current offset
|
|
2119
2129
|
* @param {number} consume - Moves offset to end of length
|
|
2120
|
-
* @returns {Buffer|Uint8Array} Selected data as
|
|
2130
|
+
* @returns {Buffer|Uint8Array} Selected data as ``Uint8Array`` or ``Buffer``
|
|
2121
2131
|
*/
|
|
2122
2132
|
extract(length, consume) {
|
|
2123
2133
|
return remove(this, this.offset, this.offset + (length || 0), consume || false, false);
|
|
@@ -2128,7 +2138,7 @@ class bireader {
|
|
|
2128
2138
|
*
|
|
2129
2139
|
* @param {number} length - Length of data in bytes to copy from current offset
|
|
2130
2140
|
* @param {number} consume - Moves offset to end of length
|
|
2131
|
-
* @returns {Buffer|Uint8Array} Selected data as
|
|
2141
|
+
* @returns {Buffer|Uint8Array} Selected data as ``Uint8Array`` or ``Buffer``
|
|
2132
2142
|
*/
|
|
2133
2143
|
slice(length, consume) {
|
|
2134
2144
|
return remove(this, this.offset, this.offset + (length || 0), consume || false, false);
|
|
@@ -2139,7 +2149,7 @@ class bireader {
|
|
|
2139
2149
|
*
|
|
2140
2150
|
* @param {number} length - Length of data in bytes to copy from current offset
|
|
2141
2151
|
* @param {number} consume - Moves offset to end of length
|
|
2142
|
-
* @returns {Buffer|Uint8Array} Selected data as
|
|
2152
|
+
* @returns {Buffer|Uint8Array} Selected data as ``Uint8Array`` or ``Buffer``
|
|
2143
2153
|
*/
|
|
2144
2154
|
wrap(length, consume) {
|
|
2145
2155
|
return remove(this, this.offset, this.offset + (length || 0), consume || false, false);
|
|
@@ -2151,7 +2161,7 @@ class bireader {
|
|
|
2151
2161
|
* Inserts data into data
|
|
2152
2162
|
* Note: Must be same data type as supplied data. Errors on strict mode.
|
|
2153
2163
|
*
|
|
2154
|
-
* @param {Buffer|Uint8Array} data -
|
|
2164
|
+
* @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
2155
2165
|
* @param {boolean} consume - Move current byte position to end of data (default false)
|
|
2156
2166
|
* @param {number} offset - Byte position to add at (defaults to current position)
|
|
2157
2167
|
*/
|
|
@@ -2162,7 +2172,7 @@ class bireader {
|
|
|
2162
2172
|
* Inserts data into data
|
|
2163
2173
|
* Note: Must be same data type as supplied data. Errors on strict mode.
|
|
2164
2174
|
*
|
|
2165
|
-
* @param {Buffer|Uint8Array} data -
|
|
2175
|
+
* @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
2166
2176
|
* @param {boolean} consume - Move current byte position to end of data (default false)
|
|
2167
2177
|
* @param {number} offset - Byte position to add at (defaults to current position)
|
|
2168
2178
|
*/
|
|
@@ -2173,7 +2183,7 @@ class bireader {
|
|
|
2173
2183
|
* Replaces data in data
|
|
2174
2184
|
* Note: Must be same data type as supplied data. Errors on strict mode.
|
|
2175
2185
|
*
|
|
2176
|
-
* @param {Buffer|Uint8Array} data -
|
|
2186
|
+
* @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to replace in data
|
|
2177
2187
|
* @param {boolean} consume - Move current byte position to end of data (default false)
|
|
2178
2188
|
* @param {number} offset - Offset to add it at (defaults to current position)
|
|
2179
2189
|
*/
|
|
@@ -2184,7 +2194,7 @@ class bireader {
|
|
|
2184
2194
|
* Replaces data in data
|
|
2185
2195
|
* Note: Must be same data type as supplied data. Errors on strict mode.
|
|
2186
2196
|
*
|
|
2187
|
-
* @param {Buffer|Uint8Array} data -
|
|
2197
|
+
* @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to replace in data
|
|
2188
2198
|
* @param {boolean} consume - Move current byte position to end of data (default false)
|
|
2189
2199
|
* @param {number} offset - Offset to add it at (defaults to current position)
|
|
2190
2200
|
*/
|
|
@@ -2195,7 +2205,7 @@ class bireader {
|
|
|
2195
2205
|
* Adds data to start of supplied data
|
|
2196
2206
|
* Note: Must be same data type as supplied data. Errors on strict mode.
|
|
2197
2207
|
*
|
|
2198
|
-
* @param {Buffer|Uint8Array} data -
|
|
2208
|
+
* @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
2199
2209
|
* @param {boolean} consume - Move current write position to end of data (default false)
|
|
2200
2210
|
*/
|
|
2201
2211
|
unshift(data, consume) {
|
|
@@ -2205,7 +2215,7 @@ class bireader {
|
|
|
2205
2215
|
* Adds data to start of supplied data
|
|
2206
2216
|
* Note: Must be same data type as supplied data. Errors on strict mode.
|
|
2207
2217
|
*
|
|
2208
|
-
* @param {Buffer|Uint8Array} data -
|
|
2218
|
+
* @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
2209
2219
|
* @param {boolean} consume - Move current write position to end of data (default false)
|
|
2210
2220
|
*/
|
|
2211
2221
|
prepend(data, consume) {
|
|
@@ -2215,7 +2225,7 @@ class bireader {
|
|
|
2215
2225
|
* Adds data to end of supplied data
|
|
2216
2226
|
* Note: Must be same data type as supplied data. Errors on strict mode.
|
|
2217
2227
|
*
|
|
2218
|
-
* @param {Buffer|Uint8Array} data -
|
|
2228
|
+
* @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
2219
2229
|
* @param {boolean} consume - Move current write position to end of data (default false)
|
|
2220
2230
|
*/
|
|
2221
2231
|
push(data, consume) {
|
|
@@ -2225,7 +2235,7 @@ class bireader {
|
|
|
2225
2235
|
* Adds data to end of supplied data
|
|
2226
2236
|
* Note: Must be same data type as supplied data. Errors on strict mode.
|
|
2227
2237
|
*
|
|
2228
|
-
* @param {Buffer|Uint8Array} data -
|
|
2238
|
+
* @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
2229
2239
|
* @param {boolean} consume - Move current write position to end of data (default false)
|
|
2230
2240
|
*/
|
|
2231
2241
|
append(data, consume) {
|
|
@@ -2325,7 +2335,7 @@ class bireader {
|
|
|
2325
2335
|
*
|
|
2326
2336
|
* @param {number} bits - bits to read
|
|
2327
2337
|
* @param {boolean} unsigned - if the value is unsigned
|
|
2328
|
-
* @param {string} endian - ``big`` or ``little
|
|
2338
|
+
* @param {string} endian - ``big`` or ``little``
|
|
2329
2339
|
* @returns number
|
|
2330
2340
|
*/
|
|
2331
2341
|
readBit(bits, unsigned, endian) {
|
|
@@ -2338,7 +2348,7 @@ class bireader {
|
|
|
2338
2348
|
*
|
|
2339
2349
|
* @param {number} bits - bits to read
|
|
2340
2350
|
* @param {boolean} unsigned - if the value is unsigned
|
|
2341
|
-
* @param {string} endian - ``big`` or ``little
|
|
2351
|
+
* @param {string} endian - ``big`` or ``little``
|
|
2342
2352
|
* @returns number
|
|
2343
2353
|
*/
|
|
2344
2354
|
bit(bits, unsigned, endian) {
|
|
@@ -2350,7 +2360,7 @@ class bireader {
|
|
|
2350
2360
|
* Note: When returning to a byte read, remaining bits are dropped
|
|
2351
2361
|
*
|
|
2352
2362
|
* @param {number} bits - bits to read
|
|
2353
|
-
* @param {string} endian - ``big`` or ``little
|
|
2363
|
+
* @param {string} endian - ``big`` or ``little``
|
|
2354
2364
|
* @returns number
|
|
2355
2365
|
*/
|
|
2356
2366
|
ubit(bits, endian) {
|
|
@@ -2362,7 +2372,7 @@ class bireader {
|
|
|
2362
2372
|
* Note: When returning to a byte read, remaining bits are dropped
|
|
2363
2373
|
*
|
|
2364
2374
|
* @param {boolean} unsigned - if the value is unsigned
|
|
2365
|
-
* @param {string} endian - ``big`` or ``little
|
|
2375
|
+
* @param {string} endian - ``big`` or ``little``
|
|
2366
2376
|
* @returns number
|
|
2367
2377
|
*/
|
|
2368
2378
|
bit1(unsigned, endian) {
|
|
@@ -4543,7 +4553,7 @@ class bireader {
|
|
|
4543
4553
|
* Read short
|
|
4544
4554
|
*
|
|
4545
4555
|
* @param {boolean} unsigned - if value is unsigned or not
|
|
4546
|
-
* @param {string} endian -
|
|
4556
|
+
* @param {string} endian - ``big`` or ``little``
|
|
4547
4557
|
* @returns number
|
|
4548
4558
|
*/
|
|
4549
4559
|
readInt16(unsigned, endian) {
|
|
@@ -4554,7 +4564,7 @@ class bireader {
|
|
|
4554
4564
|
*
|
|
4555
4565
|
* @param {number} value - value as int
|
|
4556
4566
|
* @param {boolean} unsigned - if the value is unsigned
|
|
4557
|
-
* @param {string} endian - ``big`` or ``little
|
|
4567
|
+
* @param {string} endian - ``big`` or ``little``
|
|
4558
4568
|
*/
|
|
4559
4569
|
writeInt16(value, unsigned, endian) {
|
|
4560
4570
|
return wint16(this, value, unsigned, endian);
|
|
@@ -4563,7 +4573,7 @@ class bireader {
|
|
|
4563
4573
|
* Write unsigned int16
|
|
4564
4574
|
*
|
|
4565
4575
|
* @param {number} value - value as int
|
|
4566
|
-
* @param {string} endian - ``big`` or ``little
|
|
4576
|
+
* @param {string} endian - ``big`` or ``little``
|
|
4567
4577
|
*/
|
|
4568
4578
|
writeUInt16(value, endian) {
|
|
4569
4579
|
return wint16(this, value, true, endian);
|
|
@@ -4572,7 +4582,7 @@ class bireader {
|
|
|
4572
4582
|
* Read short
|
|
4573
4583
|
*
|
|
4574
4584
|
* @param {boolean} unsigned - if value is unsigned or not
|
|
4575
|
-
* @param {string} endian -
|
|
4585
|
+
* @param {string} endian - ``big`` or ``little``
|
|
4576
4586
|
* @returns number
|
|
4577
4587
|
*/
|
|
4578
4588
|
int16(unsigned, endian) {
|
|
@@ -4582,7 +4592,7 @@ class bireader {
|
|
|
4582
4592
|
* Read short
|
|
4583
4593
|
*
|
|
4584
4594
|
* @param {boolean} unsigned - if value is unsigned or not
|
|
4585
|
-
* @param {string} endian -
|
|
4595
|
+
* @param {string} endian - ``big`` or ``little``
|
|
4586
4596
|
* @returns number
|
|
4587
4597
|
*/
|
|
4588
4598
|
short(unsigned, endian) {
|
|
@@ -4592,7 +4602,7 @@ class bireader {
|
|
|
4592
4602
|
* Read short
|
|
4593
4603
|
*
|
|
4594
4604
|
* @param {boolean} unsigned - if value is unsigned or not
|
|
4595
|
-
* @param {string} endian -
|
|
4605
|
+
* @param {string} endian - ``big`` or ``little``
|
|
4596
4606
|
* @returns number
|
|
4597
4607
|
*/
|
|
4598
4608
|
word(unsigned, endian) {
|
|
@@ -4601,7 +4611,7 @@ class bireader {
|
|
|
4601
4611
|
/**
|
|
4602
4612
|
* Read unsigned short
|
|
4603
4613
|
*
|
|
4604
|
-
* @param {string} endian -
|
|
4614
|
+
* @param {string} endian - ``big`` or ``little``
|
|
4605
4615
|
*
|
|
4606
4616
|
* @returns number
|
|
4607
4617
|
*/
|
|
@@ -4611,7 +4621,7 @@ class bireader {
|
|
|
4611
4621
|
/**
|
|
4612
4622
|
* Read unsigned short
|
|
4613
4623
|
*
|
|
4614
|
-
* @param {string} endian -
|
|
4624
|
+
* @param {string} endian - ``big`` or ``little``
|
|
4615
4625
|
*
|
|
4616
4626
|
* @returns number
|
|
4617
4627
|
*/
|
|
@@ -4621,7 +4631,7 @@ class bireader {
|
|
|
4621
4631
|
/**
|
|
4622
4632
|
* Read unsigned short
|
|
4623
4633
|
*
|
|
4624
|
-
* @param {string} endian -
|
|
4634
|
+
* @param {string} endian - ``big`` or ``little``
|
|
4625
4635
|
*
|
|
4626
4636
|
* @returns number
|
|
4627
4637
|
*/
|
|
@@ -4631,7 +4641,7 @@ class bireader {
|
|
|
4631
4641
|
/**
|
|
4632
4642
|
* Read unsigned short
|
|
4633
4643
|
*
|
|
4634
|
-
* @param {string} endian -
|
|
4644
|
+
* @param {string} endian - ``big`` or ``little``
|
|
4635
4645
|
*
|
|
4636
4646
|
* @returns number
|
|
4637
4647
|
*/
|
|
@@ -4772,7 +4782,7 @@ class bireader {
|
|
|
4772
4782
|
/**
|
|
4773
4783
|
* Read half float
|
|
4774
4784
|
*
|
|
4775
|
-
* @param {string} endian -
|
|
4785
|
+
* @param {string} endian - ``big`` or ``little``
|
|
4776
4786
|
* @returns number
|
|
4777
4787
|
*/
|
|
4778
4788
|
readHalfFloat(endian) {
|
|
@@ -4782,7 +4792,7 @@ class bireader {
|
|
|
4782
4792
|
* Writes half float
|
|
4783
4793
|
*
|
|
4784
4794
|
* @param {number} value - value as int
|
|
4785
|
-
* @param {string} endian - ``big`` or ``little
|
|
4795
|
+
* @param {string} endian - ``big`` or ``little``
|
|
4786
4796
|
*/
|
|
4787
4797
|
writeHalfFloat(value, endian) {
|
|
4788
4798
|
return whalffloat(this, value, endian);
|
|
@@ -4790,7 +4800,7 @@ class bireader {
|
|
|
4790
4800
|
/**
|
|
4791
4801
|
* Read half float
|
|
4792
4802
|
*
|
|
4793
|
-
* @param {string} endian -
|
|
4803
|
+
* @param {string} endian - ``big`` or ``little``
|
|
4794
4804
|
* @returns number
|
|
4795
4805
|
*/
|
|
4796
4806
|
halffloat(endian) {
|
|
@@ -4799,7 +4809,7 @@ class bireader {
|
|
|
4799
4809
|
/**
|
|
4800
4810
|
* Read half float
|
|
4801
4811
|
*
|
|
4802
|
-
* @param {string} endian -
|
|
4812
|
+
* @param {string} endian - ``big`` or ``little``
|
|
4803
4813
|
* @returns number
|
|
4804
4814
|
*/
|
|
4805
4815
|
half(endian) {
|
|
@@ -4860,7 +4870,7 @@ class bireader {
|
|
|
4860
4870
|
* Read 32 bit integer
|
|
4861
4871
|
*
|
|
4862
4872
|
* @param {boolean} unsigned - if value is unsigned or not
|
|
4863
|
-
* @param {string} endian -
|
|
4873
|
+
* @param {string} endian - ``big`` or ``little``
|
|
4864
4874
|
* @returns number
|
|
4865
4875
|
*/
|
|
4866
4876
|
readInt32(unsigned, endian) {
|
|
@@ -4871,7 +4881,7 @@ class bireader {
|
|
|
4871
4881
|
*
|
|
4872
4882
|
* @param {number} value - value as int
|
|
4873
4883
|
* @param {boolean} unsigned - if the value is unsigned
|
|
4874
|
-
* @param {string} endian - ``big`` or ``little
|
|
4884
|
+
* @param {string} endian - ``big`` or ``little``
|
|
4875
4885
|
*/
|
|
4876
4886
|
writeInt32(value, unsigned, endian) {
|
|
4877
4887
|
return wint32(this, value, unsigned, endian);
|
|
@@ -4889,7 +4899,7 @@ class bireader {
|
|
|
4889
4899
|
* Read 32 bit integer
|
|
4890
4900
|
*
|
|
4891
4901
|
* @param {boolean} unsigned - if value is unsigned or not
|
|
4892
|
-
* @param {string} endian -
|
|
4902
|
+
* @param {string} endian - ``big`` or ``little``
|
|
4893
4903
|
* @returns number
|
|
4894
4904
|
*/
|
|
4895
4905
|
int(unsigned, endian) {
|
|
@@ -4899,7 +4909,7 @@ class bireader {
|
|
|
4899
4909
|
* Read 32 bit integer
|
|
4900
4910
|
*
|
|
4901
4911
|
* @param {boolean} unsigned - if value is unsigned or not
|
|
4902
|
-
* @param {string} endian -
|
|
4912
|
+
* @param {string} endian - ``big`` or ``little``
|
|
4903
4913
|
* @returns number
|
|
4904
4914
|
*/
|
|
4905
4915
|
double(unsigned, endian) {
|
|
@@ -4909,7 +4919,7 @@ class bireader {
|
|
|
4909
4919
|
* Read 32 bit integer
|
|
4910
4920
|
*
|
|
4911
4921
|
* @param {boolean} unsigned - if value is unsigned or not
|
|
4912
|
-
* @param {string} endian -
|
|
4922
|
+
* @param {string} endian - ``big`` or ``little``
|
|
4913
4923
|
* @returns number
|
|
4914
4924
|
*/
|
|
4915
4925
|
int32(unsigned, endian) {
|
|
@@ -4919,7 +4929,7 @@ class bireader {
|
|
|
4919
4929
|
* Read 32 bit integer
|
|
4920
4930
|
*
|
|
4921
4931
|
* @param {boolean} unsigned - if value is unsigned or not
|
|
4922
|
-
* @param {string} endian -
|
|
4932
|
+
* @param {string} endian - ``big`` or ``little``
|
|
4923
4933
|
* @returns number
|
|
4924
4934
|
*/
|
|
4925
4935
|
long(unsigned, endian) {
|
|
@@ -5131,25 +5141,25 @@ class bireader {
|
|
|
5131
5141
|
/**
|
|
5132
5142
|
* Read float
|
|
5133
5143
|
*
|
|
5134
|
-
* @param {string} endian -
|
|
5144
|
+
* @param {string} endian - ``big`` or ``little``
|
|
5135
5145
|
* @returns number
|
|
5136
5146
|
*/
|
|
5137
5147
|
readFloat(endian) {
|
|
5138
5148
|
return rfloat(this, endian);
|
|
5139
5149
|
}
|
|
5140
5150
|
/**
|
|
5141
|
-
|
|
5142
|
-
|
|
5143
|
-
|
|
5144
|
-
|
|
5145
|
-
|
|
5151
|
+
* Write float
|
|
5152
|
+
*
|
|
5153
|
+
* @param {number} value - value as int
|
|
5154
|
+
* @param {string} endian - ``big`` or ``little``
|
|
5155
|
+
*/
|
|
5146
5156
|
writeFloat(value, endian) {
|
|
5147
5157
|
return wfloat(this, value, endian);
|
|
5148
5158
|
}
|
|
5149
5159
|
/**
|
|
5150
5160
|
* Read float
|
|
5151
5161
|
*
|
|
5152
|
-
* @param {string} endian -
|
|
5162
|
+
* @param {string} endian - ``big`` or ``little``
|
|
5153
5163
|
* @returns number
|
|
5154
5164
|
*/
|
|
5155
5165
|
float(endian) {
|
|
@@ -5193,7 +5203,7 @@ class bireader {
|
|
|
5193
5203
|
/**
|
|
5194
5204
|
* Read signed 64 bit integer
|
|
5195
5205
|
* @param {boolean} unsigned - if value is unsigned or not
|
|
5196
|
-
* @param {string} endian -
|
|
5206
|
+
* @param {string} endian - ``big`` or ``little``
|
|
5197
5207
|
* @returns number
|
|
5198
5208
|
*/
|
|
5199
5209
|
readInt64(unsigned, endian) {
|
|
@@ -5204,7 +5214,7 @@ class bireader {
|
|
|
5204
5214
|
*
|
|
5205
5215
|
* @param {number} value - value as int
|
|
5206
5216
|
* @param {boolean} unsigned - if the value is unsigned
|
|
5207
|
-
* @param {string} endian - ``big`` or ``little
|
|
5217
|
+
* @param {string} endian - ``big`` or ``little``
|
|
5208
5218
|
*/
|
|
5209
5219
|
writeInt64(value, unsigned, endian) {
|
|
5210
5220
|
return wint64(this, value, unsigned, endian);
|
|
@@ -5212,7 +5222,7 @@ class bireader {
|
|
|
5212
5222
|
/**
|
|
5213
5223
|
* Read signed 64 bit integer
|
|
5214
5224
|
* @param {boolean} unsigned - if value is unsigned or not
|
|
5215
|
-
* @param {string} endian -
|
|
5225
|
+
* @param {string} endian - ``big`` or ``little``
|
|
5216
5226
|
* @returns number
|
|
5217
5227
|
*/
|
|
5218
5228
|
int64(unsigned, endian) {
|
|
@@ -5221,7 +5231,7 @@ class bireader {
|
|
|
5221
5231
|
/**
|
|
5222
5232
|
* Read signed 64 bit integer
|
|
5223
5233
|
* @param {boolean} unsigned - if value is unsigned or not
|
|
5224
|
-
* @param {string} endian -
|
|
5234
|
+
* @param {string} endian - ``big`` or ``little``
|
|
5225
5235
|
* @returns number
|
|
5226
5236
|
*/
|
|
5227
5237
|
bigint(unsigned, endian) {
|
|
@@ -5230,7 +5240,7 @@ class bireader {
|
|
|
5230
5240
|
/**
|
|
5231
5241
|
* Read signed 64 bit integer
|
|
5232
5242
|
* @param {boolean} unsigned - if value is unsigned or not
|
|
5233
|
-
* @param {string} endian -
|
|
5243
|
+
* @param {string} endian - ``big`` or ``little``
|
|
5234
5244
|
* @returns number
|
|
5235
5245
|
*/
|
|
5236
5246
|
quad(unsigned, endian) {
|
|
@@ -5402,7 +5412,7 @@ class bireader {
|
|
|
5402
5412
|
/**
|
|
5403
5413
|
* Read double float
|
|
5404
5414
|
*
|
|
5405
|
-
* @param {string} endian -
|
|
5415
|
+
* @param {string} endian - ``big`` or ``little``
|
|
5406
5416
|
* @returns number
|
|
5407
5417
|
*/
|
|
5408
5418
|
readDoubleFloat(endian) {
|
|
@@ -5413,7 +5423,7 @@ class bireader {
|
|
|
5413
5423
|
*
|
|
5414
5424
|
* @param {number} value - value as int
|
|
5415
5425
|
* @param {number} offset - byte offset (default last write position)
|
|
5416
|
-
* @param {string} endian - ``big`` or ``little
|
|
5426
|
+
* @param {string} endian - ``big`` or ``little``
|
|
5417
5427
|
*/
|
|
5418
5428
|
writeDoubleFloat(value, endian) {
|
|
5419
5429
|
return wdfloat(this, value, endian);
|
|
@@ -5421,7 +5431,7 @@ class bireader {
|
|
|
5421
5431
|
/**
|
|
5422
5432
|
* Read double float
|
|
5423
5433
|
*
|
|
5424
|
-
* @param {string} endian -
|
|
5434
|
+
* @param {string} endian - ``big`` or ``little``
|
|
5425
5435
|
* @returns number
|
|
5426
5436
|
*/
|
|
5427
5437
|
doublefloat(endian) {
|
|
@@ -5430,7 +5440,7 @@ class bireader {
|
|
|
5430
5440
|
/**
|
|
5431
5441
|
* Read double float
|
|
5432
5442
|
*
|
|
5433
|
-
* @param {string} endian -
|
|
5443
|
+
* @param {string} endian - ``big`` or ``little``
|
|
5434
5444
|
* @returns number
|
|
5435
5445
|
*/
|
|
5436
5446
|
dfloat(endian) {
|
|
@@ -5924,7 +5934,7 @@ class biwriter {
|
|
|
5924
5934
|
*
|
|
5925
5935
|
* Can be changed at any time, doesn't loose position
|
|
5926
5936
|
*
|
|
5927
|
-
* @param {string} endian - Endianness
|
|
5937
|
+
* @param {string} endian - Endianness ``big`` or ``little``
|
|
5928
5938
|
*/
|
|
5929
5939
|
endianness(endian) {
|
|
5930
5940
|
if (endian == undefined || typeof endian != "string") {
|
|
@@ -6558,7 +6568,7 @@ class biwriter {
|
|
|
6558
6568
|
* @param {number} endOffset - End location (default end of data)
|
|
6559
6569
|
* @param {boolean} consume - Move position to end of lifted data (default false)
|
|
6560
6570
|
* @param {number} fillValue - Byte value to to fill returned data (does NOT fill unless supplied)
|
|
6561
|
-
* @returns {Buffer|Uint8Array} Selected data as
|
|
6571
|
+
* @returns {Buffer|Uint8Array} Selected data as ``Uint8Array`` or ``Buffer``
|
|
6562
6572
|
*/
|
|
6563
6573
|
lift(startOffset, endOffset, consume, fillValue) {
|
|
6564
6574
|
return remove(this, startOffset || this.offset, endOffset || this.size, consume || false, false, fillValue);
|
|
@@ -6570,7 +6580,7 @@ class biwriter {
|
|
|
6570
6580
|
* @param {number} endOffset - End location (default end of data)
|
|
6571
6581
|
* @param {boolean} consume - Move position to end of lifted data (default false)
|
|
6572
6582
|
* @param {number} fillValue - Byte value to to fill returned data (does NOT fill unless supplied)
|
|
6573
|
-
* @returns {Buffer|Uint8Array} Selected data as
|
|
6583
|
+
* @returns {Buffer|Uint8Array} Selected data as ``Uint8Array`` or ``Buffer``
|
|
6574
6584
|
*/
|
|
6575
6585
|
fill(startOffset, endOffset, consume, fillValue) {
|
|
6576
6586
|
return remove(this, startOffset || this.offset, endOffset || this.size, consume || false, false, fillValue);
|
|
@@ -6581,7 +6591,7 @@ class biwriter {
|
|
|
6581
6591
|
*
|
|
6582
6592
|
* @param {number} length - Length of data in bytes to copy from current offset
|
|
6583
6593
|
* @param {number} consume - Moves offset to end of length
|
|
6584
|
-
* @returns {Buffer|Uint8Array} Selected data as
|
|
6594
|
+
* @returns {Buffer|Uint8Array} Selected data as ``Uint8Array`` or ``Buffer``
|
|
6585
6595
|
*/
|
|
6586
6596
|
extract(length, consume) {
|
|
6587
6597
|
return remove(this, this.offset, this.offset + (length || 0), consume || false, false);
|
|
@@ -6592,7 +6602,7 @@ class biwriter {
|
|
|
6592
6602
|
*
|
|
6593
6603
|
* @param {number} length - Length of data in bytes to copy from current offset
|
|
6594
6604
|
* @param {number} consume - Moves offset to end of length
|
|
6595
|
-
* @returns {Buffer|Uint8Array} Selected data as
|
|
6605
|
+
* @returns {Buffer|Uint8Array} Selected data as ``Uint8Array`` or ``Buffer``
|
|
6596
6606
|
*/
|
|
6597
6607
|
slice(length, consume) {
|
|
6598
6608
|
return remove(this, this.offset, this.offset + (length || 0), consume || false, false);
|
|
@@ -6603,7 +6613,7 @@ class biwriter {
|
|
|
6603
6613
|
*
|
|
6604
6614
|
* @param {number} length - Length of data in bytes to copy from current offset
|
|
6605
6615
|
* @param {number} consume - Moves offset to end of length
|
|
6606
|
-
* @returns {Buffer|Uint8Array} Selected data as
|
|
6616
|
+
* @returns {Buffer|Uint8Array} Selected data as ``Uint8Array`` or ``Buffer``
|
|
6607
6617
|
*/
|
|
6608
6618
|
wrap(length, consume) {
|
|
6609
6619
|
return remove(this, this.offset, this.offset + (length || 0), consume || false, false);
|
|
@@ -6615,7 +6625,7 @@ class biwriter {
|
|
|
6615
6625
|
* Inserts data into data
|
|
6616
6626
|
* Note: Must be same data type as supplied data. Errors on strict mode.
|
|
6617
6627
|
*
|
|
6618
|
-
* @param {Buffer|Uint8Array} data -
|
|
6628
|
+
* @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
6619
6629
|
* @param {boolean} consume - Move current byte position to end of data (default false)
|
|
6620
6630
|
* @param {number} offset - Byte position to add at (defaults to current position)
|
|
6621
6631
|
*/
|
|
@@ -6626,7 +6636,7 @@ class biwriter {
|
|
|
6626
6636
|
* Inserts data into data
|
|
6627
6637
|
* Note: Must be same data type as supplied data. Errors on strict mode.
|
|
6628
6638
|
*
|
|
6629
|
-
* @param {Buffer|Uint8Array} data -
|
|
6639
|
+
* @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
6630
6640
|
* @param {boolean} consume - Move current byte position to end of data (default false)
|
|
6631
6641
|
* @param {number} offset - Byte position to add at (defaults to current position)
|
|
6632
6642
|
*/
|
|
@@ -6637,7 +6647,7 @@ class biwriter {
|
|
|
6637
6647
|
* Replaces data in data
|
|
6638
6648
|
* Note: Must be same data type as supplied data. Errors on strict mode.
|
|
6639
6649
|
*
|
|
6640
|
-
* @param {Buffer|Uint8Array} data -
|
|
6650
|
+
* @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to replace in data
|
|
6641
6651
|
* @param {boolean} consume - Move current byte position to end of data (default false)
|
|
6642
6652
|
* @param {number} offset - Offset to add it at (defaults to current position)
|
|
6643
6653
|
*/
|
|
@@ -6648,7 +6658,7 @@ class biwriter {
|
|
|
6648
6658
|
* Replaces data in data
|
|
6649
6659
|
* Note: Must be same data type as supplied data. Errors on strict mode.
|
|
6650
6660
|
*
|
|
6651
|
-
* @param {Buffer|Uint8Array} data -
|
|
6661
|
+
* @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to replace in data
|
|
6652
6662
|
* @param {boolean} consume - Move current byte position to end of data (default false)
|
|
6653
6663
|
* @param {number} offset - Offset to add it at (defaults to current position)
|
|
6654
6664
|
*/
|
|
@@ -6659,7 +6669,7 @@ class biwriter {
|
|
|
6659
6669
|
* Adds data to start of supplied data
|
|
6660
6670
|
* Note: Must be same data type as supplied data. Errors on strict mode.
|
|
6661
6671
|
*
|
|
6662
|
-
* @param {Buffer|Uint8Array} data -
|
|
6672
|
+
* @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
6663
6673
|
* @param {boolean} consume - Move current write position to end of data (default false)
|
|
6664
6674
|
*/
|
|
6665
6675
|
unshift(data, consume) {
|
|
@@ -6669,7 +6679,7 @@ class biwriter {
|
|
|
6669
6679
|
* Adds data to start of supplied data
|
|
6670
6680
|
* Note: Must be same data type as supplied data. Errors on strict mode.
|
|
6671
6681
|
*
|
|
6672
|
-
* @param {Buffer|Uint8Array} data -
|
|
6682
|
+
* @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
6673
6683
|
* @param {boolean} consume - Move current write position to end of data (default false)
|
|
6674
6684
|
*/
|
|
6675
6685
|
prepend(data, consume) {
|
|
@@ -6679,7 +6689,7 @@ class biwriter {
|
|
|
6679
6689
|
* Adds data to end of supplied data
|
|
6680
6690
|
* Note: Must be same data type as supplied data. Errors on strict mode.
|
|
6681
6691
|
*
|
|
6682
|
-
* @param {Buffer|Uint8Array} data -
|
|
6692
|
+
* @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
6683
6693
|
* @param {boolean} consume - Move current write position to end of data (default false)
|
|
6684
6694
|
*/
|
|
6685
6695
|
push(data, consume) {
|
|
@@ -6689,7 +6699,7 @@ class biwriter {
|
|
|
6689
6699
|
* Adds data to end of supplied data
|
|
6690
6700
|
* Note: Must be same data type as supplied data. Errors on strict mode.
|
|
6691
6701
|
*
|
|
6692
|
-
* @param {Buffer|Uint8Array} data -
|
|
6702
|
+
* @param {Buffer|Uint8Array} data - ``Uint8Array`` or ``Buffer`` to add to data
|
|
6693
6703
|
* @param {boolean} consume - Move current write position to end of data (default false)
|
|
6694
6704
|
*/
|
|
6695
6705
|
append(data, consume) {
|
|
@@ -6789,7 +6799,7 @@ class biwriter {
|
|
|
6789
6799
|
*
|
|
6790
6800
|
* @param {number} bits - bits to read
|
|
6791
6801
|
* @param {boolean} unsigned - if the value is unsigned
|
|
6792
|
-
* @param {string} endian - ``big`` or ``little
|
|
6802
|
+
* @param {string} endian - ``big`` or ``little``
|
|
6793
6803
|
* @returns number
|
|
6794
6804
|
*/
|
|
6795
6805
|
readBit(bits, unsigned, endian) {
|
|
@@ -6803,7 +6813,7 @@ class biwriter {
|
|
|
6803
6813
|
* @param {number} value - value as int
|
|
6804
6814
|
* @param {number} bits - bits to write
|
|
6805
6815
|
* @param {boolean} unsigned - if the value is unsigned
|
|
6806
|
-
* @param {string} endian - ``big`` or ``little
|
|
6816
|
+
* @param {string} endian - ``big`` or ``little``
|
|
6807
6817
|
* @returns number
|
|
6808
6818
|
*/
|
|
6809
6819
|
bit(value, bits, unsigned, endian) {
|
|
@@ -6816,7 +6826,7 @@ class biwriter {
|
|
|
6816
6826
|
*
|
|
6817
6827
|
* @param {number} value - value as int
|
|
6818
6828
|
* @param {number} bits - bits to write
|
|
6819
|
-
* @param {string} endian - ``big`` or ``little
|
|
6829
|
+
* @param {string} endian - ``big`` or ``little``
|
|
6820
6830
|
* @returns number
|
|
6821
6831
|
*/
|
|
6822
6832
|
ubit(value, bits, endian) {
|
|
@@ -6929,7 +6939,7 @@ class biwriter {
|
|
|
6929
6939
|
*
|
|
6930
6940
|
* @param {number} value - value as int
|
|
6931
6941
|
* @param {boolean} unsigned - if the value is unsigned
|
|
6932
|
-
* @param {string} endian - ``big`` or ``little
|
|
6942
|
+
* @param {string} endian - ``big`` or ``little``
|
|
6933
6943
|
* @returns number
|
|
6934
6944
|
*/
|
|
6935
6945
|
bit1(value, unsigned, endian) {
|
|
@@ -6965,7 +6975,7 @@ class biwriter {
|
|
|
6965
6975
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
6966
6976
|
*
|
|
6967
6977
|
* @param {number} value - value as int
|
|
6968
|
-
* @param {string} endian - ``big`` or ``little
|
|
6978
|
+
* @param {string} endian - ``big`` or ``little``
|
|
6969
6979
|
* @returns number
|
|
6970
6980
|
*/
|
|
6971
6981
|
ubit1(value, endian) {
|
|
@@ -7000,7 +7010,7 @@ class biwriter {
|
|
|
7000
7010
|
*
|
|
7001
7011
|
* @param {number} value - value as int
|
|
7002
7012
|
* @param {boolean} unsigned - if the value is unsigned
|
|
7003
|
-
* @param {string} endian - ``big`` or ``little
|
|
7013
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7004
7014
|
* @returns number
|
|
7005
7015
|
*/
|
|
7006
7016
|
bit2(value, unsigned, endian) {
|
|
@@ -7036,7 +7046,7 @@ class biwriter {
|
|
|
7036
7046
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
7037
7047
|
*
|
|
7038
7048
|
* @param {number} value - value as int
|
|
7039
|
-
* @param {string} endian - ``big`` or ``little
|
|
7049
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7040
7050
|
* @returns number
|
|
7041
7051
|
*/
|
|
7042
7052
|
ubit2(value, endian) {
|
|
@@ -7071,7 +7081,7 @@ class biwriter {
|
|
|
7071
7081
|
*
|
|
7072
7082
|
* @param {number} value - value as int
|
|
7073
7083
|
* @param {boolean} unsigned - if the value is unsigned
|
|
7074
|
-
* @param {string} endian - ``big`` or ``little
|
|
7084
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7075
7085
|
* @returns number
|
|
7076
7086
|
*/
|
|
7077
7087
|
bit3(value, unsigned, endian) {
|
|
@@ -7107,7 +7117,7 @@ class biwriter {
|
|
|
7107
7117
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
7108
7118
|
*
|
|
7109
7119
|
* @param {number} value - value as int
|
|
7110
|
-
* @param {string} endian - ``big`` or ``little
|
|
7120
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7111
7121
|
* @returns number
|
|
7112
7122
|
*/
|
|
7113
7123
|
ubit3(value, endian) {
|
|
@@ -7142,7 +7152,7 @@ class biwriter {
|
|
|
7142
7152
|
*
|
|
7143
7153
|
* @param {number} value - value as int
|
|
7144
7154
|
* @param {boolean} unsigned - if the value is unsigned
|
|
7145
|
-
* @param {string} endian - ``big`` or ``little
|
|
7155
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7146
7156
|
* @returns number
|
|
7147
7157
|
*/
|
|
7148
7158
|
bit4(value, unsigned, endian) {
|
|
@@ -7178,7 +7188,7 @@ class biwriter {
|
|
|
7178
7188
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
7179
7189
|
*
|
|
7180
7190
|
* @param {number} value - value as int
|
|
7181
|
-
* @param {string} endian - ``big`` or ``little
|
|
7191
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7182
7192
|
* @returns number
|
|
7183
7193
|
*/
|
|
7184
7194
|
ubit4(value, endian) {
|
|
@@ -7213,7 +7223,7 @@ class biwriter {
|
|
|
7213
7223
|
*
|
|
7214
7224
|
* @param {number} value - value as int
|
|
7215
7225
|
* @param {boolean} unsigned - if the value is unsigned
|
|
7216
|
-
* @param {string} endian - ``big`` or ``little
|
|
7226
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7217
7227
|
* @returns number
|
|
7218
7228
|
*/
|
|
7219
7229
|
bit5(value, unsigned, endian) {
|
|
@@ -7249,7 +7259,7 @@ class biwriter {
|
|
|
7249
7259
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
7250
7260
|
*
|
|
7251
7261
|
* @param {number} value - value as int
|
|
7252
|
-
* @param {string} endian - ``big`` or ``little
|
|
7262
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7253
7263
|
* @returns number
|
|
7254
7264
|
*/
|
|
7255
7265
|
ubit5(value, endian) {
|
|
@@ -7284,7 +7294,7 @@ class biwriter {
|
|
|
7284
7294
|
*
|
|
7285
7295
|
* @param {number} value - value as int
|
|
7286
7296
|
* @param {boolean} unsigned - if the value is unsigned
|
|
7287
|
-
* @param {string} endian - ``big`` or ``little
|
|
7297
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7288
7298
|
* @returns number
|
|
7289
7299
|
*/
|
|
7290
7300
|
bit6(value, unsigned, endian) {
|
|
@@ -7320,7 +7330,7 @@ class biwriter {
|
|
|
7320
7330
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
7321
7331
|
*
|
|
7322
7332
|
* @param {number} value - value as int
|
|
7323
|
-
* @param {string} endian - ``big`` or ``little
|
|
7333
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7324
7334
|
* @returns number
|
|
7325
7335
|
*/
|
|
7326
7336
|
ubit6(value, endian) {
|
|
@@ -7355,7 +7365,7 @@ class biwriter {
|
|
|
7355
7365
|
*
|
|
7356
7366
|
* @param {number} value - value as int
|
|
7357
7367
|
* @param {boolean} unsigned - if the value is unsigned
|
|
7358
|
-
* @param {string} endian - ``big`` or ``little
|
|
7368
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7359
7369
|
* @returns number
|
|
7360
7370
|
*/
|
|
7361
7371
|
bit7(value, unsigned, endian) {
|
|
@@ -7391,7 +7401,7 @@ class biwriter {
|
|
|
7391
7401
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
7392
7402
|
*
|
|
7393
7403
|
* @param {number} value - value as int
|
|
7394
|
-
* @param {string} endian - ``big`` or ``little
|
|
7404
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7395
7405
|
* @returns number
|
|
7396
7406
|
*/
|
|
7397
7407
|
ubit7(value, endian) {
|
|
@@ -7426,7 +7436,7 @@ class biwriter {
|
|
|
7426
7436
|
*
|
|
7427
7437
|
* @param {number} value - value as int
|
|
7428
7438
|
* @param {boolean} unsigned - if the value is unsigned
|
|
7429
|
-
* @param {string} endian - ``big`` or ``little
|
|
7439
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7430
7440
|
* @returns number
|
|
7431
7441
|
*/
|
|
7432
7442
|
bit8(value, unsigned, endian) {
|
|
@@ -7462,7 +7472,7 @@ class biwriter {
|
|
|
7462
7472
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
7463
7473
|
*
|
|
7464
7474
|
* @param {number} value - value as int
|
|
7465
|
-
* @param {string} endian - ``big`` or ``little
|
|
7475
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7466
7476
|
* @returns number
|
|
7467
7477
|
*/
|
|
7468
7478
|
ubit8(value, endian) {
|
|
@@ -7497,7 +7507,7 @@ class biwriter {
|
|
|
7497
7507
|
*
|
|
7498
7508
|
* @param {number} value - value as int
|
|
7499
7509
|
* @param {boolean} unsigned - if the value is unsigned
|
|
7500
|
-
* @param {string} endian - ``big`` or ``little
|
|
7510
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7501
7511
|
* @returns number
|
|
7502
7512
|
*/
|
|
7503
7513
|
bit9(value, unsigned, endian) {
|
|
@@ -7533,7 +7543,7 @@ class biwriter {
|
|
|
7533
7543
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
7534
7544
|
*
|
|
7535
7545
|
* @param {number} value - value as int
|
|
7536
|
-
* @param {string} endian - ``big`` or ``little
|
|
7546
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7537
7547
|
* @returns number
|
|
7538
7548
|
*/
|
|
7539
7549
|
ubit9(value, endian) {
|
|
@@ -7568,7 +7578,7 @@ class biwriter {
|
|
|
7568
7578
|
*
|
|
7569
7579
|
* @param {number} value - value as int
|
|
7570
7580
|
* @param {boolean} unsigned - if the value is unsigned
|
|
7571
|
-
* @param {string} endian - ``big`` or ``little
|
|
7581
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7572
7582
|
* @returns number
|
|
7573
7583
|
*/
|
|
7574
7584
|
bit10(value, unsigned, endian) {
|
|
@@ -7604,7 +7614,7 @@ class biwriter {
|
|
|
7604
7614
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
7605
7615
|
*
|
|
7606
7616
|
* @param {number} value - value as int
|
|
7607
|
-
* @param {string} endian - ``big`` or ``little
|
|
7617
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7608
7618
|
* @returns number
|
|
7609
7619
|
*/
|
|
7610
7620
|
ubit10(value, endian) {
|
|
@@ -7639,7 +7649,7 @@ class biwriter {
|
|
|
7639
7649
|
*
|
|
7640
7650
|
* @param {number} value - value as int
|
|
7641
7651
|
* @param {boolean} unsigned - if the value is unsigned
|
|
7642
|
-
* @param {string} endian - ``big`` or ``little
|
|
7652
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7643
7653
|
* @returns number
|
|
7644
7654
|
*/
|
|
7645
7655
|
bit11(value, unsigned, endian) {
|
|
@@ -7675,7 +7685,7 @@ class biwriter {
|
|
|
7675
7685
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
7676
7686
|
*
|
|
7677
7687
|
* @param {number} value - value as int
|
|
7678
|
-
* @param {string} endian - ``big`` or ``little
|
|
7688
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7679
7689
|
* @returns number
|
|
7680
7690
|
*/
|
|
7681
7691
|
ubit11(value, endian) {
|
|
@@ -7710,7 +7720,7 @@ class biwriter {
|
|
|
7710
7720
|
*
|
|
7711
7721
|
* @param {number} value - value as int
|
|
7712
7722
|
* @param {boolean} unsigned - if the value is unsigned
|
|
7713
|
-
* @param {string} endian - ``big`` or ``little
|
|
7723
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7714
7724
|
* @returns number
|
|
7715
7725
|
*/
|
|
7716
7726
|
bit12(value, unsigned, endian) {
|
|
@@ -7746,7 +7756,7 @@ class biwriter {
|
|
|
7746
7756
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
7747
7757
|
*
|
|
7748
7758
|
* @param {number} value - value as int
|
|
7749
|
-
* @param {string} endian - ``big`` or ``little
|
|
7759
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7750
7760
|
* @returns number
|
|
7751
7761
|
*/
|
|
7752
7762
|
ubit12(value, endian) {
|
|
@@ -7781,7 +7791,7 @@ class biwriter {
|
|
|
7781
7791
|
*
|
|
7782
7792
|
* @param {number} value - value as int
|
|
7783
7793
|
* @param {boolean} unsigned - if the value is unsigned
|
|
7784
|
-
* @param {string} endian - ``big`` or ``little
|
|
7794
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7785
7795
|
* @returns number
|
|
7786
7796
|
*/
|
|
7787
7797
|
bit13(value, unsigned, endian) {
|
|
@@ -7817,7 +7827,7 @@ class biwriter {
|
|
|
7817
7827
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
7818
7828
|
*
|
|
7819
7829
|
* @param {number} value - value as int
|
|
7820
|
-
* @param {string} endian - ``big`` or ``little
|
|
7830
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7821
7831
|
* @returns number
|
|
7822
7832
|
*/
|
|
7823
7833
|
ubit13(value, endian) {
|
|
@@ -7852,7 +7862,7 @@ class biwriter {
|
|
|
7852
7862
|
*
|
|
7853
7863
|
* @param {number} value - value as int
|
|
7854
7864
|
* @param {boolean} unsigned - if the value is unsigned
|
|
7855
|
-
* @param {string} endian - ``big`` or ``little
|
|
7865
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7856
7866
|
* @returns number
|
|
7857
7867
|
*/
|
|
7858
7868
|
bit14(value, unsigned, endian) {
|
|
@@ -7888,7 +7898,7 @@ class biwriter {
|
|
|
7888
7898
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
7889
7899
|
*
|
|
7890
7900
|
* @param {number} value - value as int
|
|
7891
|
-
* @param {string} endian - ``big`` or ``little
|
|
7901
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7892
7902
|
* @returns number
|
|
7893
7903
|
*/
|
|
7894
7904
|
ubit14(value, endian) {
|
|
@@ -7923,7 +7933,7 @@ class biwriter {
|
|
|
7923
7933
|
*
|
|
7924
7934
|
* @param {number} value - value as int
|
|
7925
7935
|
* @param {boolean} unsigned - if the value is unsigned
|
|
7926
|
-
* @param {string} endian - ``big`` or ``little
|
|
7936
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7927
7937
|
* @returns number
|
|
7928
7938
|
*/
|
|
7929
7939
|
bit15(value, unsigned, endian) {
|
|
@@ -7959,7 +7969,7 @@ class biwriter {
|
|
|
7959
7969
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
7960
7970
|
*
|
|
7961
7971
|
* @param {number} value - value as int
|
|
7962
|
-
* @param {string} endian - ``big`` or ``little
|
|
7972
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7963
7973
|
* @returns number
|
|
7964
7974
|
*/
|
|
7965
7975
|
ubit15(value, endian) {
|
|
@@ -7994,7 +8004,7 @@ class biwriter {
|
|
|
7994
8004
|
*
|
|
7995
8005
|
* @param {number} value - value as int
|
|
7996
8006
|
* @param {boolean} unsigned - if the value is unsigned
|
|
7997
|
-
* @param {string} endian - ``big`` or ``little
|
|
8007
|
+
* @param {string} endian - ``big`` or ``little``
|
|
7998
8008
|
* @returns number
|
|
7999
8009
|
*/
|
|
8000
8010
|
bit16(value, unsigned, endian) {
|
|
@@ -8030,7 +8040,7 @@ class biwriter {
|
|
|
8030
8040
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
8031
8041
|
*
|
|
8032
8042
|
* @param {number} value - value as int
|
|
8033
|
-
* @param {string} endian - ``big`` or ``little
|
|
8043
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8034
8044
|
* @returns number
|
|
8035
8045
|
*/
|
|
8036
8046
|
ubit16(value, endian) {
|
|
@@ -8065,7 +8075,7 @@ class biwriter {
|
|
|
8065
8075
|
*
|
|
8066
8076
|
* @param {number} value - value as int
|
|
8067
8077
|
* @param {boolean} unsigned - if the value is unsigned
|
|
8068
|
-
* @param {string} endian - ``big`` or ``little
|
|
8078
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8069
8079
|
* @returns number
|
|
8070
8080
|
*/
|
|
8071
8081
|
bit17(value, unsigned, endian) {
|
|
@@ -8101,7 +8111,7 @@ class biwriter {
|
|
|
8101
8111
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
8102
8112
|
*
|
|
8103
8113
|
* @param {number} value - value as int
|
|
8104
|
-
* @param {string} endian - ``big`` or ``little
|
|
8114
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8105
8115
|
* @returns number
|
|
8106
8116
|
*/
|
|
8107
8117
|
ubit17(value, endian) {
|
|
@@ -8136,7 +8146,7 @@ class biwriter {
|
|
|
8136
8146
|
*
|
|
8137
8147
|
* @param {number} value - value as int
|
|
8138
8148
|
* @param {boolean} unsigned - if the value is unsigned
|
|
8139
|
-
* @param {string} endian - ``big`` or ``little
|
|
8149
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8140
8150
|
* @returns number
|
|
8141
8151
|
*/
|
|
8142
8152
|
bit18(value, unsigned, endian) {
|
|
@@ -8172,7 +8182,7 @@ class biwriter {
|
|
|
8172
8182
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
8173
8183
|
*
|
|
8174
8184
|
* @param {number} value - value as int
|
|
8175
|
-
* @param {string} endian - ``big`` or ``little
|
|
8185
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8176
8186
|
* @returns number
|
|
8177
8187
|
*/
|
|
8178
8188
|
ubit18(value, endian) {
|
|
@@ -8207,7 +8217,7 @@ class biwriter {
|
|
|
8207
8217
|
*
|
|
8208
8218
|
* @param {number} value - value as int
|
|
8209
8219
|
* @param {boolean} unsigned - if the value is unsigned
|
|
8210
|
-
* @param {string} endian - ``big`` or ``little
|
|
8220
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8211
8221
|
* @returns number
|
|
8212
8222
|
*/
|
|
8213
8223
|
bit19(value, unsigned, endian) {
|
|
@@ -8243,7 +8253,7 @@ class biwriter {
|
|
|
8243
8253
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
8244
8254
|
*
|
|
8245
8255
|
* @param {number} value - value as int
|
|
8246
|
-
* @param {string} endian - ``big`` or ``little
|
|
8256
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8247
8257
|
* @returns number
|
|
8248
8258
|
*/
|
|
8249
8259
|
ubit19(value, endian) {
|
|
@@ -8278,7 +8288,7 @@ class biwriter {
|
|
|
8278
8288
|
*
|
|
8279
8289
|
* @param {number} value - value as int
|
|
8280
8290
|
* @param {boolean} unsigned - if the value is unsigned
|
|
8281
|
-
* @param {string} endian - ``big`` or ``little
|
|
8291
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8282
8292
|
* @returns number
|
|
8283
8293
|
*/
|
|
8284
8294
|
bit20(value, unsigned, endian) {
|
|
@@ -8314,7 +8324,7 @@ class biwriter {
|
|
|
8314
8324
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
8315
8325
|
*
|
|
8316
8326
|
* @param {number} value - value as int
|
|
8317
|
-
* @param {string} endian - ``big`` or ``little
|
|
8327
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8318
8328
|
* @returns number
|
|
8319
8329
|
*/
|
|
8320
8330
|
ubit20(value, endian) {
|
|
@@ -8349,7 +8359,7 @@ class biwriter {
|
|
|
8349
8359
|
*
|
|
8350
8360
|
* @param {number} value - value as int
|
|
8351
8361
|
* @param {boolean} unsigned - if the value is unsigned
|
|
8352
|
-
* @param {string} endian - ``big`` or ``little
|
|
8362
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8353
8363
|
* @returns number
|
|
8354
8364
|
*/
|
|
8355
8365
|
bit21(value, unsigned, endian) {
|
|
@@ -8385,7 +8395,7 @@ class biwriter {
|
|
|
8385
8395
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
8386
8396
|
*
|
|
8387
8397
|
* @param {number} value - value as int
|
|
8388
|
-
* @param {string} endian - ``big`` or ``little
|
|
8398
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8389
8399
|
* @returns number
|
|
8390
8400
|
*/
|
|
8391
8401
|
ubit21(value, endian) {
|
|
@@ -8420,7 +8430,7 @@ class biwriter {
|
|
|
8420
8430
|
*
|
|
8421
8431
|
* @param {number} value - value as int
|
|
8422
8432
|
* @param {boolean} unsigned - if the value is unsigned
|
|
8423
|
-
* @param {string} endian - ``big`` or ``little
|
|
8433
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8424
8434
|
* @returns number
|
|
8425
8435
|
*/
|
|
8426
8436
|
bit22(value, unsigned, endian) {
|
|
@@ -8456,7 +8466,7 @@ class biwriter {
|
|
|
8456
8466
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
8457
8467
|
*
|
|
8458
8468
|
* @param {number} value - value as int
|
|
8459
|
-
* @param {string} endian - ``big`` or ``little
|
|
8469
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8460
8470
|
* @returns number
|
|
8461
8471
|
*/
|
|
8462
8472
|
ubit22(value, endian) {
|
|
@@ -8491,7 +8501,7 @@ class biwriter {
|
|
|
8491
8501
|
*
|
|
8492
8502
|
* @param {number} value - value as int
|
|
8493
8503
|
* @param {boolean} unsigned - if the value is unsigned
|
|
8494
|
-
* @param {string} endian - ``big`` or ``little
|
|
8504
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8495
8505
|
* @returns number
|
|
8496
8506
|
*/
|
|
8497
8507
|
bit23(value, unsigned, endian) {
|
|
@@ -8527,7 +8537,7 @@ class biwriter {
|
|
|
8527
8537
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
8528
8538
|
*
|
|
8529
8539
|
* @param {number} value - value as int
|
|
8530
|
-
* @param {string} endian - ``big`` or ``little
|
|
8540
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8531
8541
|
* @returns number
|
|
8532
8542
|
*/
|
|
8533
8543
|
ubit23(value, endian) {
|
|
@@ -8562,7 +8572,7 @@ class biwriter {
|
|
|
8562
8572
|
*
|
|
8563
8573
|
* @param {number} value - value as int
|
|
8564
8574
|
* @param {boolean} unsigned - if the value is unsigned
|
|
8565
|
-
* @param {string} endian - ``big`` or ``little
|
|
8575
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8566
8576
|
* @returns number
|
|
8567
8577
|
*/
|
|
8568
8578
|
bit24(value, unsigned, endian) {
|
|
@@ -8598,7 +8608,7 @@ class biwriter {
|
|
|
8598
8608
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
8599
8609
|
*
|
|
8600
8610
|
* @param {number} value - value as int
|
|
8601
|
-
* @param {string} endian - ``big`` or ``little
|
|
8611
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8602
8612
|
* @returns number
|
|
8603
8613
|
*/
|
|
8604
8614
|
ubit24(value, endian) {
|
|
@@ -8633,7 +8643,7 @@ class biwriter {
|
|
|
8633
8643
|
*
|
|
8634
8644
|
* @param {number} value - value as int
|
|
8635
8645
|
* @param {boolean} unsigned - if the value is unsigned
|
|
8636
|
-
* @param {string} endian - ``big`` or ``little
|
|
8646
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8637
8647
|
* @returns number
|
|
8638
8648
|
*/
|
|
8639
8649
|
bit25(value, unsigned, endian) {
|
|
@@ -8669,7 +8679,7 @@ class biwriter {
|
|
|
8669
8679
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
8670
8680
|
*
|
|
8671
8681
|
* @param {number} value - value as int
|
|
8672
|
-
* @param {string} endian - ``big`` or ``little
|
|
8682
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8673
8683
|
* @returns number
|
|
8674
8684
|
*/
|
|
8675
8685
|
ubit25(value, endian) {
|
|
@@ -8704,7 +8714,7 @@ class biwriter {
|
|
|
8704
8714
|
*
|
|
8705
8715
|
* @param {number} value - value as int
|
|
8706
8716
|
* @param {boolean} unsigned - if the value is unsigned
|
|
8707
|
-
* @param {string} endian - ``big`` or ``little
|
|
8717
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8708
8718
|
* @returns number
|
|
8709
8719
|
*/
|
|
8710
8720
|
bit26(value, unsigned, endian) {
|
|
@@ -8740,7 +8750,7 @@ class biwriter {
|
|
|
8740
8750
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
8741
8751
|
*
|
|
8742
8752
|
* @param {number} value - value as int
|
|
8743
|
-
* @param {string} endian - ``big`` or ``little
|
|
8753
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8744
8754
|
* @returns number
|
|
8745
8755
|
*/
|
|
8746
8756
|
ubit26(value, endian) {
|
|
@@ -8775,7 +8785,7 @@ class biwriter {
|
|
|
8775
8785
|
*
|
|
8776
8786
|
* @param {number} value - value as int
|
|
8777
8787
|
* @param {boolean} unsigned - if the value is unsigned
|
|
8778
|
-
* @param {string} endian - ``big`` or ``little
|
|
8788
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8779
8789
|
* @returns number
|
|
8780
8790
|
*/
|
|
8781
8791
|
bit27(value, unsigned, endian) {
|
|
@@ -8811,7 +8821,7 @@ class biwriter {
|
|
|
8811
8821
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
8812
8822
|
*
|
|
8813
8823
|
* @param {number} value - value as int
|
|
8814
|
-
* @param {string} endian - ``big`` or ``little
|
|
8824
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8815
8825
|
* @returns number
|
|
8816
8826
|
*/
|
|
8817
8827
|
ubit27(value, endian) {
|
|
@@ -8846,7 +8856,7 @@ class biwriter {
|
|
|
8846
8856
|
*
|
|
8847
8857
|
* @param {number} value - value as int
|
|
8848
8858
|
* @param {boolean} unsigned - if the value is unsigned
|
|
8849
|
-
* @param {string} endian - ``big`` or ``little
|
|
8859
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8850
8860
|
* @returns number
|
|
8851
8861
|
*/
|
|
8852
8862
|
bit28(value, unsigned, endian) {
|
|
@@ -8882,7 +8892,7 @@ class biwriter {
|
|
|
8882
8892
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
8883
8893
|
*
|
|
8884
8894
|
* @param {number} value - value as int
|
|
8885
|
-
* @param {string} endian - ``big`` or ``little
|
|
8895
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8886
8896
|
* @returns number
|
|
8887
8897
|
*/
|
|
8888
8898
|
ubit28(value, endian) {
|
|
@@ -8917,7 +8927,7 @@ class biwriter {
|
|
|
8917
8927
|
*
|
|
8918
8928
|
* @param {number} value - value as int
|
|
8919
8929
|
* @param {boolean} unsigned - if the value is unsigned
|
|
8920
|
-
* @param {string} endian - ``big`` or ``little
|
|
8930
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8921
8931
|
* @returns number
|
|
8922
8932
|
*/
|
|
8923
8933
|
bit29(value, unsigned, endian) {
|
|
@@ -8953,7 +8963,7 @@ class biwriter {
|
|
|
8953
8963
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
8954
8964
|
*
|
|
8955
8965
|
* @param {number} value - value as int
|
|
8956
|
-
* @param {string} endian - ``big`` or ``little
|
|
8966
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8957
8967
|
* @returns number
|
|
8958
8968
|
*/
|
|
8959
8969
|
ubit29(value, endian) {
|
|
@@ -8988,7 +8998,7 @@ class biwriter {
|
|
|
8988
8998
|
*
|
|
8989
8999
|
* @param {number} value - value as int
|
|
8990
9000
|
* @param {boolean} unsigned - if the value is unsigned
|
|
8991
|
-
* @param {string} endian - ``big`` or ``little
|
|
9001
|
+
* @param {string} endian - ``big`` or ``little``
|
|
8992
9002
|
* @returns number
|
|
8993
9003
|
*/
|
|
8994
9004
|
bit30(value, unsigned, endian) {
|
|
@@ -9024,7 +9034,7 @@ class biwriter {
|
|
|
9024
9034
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
9025
9035
|
*
|
|
9026
9036
|
* @param {number} value - value as int
|
|
9027
|
-
* @param {string} endian - ``big`` or ``little
|
|
9037
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9028
9038
|
* @returns number
|
|
9029
9039
|
*/
|
|
9030
9040
|
ubit30(value, endian) {
|
|
@@ -9059,7 +9069,7 @@ class biwriter {
|
|
|
9059
9069
|
*
|
|
9060
9070
|
* @param {number} value - value as int
|
|
9061
9071
|
* @param {boolean} unsigned - if the value is unsigned
|
|
9062
|
-
* @param {string} endian - ``big`` or ``little
|
|
9072
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9063
9073
|
* @returns number
|
|
9064
9074
|
*/
|
|
9065
9075
|
bit31(value, unsigned, endian) {
|
|
@@ -9095,7 +9105,7 @@ class biwriter {
|
|
|
9095
9105
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
9096
9106
|
*
|
|
9097
9107
|
* @param {number} value - value as int
|
|
9098
|
-
* @param {string} endian - ``big`` or ``little
|
|
9108
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9099
9109
|
* @returns number
|
|
9100
9110
|
*/
|
|
9101
9111
|
ubit31(value, endian) {
|
|
@@ -9130,7 +9140,7 @@ class biwriter {
|
|
|
9130
9140
|
*
|
|
9131
9141
|
* @param {number} value - value as int
|
|
9132
9142
|
* @param {boolean} unsigned - if the value is unsigned
|
|
9133
|
-
* @param {string} endian - ``big`` or ``little
|
|
9143
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9134
9144
|
* @returns number
|
|
9135
9145
|
*/
|
|
9136
9146
|
bit32(value, unsigned, endian) {
|
|
@@ -9166,7 +9176,7 @@ class biwriter {
|
|
|
9166
9176
|
* Note: When returning to a byte write, remaining bits are dropped
|
|
9167
9177
|
*
|
|
9168
9178
|
* @param {number} value - value as int
|
|
9169
|
-
* @param {string} endian - ``big`` or ``little
|
|
9179
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9170
9180
|
* @returns number
|
|
9171
9181
|
*/
|
|
9172
9182
|
ubit32(value, endian) {
|
|
@@ -9273,7 +9283,7 @@ class biwriter {
|
|
|
9273
9283
|
*
|
|
9274
9284
|
* @param {number} value - value as int
|
|
9275
9285
|
* @param {boolean} unsigned - if the value is unsigned
|
|
9276
|
-
* @param {string} endian - ``big`` or ``little
|
|
9286
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9277
9287
|
*/
|
|
9278
9288
|
writeInt16(value, unsigned, endian) {
|
|
9279
9289
|
return wint16(this, value, unsigned, endian);
|
|
@@ -9282,7 +9292,7 @@ class biwriter {
|
|
|
9282
9292
|
* Read short
|
|
9283
9293
|
*
|
|
9284
9294
|
* @param {boolean} unsigned - if value is unsigned or not
|
|
9285
|
-
* @param {string} endian -
|
|
9295
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9286
9296
|
* @returns number
|
|
9287
9297
|
*/
|
|
9288
9298
|
readInt16(unsigned, endian) {
|
|
@@ -9293,7 +9303,7 @@ class biwriter {
|
|
|
9293
9303
|
*
|
|
9294
9304
|
* @param {number} value - value as int
|
|
9295
9305
|
* @param {boolean} unsigned - if the value is unsigned
|
|
9296
|
-
* @param {string} endian - ``big`` or ``little
|
|
9306
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9297
9307
|
*/
|
|
9298
9308
|
int16(value, unsigned, endian) {
|
|
9299
9309
|
return this.writeInt16(value, unsigned, endian);
|
|
@@ -9303,7 +9313,7 @@ class biwriter {
|
|
|
9303
9313
|
*
|
|
9304
9314
|
* @param {number} value - value as int
|
|
9305
9315
|
* @param {boolean} unsigned - if the value is unsigned
|
|
9306
|
-
* @param {string} endian - ``big`` or ``little
|
|
9316
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9307
9317
|
*/
|
|
9308
9318
|
short(value, unsigned, endian) {
|
|
9309
9319
|
return this.writeInt16(value, unsigned, endian);
|
|
@@ -9313,7 +9323,7 @@ class biwriter {
|
|
|
9313
9323
|
*
|
|
9314
9324
|
* @param {number} value - value as int
|
|
9315
9325
|
* @param {boolean} unsigned - if the value is unsigned
|
|
9316
|
-
* @param {string} endian - ``big`` or ``little
|
|
9326
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9317
9327
|
*/
|
|
9318
9328
|
word(value, unsigned, endian) {
|
|
9319
9329
|
return this.writeInt16(value, unsigned, endian);
|
|
@@ -9322,7 +9332,7 @@ class biwriter {
|
|
|
9322
9332
|
* Write unsigned int16
|
|
9323
9333
|
*
|
|
9324
9334
|
* @param {number} value - value as int
|
|
9325
|
-
* @param {string} endian - ``big`` or ``little
|
|
9335
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9326
9336
|
*/
|
|
9327
9337
|
writeUInt16(value, endian) {
|
|
9328
9338
|
return this.writeInt16(value, true, endian);
|
|
@@ -9331,7 +9341,7 @@ class biwriter {
|
|
|
9331
9341
|
* Write unsigned int16
|
|
9332
9342
|
*
|
|
9333
9343
|
* @param {number} value - value as int
|
|
9334
|
-
* @param {string} endian - ``big`` or ``little
|
|
9344
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9335
9345
|
*/
|
|
9336
9346
|
uint16(value, endian) {
|
|
9337
9347
|
return this.writeInt16(value, true, endian);
|
|
@@ -9340,7 +9350,7 @@ class biwriter {
|
|
|
9340
9350
|
* Write unsigned int16
|
|
9341
9351
|
*
|
|
9342
9352
|
* @param {number} value - value as int
|
|
9343
|
-
* @param {string} endian - ``big`` or ``little
|
|
9353
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9344
9354
|
*/
|
|
9345
9355
|
ushort(value, endian) {
|
|
9346
9356
|
return this.writeInt16(value, true, endian);
|
|
@@ -9349,7 +9359,7 @@ class biwriter {
|
|
|
9349
9359
|
* Write unsigned int16
|
|
9350
9360
|
*
|
|
9351
9361
|
* @param {number} value - value as int
|
|
9352
|
-
* @param {string} endian - ``big`` or ``little
|
|
9362
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9353
9363
|
*/
|
|
9354
9364
|
uword(value, endian) {
|
|
9355
9365
|
return this.writeInt16(value, true, endian);
|
|
@@ -9489,7 +9499,7 @@ class biwriter {
|
|
|
9489
9499
|
* Writes half float
|
|
9490
9500
|
*
|
|
9491
9501
|
* @param {number} value - value as int
|
|
9492
|
-
* @param {string} endian - ``big`` or ``little
|
|
9502
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9493
9503
|
*/
|
|
9494
9504
|
writeHalfFloat(value, endian) {
|
|
9495
9505
|
return whalffloat(this, value, endian);
|
|
@@ -9497,7 +9507,7 @@ class biwriter {
|
|
|
9497
9507
|
/**
|
|
9498
9508
|
* Read half float
|
|
9499
9509
|
*
|
|
9500
|
-
* @param {string} endian -
|
|
9510
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9501
9511
|
* @returns number
|
|
9502
9512
|
*/
|
|
9503
9513
|
readHalfFloat(endian) {
|
|
@@ -9507,7 +9517,7 @@ class biwriter {
|
|
|
9507
9517
|
* Writes half float
|
|
9508
9518
|
*
|
|
9509
9519
|
* @param {number} value - value as int
|
|
9510
|
-
* @param {string} endian - ``big`` or ``little
|
|
9520
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9511
9521
|
*/
|
|
9512
9522
|
half(value, endian) {
|
|
9513
9523
|
return this.writeHalfFloat(value, endian);
|
|
@@ -9516,7 +9526,7 @@ class biwriter {
|
|
|
9516
9526
|
* Writes half float
|
|
9517
9527
|
*
|
|
9518
9528
|
* @param {number} value - value as int
|
|
9519
|
-
* @param {string} endian - ``big`` or ``little
|
|
9529
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9520
9530
|
*/
|
|
9521
9531
|
halffloat(value, endian) {
|
|
9522
9532
|
return this.writeHalfFloat(value, endian);
|
|
@@ -9577,7 +9587,7 @@ class biwriter {
|
|
|
9577
9587
|
*
|
|
9578
9588
|
* @param {number} value - value as int
|
|
9579
9589
|
* @param {boolean} unsigned - if the value is unsigned
|
|
9580
|
-
* @param {string} endian - ``big`` or ``little
|
|
9590
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9581
9591
|
*/
|
|
9582
9592
|
writeInt32(value, unsigned, endian) {
|
|
9583
9593
|
return wint32(this, value, unsigned, endian);
|
|
@@ -9586,7 +9596,7 @@ class biwriter {
|
|
|
9586
9596
|
* Read 32 bit integer
|
|
9587
9597
|
*
|
|
9588
9598
|
* @param {boolean} unsigned - if value is unsigned or not
|
|
9589
|
-
* @param {string} endian -
|
|
9599
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9590
9600
|
* @returns number
|
|
9591
9601
|
*/
|
|
9592
9602
|
readInt32(unsigned, endian) {
|
|
@@ -9597,7 +9607,7 @@ class biwriter {
|
|
|
9597
9607
|
*
|
|
9598
9608
|
* @param {number} value - value as int
|
|
9599
9609
|
* @param {boolean} unsigned - if the value is unsigned
|
|
9600
|
-
* @param {string} endian - ``big`` or ``little
|
|
9610
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9601
9611
|
*/
|
|
9602
9612
|
int(value, unsigned, endian) {
|
|
9603
9613
|
return this.writeInt32(value, unsigned, endian);
|
|
@@ -9607,7 +9617,7 @@ class biwriter {
|
|
|
9607
9617
|
*
|
|
9608
9618
|
* @param {number} value - value as int
|
|
9609
9619
|
* @param {boolean} unsigned - if the value is unsigned
|
|
9610
|
-
* @param {string} endian - ``big`` or ``little
|
|
9620
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9611
9621
|
*/
|
|
9612
9622
|
int32(value, unsigned, endian) {
|
|
9613
9623
|
return this.writeInt32(value, unsigned, endian);
|
|
@@ -9617,7 +9627,7 @@ class biwriter {
|
|
|
9617
9627
|
*
|
|
9618
9628
|
* @param {number} value - value as int
|
|
9619
9629
|
* @param {boolean} unsigned - if the value is unsigned
|
|
9620
|
-
* @param {string} endian - ``big`` or ``little
|
|
9630
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9621
9631
|
*/
|
|
9622
9632
|
double(value, unsigned, endian) {
|
|
9623
9633
|
return this.writeInt32(value, unsigned, endian);
|
|
@@ -9627,7 +9637,7 @@ class biwriter {
|
|
|
9627
9637
|
*
|
|
9628
9638
|
* @param {number} value - value as int
|
|
9629
9639
|
* @param {boolean} unsigned - if the value is unsigned
|
|
9630
|
-
* @param {string} endian - ``big`` or ``little
|
|
9640
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9631
9641
|
*/
|
|
9632
9642
|
long(value, unsigned, endian) {
|
|
9633
9643
|
return this.writeInt32(value, unsigned, endian);
|
|
@@ -9844,7 +9854,7 @@ class biwriter {
|
|
|
9844
9854
|
* Write float
|
|
9845
9855
|
*
|
|
9846
9856
|
* @param {number} value - value as int
|
|
9847
|
-
* @param {string} endian - ``big`` or ``little
|
|
9857
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9848
9858
|
*/
|
|
9849
9859
|
writeFloat(value, endian) {
|
|
9850
9860
|
return wfloat(this, value, endian);
|
|
@@ -9852,7 +9862,7 @@ class biwriter {
|
|
|
9852
9862
|
/**
|
|
9853
9863
|
* Read float
|
|
9854
9864
|
*
|
|
9855
|
-
* @param {string} endian -
|
|
9865
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9856
9866
|
* @returns number
|
|
9857
9867
|
*/
|
|
9858
9868
|
readFloat(endian) {
|
|
@@ -9862,7 +9872,7 @@ class biwriter {
|
|
|
9862
9872
|
* Write float
|
|
9863
9873
|
*
|
|
9864
9874
|
* @param {number} value - value as int
|
|
9865
|
-
* @param {string} endian - ``big`` or ``little
|
|
9875
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9866
9876
|
*/
|
|
9867
9877
|
float(value, endian) {
|
|
9868
9878
|
return this.writeFloat(value, endian);
|
|
@@ -9907,7 +9917,7 @@ class biwriter {
|
|
|
9907
9917
|
*
|
|
9908
9918
|
* @param {number} value - value as int
|
|
9909
9919
|
* @param {boolean} unsigned - if the value is unsigned
|
|
9910
|
-
* @param {string} endian - ``big`` or ``little
|
|
9920
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9911
9921
|
*/
|
|
9912
9922
|
writeInt64(value, unsigned, endian) {
|
|
9913
9923
|
return wint64(this, value, unsigned, endian);
|
|
@@ -9915,7 +9925,7 @@ class biwriter {
|
|
|
9915
9925
|
/**
|
|
9916
9926
|
* Read signed 64 bit integer
|
|
9917
9927
|
* @param {boolean} unsigned - if value is unsigned or not
|
|
9918
|
-
* @param {string} endian -
|
|
9928
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9919
9929
|
* @returns number
|
|
9920
9930
|
*/
|
|
9921
9931
|
readInt64(unsigned, endian) {
|
|
@@ -9926,7 +9936,7 @@ class biwriter {
|
|
|
9926
9936
|
*
|
|
9927
9937
|
* @param {number} value - value as int
|
|
9928
9938
|
* @param {boolean} unsigned - if the value is unsigned
|
|
9929
|
-
* @param {string} endian - ``big`` or ``little
|
|
9939
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9930
9940
|
*/
|
|
9931
9941
|
int64(value, unsigned, endian) {
|
|
9932
9942
|
return this.writeInt64(value, unsigned, endian);
|
|
@@ -9936,7 +9946,7 @@ class biwriter {
|
|
|
9936
9946
|
*
|
|
9937
9947
|
* @param {number} value - value as int
|
|
9938
9948
|
* @param {boolean} unsigned - if the value is unsigned
|
|
9939
|
-
* @param {string} endian - ``big`` or ``little
|
|
9949
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9940
9950
|
*/
|
|
9941
9951
|
quad(value, unsigned, endian) {
|
|
9942
9952
|
return this.writeInt64(value, unsigned, endian);
|
|
@@ -9946,7 +9956,7 @@ class biwriter {
|
|
|
9946
9956
|
*
|
|
9947
9957
|
* @param {number} value - value as int
|
|
9948
9958
|
* @param {boolean} unsigned - if the value is unsigned
|
|
9949
|
-
* @param {string} endian - ``big`` or ``little
|
|
9959
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9950
9960
|
*/
|
|
9951
9961
|
bigint(value, unsigned, endian) {
|
|
9952
9962
|
return this.writeInt64(value, unsigned, endian);
|
|
@@ -9955,7 +9965,7 @@ class biwriter {
|
|
|
9955
9965
|
* Write unsigned 64 bit integer
|
|
9956
9966
|
*
|
|
9957
9967
|
* @param {number} value - value as int
|
|
9958
|
-
* @param {string} endian - ``big`` or ``little
|
|
9968
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9959
9969
|
*/
|
|
9960
9970
|
writeUInt64(value, endian) {
|
|
9961
9971
|
return this.writeInt64(value, true, endian);
|
|
@@ -9964,7 +9974,7 @@ class biwriter {
|
|
|
9964
9974
|
* Write unsigned 64 bit integer
|
|
9965
9975
|
*
|
|
9966
9976
|
* @param {number} value - value as int
|
|
9967
|
-
* @param {string} endian - ``big`` or ``little
|
|
9977
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9968
9978
|
*/
|
|
9969
9979
|
uint64(value, endian) {
|
|
9970
9980
|
return this.writeInt64(value, true, endian);
|
|
@@ -9973,7 +9983,7 @@ class biwriter {
|
|
|
9973
9983
|
* Write unsigned 64 bit integer
|
|
9974
9984
|
*
|
|
9975
9985
|
* @param {number} value - value as int
|
|
9976
|
-
* @param {string} endian - ``big`` or ``little
|
|
9986
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9977
9987
|
*/
|
|
9978
9988
|
ubigint(value, endian) {
|
|
9979
9989
|
return this.writeInt64(value, true, endian);
|
|
@@ -9982,7 +9992,7 @@ class biwriter {
|
|
|
9982
9992
|
* Write unsigned 64 bit integer
|
|
9983
9993
|
*
|
|
9984
9994
|
* @param {number} value - value as int
|
|
9985
|
-
* @param {string} endian - ``big`` or ``little
|
|
9995
|
+
* @param {string} endian - ``big`` or ``little``
|
|
9986
9996
|
*/
|
|
9987
9997
|
uquad(value, endian) {
|
|
9988
9998
|
return this.writeInt64(value, true, endian);
|
|
@@ -10122,8 +10132,7 @@ class biwriter {
|
|
|
10122
10132
|
* Writes double float
|
|
10123
10133
|
*
|
|
10124
10134
|
* @param {number} value - value as int
|
|
10125
|
-
* @param {
|
|
10126
|
-
* @param {string} endian - ``big`` or ``little`
|
|
10135
|
+
* @param {string} endian - ``big`` or ``little``
|
|
10127
10136
|
*/
|
|
10128
10137
|
writeDoubleFloat(value, endian) {
|
|
10129
10138
|
return wdfloat(this, value, endian);
|
|
@@ -10131,7 +10140,7 @@ class biwriter {
|
|
|
10131
10140
|
/**
|
|
10132
10141
|
* Read double float
|
|
10133
10142
|
*
|
|
10134
|
-
* @param {string} endian -
|
|
10143
|
+
* @param {string} endian - ``big`` or ``little``
|
|
10135
10144
|
* @returns number
|
|
10136
10145
|
*/
|
|
10137
10146
|
readDoubleFloat(endian) {
|
|
@@ -10141,7 +10150,7 @@ class biwriter {
|
|
|
10141
10150
|
* Writes double float
|
|
10142
10151
|
*
|
|
10143
10152
|
* @param {number} value - value as int
|
|
10144
|
-
* @param {string} endian - ``big`` or ``little
|
|
10153
|
+
* @param {string} endian - ``big`` or ``little``
|
|
10145
10154
|
*/
|
|
10146
10155
|
doublefloat(value, endian) {
|
|
10147
10156
|
return this.writeDoubleFloat(value, endian);
|
|
@@ -10150,7 +10159,7 @@ class biwriter {
|
|
|
10150
10159
|
* Writes double float
|
|
10151
10160
|
*
|
|
10152
10161
|
* @param {number} value - value as int
|
|
10153
|
-
* @param {string} endian - ``big`` or ``little
|
|
10162
|
+
* @param {string} endian - ``big`` or ``little``
|
|
10154
10163
|
*/
|
|
10155
10164
|
dfloat(value, endian) {
|
|
10156
10165
|
return this.writeDoubleFloat(value, endian);
|