bireader 3.1.3 → 3.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -5
- package/dist/BiWriter.d.ts +19 -19
- package/dist/BiWriterStream.d.ts +19 -19
- package/dist/aliases/BinaryAliasWriter.d.ts +73 -73
- package/dist/common.d.ts +1 -0
- package/dist/core/BiBase.d.ts +23 -15
- package/dist/core/BiBaseStream.d.ts +35 -15
- package/dist/index.browser.d.ts +94 -69
- package/dist/index.browser.js +56 -26
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs.d.ts +165 -136
- package/dist/index.cjs.js +72 -32
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +165 -136
- package/dist/index.esm.d.ts +165 -136
- package/dist/index.esm.js +72 -32
- package/dist/index.esm.js.map +1 -1
- package/dist/indexBrowser.d.ts +16 -0
- package/package.json +10 -8
package/dist/index.esm.js
CHANGED
|
@@ -1813,6 +1813,16 @@ class BiBase {
|
|
|
1813
1813
|
this.insert(data, consume, start);
|
|
1814
1814
|
return data.length;
|
|
1815
1815
|
}
|
|
1816
|
+
/**
|
|
1817
|
+
* Dummy function, not needed on Non-Stream
|
|
1818
|
+
*/
|
|
1819
|
+
renameFile() {
|
|
1820
|
+
}
|
|
1821
|
+
/**
|
|
1822
|
+
* Dummy function, not needed on Non-Stream
|
|
1823
|
+
*/
|
|
1824
|
+
deleteFile() {
|
|
1825
|
+
}
|
|
1816
1826
|
/**
|
|
1817
1827
|
* Dummy function, not needed on Non-Stream
|
|
1818
1828
|
*/
|
|
@@ -2250,7 +2260,7 @@ class BiBase {
|
|
|
2250
2260
|
*
|
|
2251
2261
|
* Does not change current read position.
|
|
2252
2262
|
*
|
|
2253
|
-
* @param {
|
|
2263
|
+
* @param {BigValue} value - Number to search for.
|
|
2254
2264
|
* @param {boolean} unsigned - If the number is unsigned (default true)
|
|
2255
2265
|
* @param {endian} endian - endianness of value (default set endian).
|
|
2256
2266
|
*/
|
|
@@ -3428,7 +3438,7 @@ class BiBase {
|
|
|
3428
3438
|
/**
|
|
3429
3439
|
* Write 64 bit integer.
|
|
3430
3440
|
*
|
|
3431
|
-
* @param {
|
|
3441
|
+
* @param {BigValue} value - value as int
|
|
3432
3442
|
* @param {boolean} unsigned - if the value is unsigned
|
|
3433
3443
|
* @param {endian} endian - ``big`` or ``little``
|
|
3434
3444
|
*/
|
|
@@ -3438,7 +3448,7 @@ class BiBase {
|
|
|
3438
3448
|
/**
|
|
3439
3449
|
* Write unsigned 64 bit integer.
|
|
3440
3450
|
*
|
|
3441
|
-
* @param {
|
|
3451
|
+
* @param {BigValue} value - value as int
|
|
3442
3452
|
* @param {endian} endian - ``big`` or ``little``
|
|
3443
3453
|
*/
|
|
3444
3454
|
writeUInt64(value, endian) {
|
|
@@ -3447,7 +3457,7 @@ class BiBase {
|
|
|
3447
3457
|
/**
|
|
3448
3458
|
* Write signed 64 bit integer.
|
|
3449
3459
|
*
|
|
3450
|
-
* @param {
|
|
3460
|
+
* @param {BigValue} value - value as int
|
|
3451
3461
|
*/
|
|
3452
3462
|
writeInt64LE(value) {
|
|
3453
3463
|
return this.writeInt64(value, false, "little");
|
|
@@ -3455,7 +3465,7 @@ class BiBase {
|
|
|
3455
3465
|
/**
|
|
3456
3466
|
* Write unsigned 64 bit integer.
|
|
3457
3467
|
*
|
|
3458
|
-
* @param {
|
|
3468
|
+
* @param {BigValue} value - value as int
|
|
3459
3469
|
*/
|
|
3460
3470
|
writeUInt64LE(value) {
|
|
3461
3471
|
return this.writeInt64(value, true, "little");
|
|
@@ -3463,7 +3473,7 @@ class BiBase {
|
|
|
3463
3473
|
/**
|
|
3464
3474
|
* Write signed 64 bit integer.
|
|
3465
3475
|
*
|
|
3466
|
-
* @param {
|
|
3476
|
+
* @param {BigValue} value - value as int
|
|
3467
3477
|
*/
|
|
3468
3478
|
writeInt64BE(value) {
|
|
3469
3479
|
return this.writeInt64(value, false, "big");
|
|
@@ -3471,7 +3481,7 @@ class BiBase {
|
|
|
3471
3481
|
/**
|
|
3472
3482
|
* Write unsigned 64 bit integer.
|
|
3473
3483
|
*
|
|
3474
|
-
* @param {
|
|
3484
|
+
* @param {BigValue} value - value as int
|
|
3475
3485
|
*/
|
|
3476
3486
|
writeUInt64BE(value) {
|
|
3477
3487
|
return this.writeInt64(value, true, "big");
|
|
@@ -10059,7 +10069,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10059
10069
|
/**
|
|
10060
10070
|
* Write 64 bit integer.
|
|
10061
10071
|
*
|
|
10062
|
-
* @param {
|
|
10072
|
+
* @param {BigValue} value - value as int
|
|
10063
10073
|
*/
|
|
10064
10074
|
set int64(value) {
|
|
10065
10075
|
this.writeInt64(value);
|
|
@@ -10067,7 +10077,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10067
10077
|
/**
|
|
10068
10078
|
* Write 64 bit integer.
|
|
10069
10079
|
*
|
|
10070
|
-
* @param {
|
|
10080
|
+
* @param {BigValue} value - value as int
|
|
10071
10081
|
*/
|
|
10072
10082
|
set quad(value) {
|
|
10073
10083
|
this.writeInt64(value);
|
|
@@ -10075,7 +10085,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10075
10085
|
/**
|
|
10076
10086
|
* Write 64 bit integer.
|
|
10077
10087
|
*
|
|
10078
|
-
* @param {
|
|
10088
|
+
* @param {BigValue} value - value as int
|
|
10079
10089
|
*/
|
|
10080
10090
|
set bigint(value) {
|
|
10081
10091
|
this.writeInt64(value);
|
|
@@ -10083,7 +10093,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10083
10093
|
/**
|
|
10084
10094
|
* Write unsigned 64 bit integer.
|
|
10085
10095
|
*
|
|
10086
|
-
* @param {
|
|
10096
|
+
* @param {BigValue} value - value as int
|
|
10087
10097
|
*/
|
|
10088
10098
|
set uint64(value) {
|
|
10089
10099
|
this.writeInt64(value, true);
|
|
@@ -10091,7 +10101,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10091
10101
|
/**
|
|
10092
10102
|
* Write unsigned 64 bit integer.
|
|
10093
10103
|
*
|
|
10094
|
-
* @param {
|
|
10104
|
+
* @param {BigValue} value - value as int
|
|
10095
10105
|
*/
|
|
10096
10106
|
set ubigint(value) {
|
|
10097
10107
|
this.writeInt64(value, true);
|
|
@@ -10099,7 +10109,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10099
10109
|
/**
|
|
10100
10110
|
* Write unsigned 64 bit integer.
|
|
10101
10111
|
*
|
|
10102
|
-
* @param {
|
|
10112
|
+
* @param {BigValue} value - value as int
|
|
10103
10113
|
*/
|
|
10104
10114
|
set uquad(value) {
|
|
10105
10115
|
this.writeInt64(value, true);
|
|
@@ -10107,7 +10117,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10107
10117
|
/**
|
|
10108
10118
|
* Write signed 64 bit integer.
|
|
10109
10119
|
*
|
|
10110
|
-
* @param {
|
|
10120
|
+
* @param {BigValue} value - value as int
|
|
10111
10121
|
*/
|
|
10112
10122
|
set int64le(value) {
|
|
10113
10123
|
this.writeInt64(value, false, "little");
|
|
@@ -10115,7 +10125,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10115
10125
|
/**
|
|
10116
10126
|
* Write signed 64 bit integer.
|
|
10117
10127
|
*
|
|
10118
|
-
* @param {
|
|
10128
|
+
* @param {BigValue} value - value as int
|
|
10119
10129
|
*/
|
|
10120
10130
|
set bigintle(value) {
|
|
10121
10131
|
this.writeInt64(value, false, "little");
|
|
@@ -10123,7 +10133,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10123
10133
|
/**
|
|
10124
10134
|
* Write signed 64 bit integer.
|
|
10125
10135
|
*
|
|
10126
|
-
* @param {
|
|
10136
|
+
* @param {BigValue} value - value as int
|
|
10127
10137
|
*/
|
|
10128
10138
|
set quadle(value) {
|
|
10129
10139
|
this.writeInt64(value, false, "little");
|
|
@@ -10131,7 +10141,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10131
10141
|
/**
|
|
10132
10142
|
* Write unsigned 64 bit integer.
|
|
10133
10143
|
*
|
|
10134
|
-
* @param {
|
|
10144
|
+
* @param {BigValue} value - value as int
|
|
10135
10145
|
*/
|
|
10136
10146
|
set uint64le(value) {
|
|
10137
10147
|
this.writeInt64(value, true, "little");
|
|
@@ -10139,7 +10149,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10139
10149
|
/**
|
|
10140
10150
|
* Write unsigned 64 bit integer.
|
|
10141
10151
|
*
|
|
10142
|
-
* @param {
|
|
10152
|
+
* @param {BigValue} value - value as int
|
|
10143
10153
|
*/
|
|
10144
10154
|
set ubigintle(value) {
|
|
10145
10155
|
this.writeInt64(value, true, "little");
|
|
@@ -10147,7 +10157,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10147
10157
|
/**
|
|
10148
10158
|
* Write unsigned 64 bit integer.
|
|
10149
10159
|
*
|
|
10150
|
-
* @param {
|
|
10160
|
+
* @param {BigValue} value - value as int
|
|
10151
10161
|
*/
|
|
10152
10162
|
set uquadle(value) {
|
|
10153
10163
|
this.writeInt64(value, true, "little");
|
|
@@ -10155,7 +10165,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10155
10165
|
/**
|
|
10156
10166
|
* Write signed 64 bit integer.
|
|
10157
10167
|
*
|
|
10158
|
-
* @param {
|
|
10168
|
+
* @param {BigValue} value - value as int
|
|
10159
10169
|
*/
|
|
10160
10170
|
set int64be(value) {
|
|
10161
10171
|
this.writeInt64(value, false, "big");
|
|
@@ -10163,7 +10173,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10163
10173
|
/**
|
|
10164
10174
|
* Write signed 64 bit integer.
|
|
10165
10175
|
*
|
|
10166
|
-
* @param {
|
|
10176
|
+
* @param {BigValue} value - value as int
|
|
10167
10177
|
*/
|
|
10168
10178
|
set bigintbe(value) {
|
|
10169
10179
|
this.writeInt64(value, false, "big");
|
|
@@ -10171,7 +10181,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10171
10181
|
/**
|
|
10172
10182
|
* Write signed 64 bit integer.
|
|
10173
10183
|
*
|
|
10174
|
-
* @param {
|
|
10184
|
+
* @param {BigValue} value - value as int
|
|
10175
10185
|
*/
|
|
10176
10186
|
set quadbe(value) {
|
|
10177
10187
|
this.writeInt64(value, false, "big");
|
|
@@ -10179,7 +10189,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10179
10189
|
/**
|
|
10180
10190
|
* Write unsigned 64 bit integer.
|
|
10181
10191
|
*
|
|
10182
|
-
* @param {
|
|
10192
|
+
* @param {BigValue} value - value as int
|
|
10183
10193
|
*/
|
|
10184
10194
|
set uint64be(value) {
|
|
10185
10195
|
this.writeInt64(value, true, "big");
|
|
@@ -10187,7 +10197,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10187
10197
|
/**
|
|
10188
10198
|
* Write unsigned 64 bit integer.
|
|
10189
10199
|
*
|
|
10190
|
-
* @param {
|
|
10200
|
+
* @param {BigValue} value - value as int
|
|
10191
10201
|
*/
|
|
10192
10202
|
set ubigintbe(value) {
|
|
10193
10203
|
this.writeInt64(value, true, "big");
|
|
@@ -10195,7 +10205,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10195
10205
|
/**
|
|
10196
10206
|
* Write unsigned 64 bit integer.
|
|
10197
10207
|
*
|
|
10198
|
-
* @param {
|
|
10208
|
+
* @param {BigValue} value - value as int
|
|
10199
10209
|
*/
|
|
10200
10210
|
set uquadbe(value) {
|
|
10201
10211
|
this.writeInt64(value, true, "big");
|
|
@@ -13582,6 +13592,36 @@ class BiBaseStreamer {
|
|
|
13582
13592
|
}
|
|
13583
13593
|
return this.write(this.offset, this.data, consume);
|
|
13584
13594
|
}
|
|
13595
|
+
/**
|
|
13596
|
+
* Renames the file you are working on.
|
|
13597
|
+
*
|
|
13598
|
+
* Must be full file path and file name.
|
|
13599
|
+
*
|
|
13600
|
+
* Keeps write / read position.
|
|
13601
|
+
*
|
|
13602
|
+
* Note: This is permanent and can't be undone.
|
|
13603
|
+
*
|
|
13604
|
+
* @param {string} newFilePath - New full file path and name.
|
|
13605
|
+
*/
|
|
13606
|
+
renameFile(newFilePath) {
|
|
13607
|
+
fs.closeSync(this.fd);
|
|
13608
|
+
this.fd = null;
|
|
13609
|
+
fs.renameSync(this.filePath, newFilePath);
|
|
13610
|
+
this.filePath = newFilePath;
|
|
13611
|
+
this.open();
|
|
13612
|
+
}
|
|
13613
|
+
/**
|
|
13614
|
+
* Deletes the working file.
|
|
13615
|
+
*
|
|
13616
|
+
* Note: This is permanentand can't be undone.
|
|
13617
|
+
*
|
|
13618
|
+
* It doesn't send the file to the recycling bin for recovery.
|
|
13619
|
+
*/
|
|
13620
|
+
deleteFile() {
|
|
13621
|
+
fs.closeSync(this.fd);
|
|
13622
|
+
this.fd = null;
|
|
13623
|
+
fs.unlinkSync(this.filePath);
|
|
13624
|
+
}
|
|
13585
13625
|
/**
|
|
13586
13626
|
* internal extend
|
|
13587
13627
|
*
|
|
@@ -14036,7 +14076,7 @@ class BiBaseStreamer {
|
|
|
14036
14076
|
*
|
|
14037
14077
|
* Does not change current read position.
|
|
14038
14078
|
*
|
|
14039
|
-
* @param {
|
|
14079
|
+
* @param {BigValue} value - Number to search for.
|
|
14040
14080
|
* @param {boolean} unsigned - If the number is unsigned (default true)
|
|
14041
14081
|
* @param {endian} endian - endianness of value (default set endian).
|
|
14042
14082
|
*/
|
|
@@ -15214,7 +15254,7 @@ class BiBaseStreamer {
|
|
|
15214
15254
|
/**
|
|
15215
15255
|
* Write 64 bit integer.
|
|
15216
15256
|
*
|
|
15217
|
-
* @param {
|
|
15257
|
+
* @param {BigValue} value - value as int
|
|
15218
15258
|
* @param {boolean} unsigned - if the value is unsigned
|
|
15219
15259
|
* @param {endian} endian - ``big`` or ``little``
|
|
15220
15260
|
*/
|
|
@@ -15224,7 +15264,7 @@ class BiBaseStreamer {
|
|
|
15224
15264
|
/**
|
|
15225
15265
|
* Write unsigned 64 bit integer.
|
|
15226
15266
|
*
|
|
15227
|
-
* @param {
|
|
15267
|
+
* @param {BigValue} value - value as int
|
|
15228
15268
|
* @param {endian} endian - ``big`` or ``little``
|
|
15229
15269
|
*/
|
|
15230
15270
|
writeUInt64(value, endian) {
|
|
@@ -15233,7 +15273,7 @@ class BiBaseStreamer {
|
|
|
15233
15273
|
/**
|
|
15234
15274
|
* Write signed 64 bit integer.
|
|
15235
15275
|
*
|
|
15236
|
-
* @param {
|
|
15276
|
+
* @param {BigValue} value - value as int
|
|
15237
15277
|
*/
|
|
15238
15278
|
writeInt64LE(value) {
|
|
15239
15279
|
return this.writeInt64(value, false, "little");
|
|
@@ -15241,7 +15281,7 @@ class BiBaseStreamer {
|
|
|
15241
15281
|
/**
|
|
15242
15282
|
* Write unsigned 64 bit integer.
|
|
15243
15283
|
*
|
|
15244
|
-
* @param {
|
|
15284
|
+
* @param {BigValue} value - value as int
|
|
15245
15285
|
*/
|
|
15246
15286
|
writeUInt64LE(value) {
|
|
15247
15287
|
return this.writeInt64(value, true, "little");
|
|
@@ -15249,7 +15289,7 @@ class BiBaseStreamer {
|
|
|
15249
15289
|
/**
|
|
15250
15290
|
* Write signed 64 bit integer.
|
|
15251
15291
|
*
|
|
15252
|
-
* @param {
|
|
15292
|
+
* @param {BigValue} value - value as int
|
|
15253
15293
|
*/
|
|
15254
15294
|
writeInt64BE(value) {
|
|
15255
15295
|
return this.writeInt64(value, false, "big");
|
|
@@ -15257,7 +15297,7 @@ class BiBaseStreamer {
|
|
|
15257
15297
|
/**
|
|
15258
15298
|
* Write unsigned 64 bit integer.
|
|
15259
15299
|
*
|
|
15260
|
-
* @param {
|
|
15300
|
+
* @param {BigValue} value - value as int
|
|
15261
15301
|
*/
|
|
15262
15302
|
writeUInt64BE(value) {
|
|
15263
15303
|
return this.writeInt64(value, true, "big");
|