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.cjs.js
CHANGED
|
@@ -1834,6 +1834,16 @@ class BiBase {
|
|
|
1834
1834
|
this.insert(data, consume, start);
|
|
1835
1835
|
return data.length;
|
|
1836
1836
|
}
|
|
1837
|
+
/**
|
|
1838
|
+
* Dummy function, not needed on Non-Stream
|
|
1839
|
+
*/
|
|
1840
|
+
renameFile() {
|
|
1841
|
+
}
|
|
1842
|
+
/**
|
|
1843
|
+
* Dummy function, not needed on Non-Stream
|
|
1844
|
+
*/
|
|
1845
|
+
deleteFile() {
|
|
1846
|
+
}
|
|
1837
1847
|
/**
|
|
1838
1848
|
* Dummy function, not needed on Non-Stream
|
|
1839
1849
|
*/
|
|
@@ -2271,7 +2281,7 @@ class BiBase {
|
|
|
2271
2281
|
*
|
|
2272
2282
|
* Does not change current read position.
|
|
2273
2283
|
*
|
|
2274
|
-
* @param {
|
|
2284
|
+
* @param {BigValue} value - Number to search for.
|
|
2275
2285
|
* @param {boolean} unsigned - If the number is unsigned (default true)
|
|
2276
2286
|
* @param {endian} endian - endianness of value (default set endian).
|
|
2277
2287
|
*/
|
|
@@ -3449,7 +3459,7 @@ class BiBase {
|
|
|
3449
3459
|
/**
|
|
3450
3460
|
* Write 64 bit integer.
|
|
3451
3461
|
*
|
|
3452
|
-
* @param {
|
|
3462
|
+
* @param {BigValue} value - value as int
|
|
3453
3463
|
* @param {boolean} unsigned - if the value is unsigned
|
|
3454
3464
|
* @param {endian} endian - ``big`` or ``little``
|
|
3455
3465
|
*/
|
|
@@ -3459,7 +3469,7 @@ class BiBase {
|
|
|
3459
3469
|
/**
|
|
3460
3470
|
* Write unsigned 64 bit integer.
|
|
3461
3471
|
*
|
|
3462
|
-
* @param {
|
|
3472
|
+
* @param {BigValue} value - value as int
|
|
3463
3473
|
* @param {endian} endian - ``big`` or ``little``
|
|
3464
3474
|
*/
|
|
3465
3475
|
writeUInt64(value, endian) {
|
|
@@ -3468,7 +3478,7 @@ class BiBase {
|
|
|
3468
3478
|
/**
|
|
3469
3479
|
* Write signed 64 bit integer.
|
|
3470
3480
|
*
|
|
3471
|
-
* @param {
|
|
3481
|
+
* @param {BigValue} value - value as int
|
|
3472
3482
|
*/
|
|
3473
3483
|
writeInt64LE(value) {
|
|
3474
3484
|
return this.writeInt64(value, false, "little");
|
|
@@ -3476,7 +3486,7 @@ class BiBase {
|
|
|
3476
3486
|
/**
|
|
3477
3487
|
* Write unsigned 64 bit integer.
|
|
3478
3488
|
*
|
|
3479
|
-
* @param {
|
|
3489
|
+
* @param {BigValue} value - value as int
|
|
3480
3490
|
*/
|
|
3481
3491
|
writeUInt64LE(value) {
|
|
3482
3492
|
return this.writeInt64(value, true, "little");
|
|
@@ -3484,7 +3494,7 @@ class BiBase {
|
|
|
3484
3494
|
/**
|
|
3485
3495
|
* Write signed 64 bit integer.
|
|
3486
3496
|
*
|
|
3487
|
-
* @param {
|
|
3497
|
+
* @param {BigValue} value - value as int
|
|
3488
3498
|
*/
|
|
3489
3499
|
writeInt64BE(value) {
|
|
3490
3500
|
return this.writeInt64(value, false, "big");
|
|
@@ -3492,7 +3502,7 @@ class BiBase {
|
|
|
3492
3502
|
/**
|
|
3493
3503
|
* Write unsigned 64 bit integer.
|
|
3494
3504
|
*
|
|
3495
|
-
* @param {
|
|
3505
|
+
* @param {BigValue} value - value as int
|
|
3496
3506
|
*/
|
|
3497
3507
|
writeUInt64BE(value) {
|
|
3498
3508
|
return this.writeInt64(value, true, "big");
|
|
@@ -10080,7 +10090,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10080
10090
|
/**
|
|
10081
10091
|
* Write 64 bit integer.
|
|
10082
10092
|
*
|
|
10083
|
-
* @param {
|
|
10093
|
+
* @param {BigValue} value - value as int
|
|
10084
10094
|
*/
|
|
10085
10095
|
set int64(value) {
|
|
10086
10096
|
this.writeInt64(value);
|
|
@@ -10088,7 +10098,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10088
10098
|
/**
|
|
10089
10099
|
* Write 64 bit integer.
|
|
10090
10100
|
*
|
|
10091
|
-
* @param {
|
|
10101
|
+
* @param {BigValue} value - value as int
|
|
10092
10102
|
*/
|
|
10093
10103
|
set quad(value) {
|
|
10094
10104
|
this.writeInt64(value);
|
|
@@ -10096,7 +10106,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10096
10106
|
/**
|
|
10097
10107
|
* Write 64 bit integer.
|
|
10098
10108
|
*
|
|
10099
|
-
* @param {
|
|
10109
|
+
* @param {BigValue} value - value as int
|
|
10100
10110
|
*/
|
|
10101
10111
|
set bigint(value) {
|
|
10102
10112
|
this.writeInt64(value);
|
|
@@ -10104,7 +10114,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10104
10114
|
/**
|
|
10105
10115
|
* Write unsigned 64 bit integer.
|
|
10106
10116
|
*
|
|
10107
|
-
* @param {
|
|
10117
|
+
* @param {BigValue} value - value as int
|
|
10108
10118
|
*/
|
|
10109
10119
|
set uint64(value) {
|
|
10110
10120
|
this.writeInt64(value, true);
|
|
@@ -10112,7 +10122,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10112
10122
|
/**
|
|
10113
10123
|
* Write unsigned 64 bit integer.
|
|
10114
10124
|
*
|
|
10115
|
-
* @param {
|
|
10125
|
+
* @param {BigValue} value - value as int
|
|
10116
10126
|
*/
|
|
10117
10127
|
set ubigint(value) {
|
|
10118
10128
|
this.writeInt64(value, true);
|
|
@@ -10120,7 +10130,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10120
10130
|
/**
|
|
10121
10131
|
* Write unsigned 64 bit integer.
|
|
10122
10132
|
*
|
|
10123
|
-
* @param {
|
|
10133
|
+
* @param {BigValue} value - value as int
|
|
10124
10134
|
*/
|
|
10125
10135
|
set uquad(value) {
|
|
10126
10136
|
this.writeInt64(value, true);
|
|
@@ -10128,7 +10138,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10128
10138
|
/**
|
|
10129
10139
|
* Write signed 64 bit integer.
|
|
10130
10140
|
*
|
|
10131
|
-
* @param {
|
|
10141
|
+
* @param {BigValue} value - value as int
|
|
10132
10142
|
*/
|
|
10133
10143
|
set int64le(value) {
|
|
10134
10144
|
this.writeInt64(value, false, "little");
|
|
@@ -10136,7 +10146,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10136
10146
|
/**
|
|
10137
10147
|
* Write signed 64 bit integer.
|
|
10138
10148
|
*
|
|
10139
|
-
* @param {
|
|
10149
|
+
* @param {BigValue} value - value as int
|
|
10140
10150
|
*/
|
|
10141
10151
|
set bigintle(value) {
|
|
10142
10152
|
this.writeInt64(value, false, "little");
|
|
@@ -10144,7 +10154,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10144
10154
|
/**
|
|
10145
10155
|
* Write signed 64 bit integer.
|
|
10146
10156
|
*
|
|
10147
|
-
* @param {
|
|
10157
|
+
* @param {BigValue} value - value as int
|
|
10148
10158
|
*/
|
|
10149
10159
|
set quadle(value) {
|
|
10150
10160
|
this.writeInt64(value, false, "little");
|
|
@@ -10152,7 +10162,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10152
10162
|
/**
|
|
10153
10163
|
* Write unsigned 64 bit integer.
|
|
10154
10164
|
*
|
|
10155
|
-
* @param {
|
|
10165
|
+
* @param {BigValue} value - value as int
|
|
10156
10166
|
*/
|
|
10157
10167
|
set uint64le(value) {
|
|
10158
10168
|
this.writeInt64(value, true, "little");
|
|
@@ -10160,7 +10170,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10160
10170
|
/**
|
|
10161
10171
|
* Write unsigned 64 bit integer.
|
|
10162
10172
|
*
|
|
10163
|
-
* @param {
|
|
10173
|
+
* @param {BigValue} value - value as int
|
|
10164
10174
|
*/
|
|
10165
10175
|
set ubigintle(value) {
|
|
10166
10176
|
this.writeInt64(value, true, "little");
|
|
@@ -10168,7 +10178,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10168
10178
|
/**
|
|
10169
10179
|
* Write unsigned 64 bit integer.
|
|
10170
10180
|
*
|
|
10171
|
-
* @param {
|
|
10181
|
+
* @param {BigValue} value - value as int
|
|
10172
10182
|
*/
|
|
10173
10183
|
set uquadle(value) {
|
|
10174
10184
|
this.writeInt64(value, true, "little");
|
|
@@ -10176,7 +10186,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10176
10186
|
/**
|
|
10177
10187
|
* Write signed 64 bit integer.
|
|
10178
10188
|
*
|
|
10179
|
-
* @param {
|
|
10189
|
+
* @param {BigValue} value - value as int
|
|
10180
10190
|
*/
|
|
10181
10191
|
set int64be(value) {
|
|
10182
10192
|
this.writeInt64(value, false, "big");
|
|
@@ -10184,7 +10194,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10184
10194
|
/**
|
|
10185
10195
|
* Write signed 64 bit integer.
|
|
10186
10196
|
*
|
|
10187
|
-
* @param {
|
|
10197
|
+
* @param {BigValue} value - value as int
|
|
10188
10198
|
*/
|
|
10189
10199
|
set bigintbe(value) {
|
|
10190
10200
|
this.writeInt64(value, false, "big");
|
|
@@ -10192,7 +10202,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10192
10202
|
/**
|
|
10193
10203
|
* Write signed 64 bit integer.
|
|
10194
10204
|
*
|
|
10195
|
-
* @param {
|
|
10205
|
+
* @param {BigValue} value - value as int
|
|
10196
10206
|
*/
|
|
10197
10207
|
set quadbe(value) {
|
|
10198
10208
|
this.writeInt64(value, false, "big");
|
|
@@ -10200,7 +10210,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10200
10210
|
/**
|
|
10201
10211
|
* Write unsigned 64 bit integer.
|
|
10202
10212
|
*
|
|
10203
|
-
* @param {
|
|
10213
|
+
* @param {BigValue} value - value as int
|
|
10204
10214
|
*/
|
|
10205
10215
|
set uint64be(value) {
|
|
10206
10216
|
this.writeInt64(value, true, "big");
|
|
@@ -10208,7 +10218,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10208
10218
|
/**
|
|
10209
10219
|
* Write unsigned 64 bit integer.
|
|
10210
10220
|
*
|
|
10211
|
-
* @param {
|
|
10221
|
+
* @param {BigValue} value - value as int
|
|
10212
10222
|
*/
|
|
10213
10223
|
set ubigintbe(value) {
|
|
10214
10224
|
this.writeInt64(value, true, "big");
|
|
@@ -10216,7 +10226,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10216
10226
|
/**
|
|
10217
10227
|
* Write unsigned 64 bit integer.
|
|
10218
10228
|
*
|
|
10219
|
-
* @param {
|
|
10229
|
+
* @param {BigValue} value - value as int
|
|
10220
10230
|
*/
|
|
10221
10231
|
set uquadbe(value) {
|
|
10222
10232
|
this.writeInt64(value, true, "big");
|
|
@@ -13603,6 +13613,36 @@ class BiBaseStreamer {
|
|
|
13603
13613
|
}
|
|
13604
13614
|
return this.write(this.offset, this.data, consume);
|
|
13605
13615
|
}
|
|
13616
|
+
/**
|
|
13617
|
+
* Renames the file you are working on.
|
|
13618
|
+
*
|
|
13619
|
+
* Must be full file path and file name.
|
|
13620
|
+
*
|
|
13621
|
+
* Keeps write / read position.
|
|
13622
|
+
*
|
|
13623
|
+
* Note: This is permanent and can't be undone.
|
|
13624
|
+
*
|
|
13625
|
+
* @param {string} newFilePath - New full file path and name.
|
|
13626
|
+
*/
|
|
13627
|
+
renameFile(newFilePath) {
|
|
13628
|
+
fs.closeSync(this.fd);
|
|
13629
|
+
this.fd = null;
|
|
13630
|
+
fs.renameSync(this.filePath, newFilePath);
|
|
13631
|
+
this.filePath = newFilePath;
|
|
13632
|
+
this.open();
|
|
13633
|
+
}
|
|
13634
|
+
/**
|
|
13635
|
+
* Deletes the working file.
|
|
13636
|
+
*
|
|
13637
|
+
* Note: This is permanentand can't be undone.
|
|
13638
|
+
*
|
|
13639
|
+
* It doesn't send the file to the recycling bin for recovery.
|
|
13640
|
+
*/
|
|
13641
|
+
deleteFile() {
|
|
13642
|
+
fs.closeSync(this.fd);
|
|
13643
|
+
this.fd = null;
|
|
13644
|
+
fs.unlinkSync(this.filePath);
|
|
13645
|
+
}
|
|
13606
13646
|
/**
|
|
13607
13647
|
* internal extend
|
|
13608
13648
|
*
|
|
@@ -14057,7 +14097,7 @@ class BiBaseStreamer {
|
|
|
14057
14097
|
*
|
|
14058
14098
|
* Does not change current read position.
|
|
14059
14099
|
*
|
|
14060
|
-
* @param {
|
|
14100
|
+
* @param {BigValue} value - Number to search for.
|
|
14061
14101
|
* @param {boolean} unsigned - If the number is unsigned (default true)
|
|
14062
14102
|
* @param {endian} endian - endianness of value (default set endian).
|
|
14063
14103
|
*/
|
|
@@ -15235,7 +15275,7 @@ class BiBaseStreamer {
|
|
|
15235
15275
|
/**
|
|
15236
15276
|
* Write 64 bit integer.
|
|
15237
15277
|
*
|
|
15238
|
-
* @param {
|
|
15278
|
+
* @param {BigValue} value - value as int
|
|
15239
15279
|
* @param {boolean} unsigned - if the value is unsigned
|
|
15240
15280
|
* @param {endian} endian - ``big`` or ``little``
|
|
15241
15281
|
*/
|
|
@@ -15245,7 +15285,7 @@ class BiBaseStreamer {
|
|
|
15245
15285
|
/**
|
|
15246
15286
|
* Write unsigned 64 bit integer.
|
|
15247
15287
|
*
|
|
15248
|
-
* @param {
|
|
15288
|
+
* @param {BigValue} value - value as int
|
|
15249
15289
|
* @param {endian} endian - ``big`` or ``little``
|
|
15250
15290
|
*/
|
|
15251
15291
|
writeUInt64(value, endian) {
|
|
@@ -15254,7 +15294,7 @@ class BiBaseStreamer {
|
|
|
15254
15294
|
/**
|
|
15255
15295
|
* Write signed 64 bit integer.
|
|
15256
15296
|
*
|
|
15257
|
-
* @param {
|
|
15297
|
+
* @param {BigValue} value - value as int
|
|
15258
15298
|
*/
|
|
15259
15299
|
writeInt64LE(value) {
|
|
15260
15300
|
return this.writeInt64(value, false, "little");
|
|
@@ -15262,7 +15302,7 @@ class BiBaseStreamer {
|
|
|
15262
15302
|
/**
|
|
15263
15303
|
* Write unsigned 64 bit integer.
|
|
15264
15304
|
*
|
|
15265
|
-
* @param {
|
|
15305
|
+
* @param {BigValue} value - value as int
|
|
15266
15306
|
*/
|
|
15267
15307
|
writeUInt64LE(value) {
|
|
15268
15308
|
return this.writeInt64(value, true, "little");
|
|
@@ -15270,7 +15310,7 @@ class BiBaseStreamer {
|
|
|
15270
15310
|
/**
|
|
15271
15311
|
* Write signed 64 bit integer.
|
|
15272
15312
|
*
|
|
15273
|
-
* @param {
|
|
15313
|
+
* @param {BigValue} value - value as int
|
|
15274
15314
|
*/
|
|
15275
15315
|
writeInt64BE(value) {
|
|
15276
15316
|
return this.writeInt64(value, false, "big");
|
|
@@ -15278,7 +15318,7 @@ class BiBaseStreamer {
|
|
|
15278
15318
|
/**
|
|
15279
15319
|
* Write unsigned 64 bit integer.
|
|
15280
15320
|
*
|
|
15281
|
-
* @param {
|
|
15321
|
+
* @param {BigValue} value - value as int
|
|
15282
15322
|
*/
|
|
15283
15323
|
writeUInt64BE(value) {
|
|
15284
15324
|
return this.writeInt64(value, true, "big");
|