bireader 3.1.7 → 3.1.8
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/dist/index.browser.d.ts +30 -4
- package/dist/index.browser.js +32 -6
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs.d.ts +62 -8
- package/dist/index.cjs.js +64 -10
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +62 -8
- package/dist/index.esm.d.ts +62 -8
- package/dist/index.esm.js +64 -10
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -7478,7 +7478,6 @@ interface BinaryAliasReaderStreamer extends BiBaseStreamer {
|
|
|
7478
7478
|
wpstring4le(stripNull?: stringOptions["stripNull"]): string;
|
|
7479
7479
|
}
|
|
7480
7480
|
|
|
7481
|
-
declare const BiReaderBase: typeof BiBase;
|
|
7482
7481
|
/**
|
|
7483
7482
|
* Binary reader, includes bitfields and strings.
|
|
7484
7483
|
*
|
|
@@ -7492,7 +7491,7 @@ declare const BiReaderBase: typeof BiBase;
|
|
|
7492
7491
|
*
|
|
7493
7492
|
* @since 2.0
|
|
7494
7493
|
*/
|
|
7495
|
-
declare class
|
|
7494
|
+
declare class BiRead extends BiBase implements BinaryAliasReader {
|
|
7496
7495
|
/**
|
|
7497
7496
|
* Binary reader, includes bitfields and strings.
|
|
7498
7497
|
*
|
|
@@ -7812,6 +7811,20 @@ declare class BiReader extends BiReaderBase implements BinaryAliasReader {
|
|
|
7812
7811
|
wpstring4be(stripNull?: stringOptions["stripNull"]): string;
|
|
7813
7812
|
wpstring4le(stripNull?: stringOptions["stripNull"]): string;
|
|
7814
7813
|
}
|
|
7814
|
+
/**
|
|
7815
|
+
* Binary reader, includes bitfields and strings.
|
|
7816
|
+
*
|
|
7817
|
+
* @param {Buffer|Uint8Array} data - ``Buffer`` or ``Uint8Array``. Always found in ``BiReader.data``
|
|
7818
|
+
* @param {BiOptions?} options - Any options to set at start
|
|
7819
|
+
* @param {number?} options.byteOffset - Byte offset to start reader (default ``0``)
|
|
7820
|
+
* @param {number?} options.bitOffset - Bit offset 0-7 to start reader (default ``0``)
|
|
7821
|
+
* @param {string?} options.endianness - Endianness ``big`` or ``little`` (default ``little``)
|
|
7822
|
+
* @param {boolean?} options.strict - Strict mode: if ``true`` does not extend supplied array on outside write (default ``true``)
|
|
7823
|
+
* @param {number?} options.extendBufferSize - Amount of data to add when extending the buffer array when strict mode is false. Note: Changes logic in ``.get`` and ``.return``.
|
|
7824
|
+
*
|
|
7825
|
+
* @since 2.0
|
|
7826
|
+
*/
|
|
7827
|
+
declare const BiReader: typeof BiRead;
|
|
7815
7828
|
|
|
7816
7829
|
interface BinaryAliasWriter extends BiBase {
|
|
7817
7830
|
/**
|
|
@@ -12458,7 +12471,6 @@ interface BinaryAliasWriterStreamer extends BiBaseStreamer {
|
|
|
12458
12471
|
wpstring4be(string: string): void;
|
|
12459
12472
|
}
|
|
12460
12473
|
|
|
12461
|
-
declare const BiWriterBase: typeof BiBase;
|
|
12462
12474
|
/**
|
|
12463
12475
|
* Binary writer, includes bitfields and strings.
|
|
12464
12476
|
*
|
|
@@ -12472,7 +12484,7 @@ declare const BiWriterBase: typeof BiBase;
|
|
|
12472
12484
|
*
|
|
12473
12485
|
* @since 2.0
|
|
12474
12486
|
*/
|
|
12475
|
-
declare class
|
|
12487
|
+
declare class BiWrite extends BiBase implements BinaryAliasWriter {
|
|
12476
12488
|
/**
|
|
12477
12489
|
* Binary writer, includes bitfields and strings.
|
|
12478
12490
|
*
|
|
@@ -12797,8 +12809,21 @@ declare class BiWriter extends BiWriterBase implements BinaryAliasWriter {
|
|
|
12797
12809
|
wpstring4le(string: string): void;
|
|
12798
12810
|
wpstring4be(string: string): void;
|
|
12799
12811
|
}
|
|
12812
|
+
/**
|
|
12813
|
+
* Binary writer, includes bitfields and strings.
|
|
12814
|
+
*
|
|
12815
|
+
* @param {Buffer|Uint8Array} data - ``Buffer`` or ``Uint8Array``. Always found in ``BiWriter.data``
|
|
12816
|
+
* @param {BiOptions?} options - Any options to set at start
|
|
12817
|
+
* @param {BiOptions["byteOffset"]?} options.byteOffset - Byte offset to start writer (default ``0``)
|
|
12818
|
+
* @param {BiOptions["bitOffset"]?} options.bitOffset - Bit offset 0-7 to start writer (default ``0``)
|
|
12819
|
+
* @param {BiOptions["endianness"]?} options.endianness - Endianness ``big`` or ``little`` (default ``little``)
|
|
12820
|
+
* @param {BiOptions["strict"]?} options.strict - Strict mode: if ``true`` does not extend supplied array on outside write (default ``false``)
|
|
12821
|
+
* @param {BiOptions["extendBufferSize"]?} options.extendBufferSize - Amount of data to add when extending the buffer array when strict mode is false. Note: Changes logic in ``.get`` and ``.return``.
|
|
12822
|
+
*
|
|
12823
|
+
* @since 2.0
|
|
12824
|
+
*/
|
|
12825
|
+
declare const BiWriter: typeof BiWrite;
|
|
12800
12826
|
|
|
12801
|
-
declare const BiReaderStreamer: typeof BiBaseStreamer;
|
|
12802
12827
|
/**
|
|
12803
12828
|
* Binary reader, includes bitfields and strings.
|
|
12804
12829
|
*
|
|
@@ -12812,7 +12837,7 @@ declare const BiReaderStreamer: typeof BiBaseStreamer;
|
|
|
12812
12837
|
*
|
|
12813
12838
|
* @since 3.1
|
|
12814
12839
|
*/
|
|
12815
|
-
declare class
|
|
12840
|
+
declare class BiReaderStreamer extends BiBaseStreamer implements BinaryAliasReaderStreamer {
|
|
12816
12841
|
/**
|
|
12817
12842
|
* Binary reader, includes bitfields and strings.
|
|
12818
12843
|
*
|
|
@@ -13134,8 +13159,21 @@ declare class BiReaderStream extends BiReaderStreamer implements BinaryAliasRead
|
|
|
13134
13159
|
wpstring4be(stripNull?: stringOptions["stripNull"]): string;
|
|
13135
13160
|
wpstring4le(stripNull?: stringOptions["stripNull"]): string;
|
|
13136
13161
|
}
|
|
13162
|
+
/**
|
|
13163
|
+
* Binary reader, includes bitfields and strings.
|
|
13164
|
+
*
|
|
13165
|
+
* @param {string} filePath - Path to file
|
|
13166
|
+
* @param {BiOptions?} options - Any options to set at start
|
|
13167
|
+
* @param {number?} options.byteOffset - Byte offset to start reader (default ``0``)
|
|
13168
|
+
* @param {number?} options.bitOffset - Bit offset 0-7 to start reader (default ``0``)
|
|
13169
|
+
* @param {string?} options.endianness - Endianness ``big`` or ``little`` (default ``little``)
|
|
13170
|
+
* @param {boolean?} options.strict - Strict mode: if ``true`` does not extend supplied array on outside write (default ``true``)
|
|
13171
|
+
* @param {number?} options.extendBufferSize - Amount of data to add when extending the buffer array when strict mode is false. Note: Changes logic in ``.get`` and ``.return``.
|
|
13172
|
+
*
|
|
13173
|
+
* @since 3.1
|
|
13174
|
+
*/
|
|
13175
|
+
declare const BiReaderStream: typeof BiReaderStreamer;
|
|
13137
13176
|
|
|
13138
|
-
declare const BiWriterStreamer: typeof BiBaseStreamer;
|
|
13139
13177
|
/**
|
|
13140
13178
|
* Binary writer, includes bitfields and strings.
|
|
13141
13179
|
*
|
|
@@ -13151,7 +13189,7 @@ declare const BiWriterStreamer: typeof BiBaseStreamer;
|
|
|
13151
13189
|
*
|
|
13152
13190
|
* @since 3.1
|
|
13153
13191
|
*/
|
|
13154
|
-
declare class
|
|
13192
|
+
declare class BiWriterStreamer extends BiBaseStreamer implements BinaryAliasWriterStreamer {
|
|
13155
13193
|
/**
|
|
13156
13194
|
* Binary writer, includes bitfields and strings.
|
|
13157
13195
|
*
|
|
@@ -13478,6 +13516,22 @@ declare class BiWriterStream extends BiWriterStreamer implements BinaryAliasWrit
|
|
|
13478
13516
|
wpstring4le(string: string): void;
|
|
13479
13517
|
wpstring4be(string: string): void;
|
|
13480
13518
|
}
|
|
13519
|
+
/**
|
|
13520
|
+
* Binary writer, includes bitfields and strings.
|
|
13521
|
+
*
|
|
13522
|
+
* Note: Must start with .open() before writing.
|
|
13523
|
+
*
|
|
13524
|
+
* @param {string} filePath - Path to file
|
|
13525
|
+
* @param {BiOptions?} options - Any options to set at start
|
|
13526
|
+
* @param {BiOptions["byteOffset"]?} options.byteOffset - Byte offset to start writer (default ``0``)
|
|
13527
|
+
* @param {BiOptions["bitOffset"]?} options.bitOffset - Bit offset 0-7 to start writer (default ``0``)
|
|
13528
|
+
* @param {BiOptions["endianness"]?} options.endianness - Endianness ``big`` or ``little`` (default ``little``)
|
|
13529
|
+
* @param {BiOptions["strict"]?} options.strict - Strict mode: if ``true`` does not extend supplied array on outside write (default ``false``)
|
|
13530
|
+
* @param {BiOptions["extendBufferSize"]?} options.extendBufferSize - Amount of data to add when extending the buffer array when strict mode is false. Note: Changes logic in ``.get`` and ``.return``.
|
|
13531
|
+
*
|
|
13532
|
+
* @since 3.1
|
|
13533
|
+
*/
|
|
13534
|
+
declare const BiWriterStream: typeof BiWriterStreamer;
|
|
13481
13535
|
|
|
13482
13536
|
/**
|
|
13483
13537
|
* Not in use anymore.
|
package/dist/index.esm.d.ts
CHANGED
|
@@ -7478,7 +7478,6 @@ interface BinaryAliasReaderStreamer extends BiBaseStreamer {
|
|
|
7478
7478
|
wpstring4le(stripNull?: stringOptions["stripNull"]): string;
|
|
7479
7479
|
}
|
|
7480
7480
|
|
|
7481
|
-
declare const BiReaderBase: typeof BiBase;
|
|
7482
7481
|
/**
|
|
7483
7482
|
* Binary reader, includes bitfields and strings.
|
|
7484
7483
|
*
|
|
@@ -7492,7 +7491,7 @@ declare const BiReaderBase: typeof BiBase;
|
|
|
7492
7491
|
*
|
|
7493
7492
|
* @since 2.0
|
|
7494
7493
|
*/
|
|
7495
|
-
declare class
|
|
7494
|
+
declare class BiRead extends BiBase implements BinaryAliasReader {
|
|
7496
7495
|
/**
|
|
7497
7496
|
* Binary reader, includes bitfields and strings.
|
|
7498
7497
|
*
|
|
@@ -7812,6 +7811,20 @@ declare class BiReader extends BiReaderBase implements BinaryAliasReader {
|
|
|
7812
7811
|
wpstring4be(stripNull?: stringOptions["stripNull"]): string;
|
|
7813
7812
|
wpstring4le(stripNull?: stringOptions["stripNull"]): string;
|
|
7814
7813
|
}
|
|
7814
|
+
/**
|
|
7815
|
+
* Binary reader, includes bitfields and strings.
|
|
7816
|
+
*
|
|
7817
|
+
* @param {Buffer|Uint8Array} data - ``Buffer`` or ``Uint8Array``. Always found in ``BiReader.data``
|
|
7818
|
+
* @param {BiOptions?} options - Any options to set at start
|
|
7819
|
+
* @param {number?} options.byteOffset - Byte offset to start reader (default ``0``)
|
|
7820
|
+
* @param {number?} options.bitOffset - Bit offset 0-7 to start reader (default ``0``)
|
|
7821
|
+
* @param {string?} options.endianness - Endianness ``big`` or ``little`` (default ``little``)
|
|
7822
|
+
* @param {boolean?} options.strict - Strict mode: if ``true`` does not extend supplied array on outside write (default ``true``)
|
|
7823
|
+
* @param {number?} options.extendBufferSize - Amount of data to add when extending the buffer array when strict mode is false. Note: Changes logic in ``.get`` and ``.return``.
|
|
7824
|
+
*
|
|
7825
|
+
* @since 2.0
|
|
7826
|
+
*/
|
|
7827
|
+
declare const BiReader: typeof BiRead;
|
|
7815
7828
|
|
|
7816
7829
|
interface BinaryAliasWriter extends BiBase {
|
|
7817
7830
|
/**
|
|
@@ -12458,7 +12471,6 @@ interface BinaryAliasWriterStreamer extends BiBaseStreamer {
|
|
|
12458
12471
|
wpstring4be(string: string): void;
|
|
12459
12472
|
}
|
|
12460
12473
|
|
|
12461
|
-
declare const BiWriterBase: typeof BiBase;
|
|
12462
12474
|
/**
|
|
12463
12475
|
* Binary writer, includes bitfields and strings.
|
|
12464
12476
|
*
|
|
@@ -12472,7 +12484,7 @@ declare const BiWriterBase: typeof BiBase;
|
|
|
12472
12484
|
*
|
|
12473
12485
|
* @since 2.0
|
|
12474
12486
|
*/
|
|
12475
|
-
declare class
|
|
12487
|
+
declare class BiWrite extends BiBase implements BinaryAliasWriter {
|
|
12476
12488
|
/**
|
|
12477
12489
|
* Binary writer, includes bitfields and strings.
|
|
12478
12490
|
*
|
|
@@ -12797,8 +12809,21 @@ declare class BiWriter extends BiWriterBase implements BinaryAliasWriter {
|
|
|
12797
12809
|
wpstring4le(string: string): void;
|
|
12798
12810
|
wpstring4be(string: string): void;
|
|
12799
12811
|
}
|
|
12812
|
+
/**
|
|
12813
|
+
* Binary writer, includes bitfields and strings.
|
|
12814
|
+
*
|
|
12815
|
+
* @param {Buffer|Uint8Array} data - ``Buffer`` or ``Uint8Array``. Always found in ``BiWriter.data``
|
|
12816
|
+
* @param {BiOptions?} options - Any options to set at start
|
|
12817
|
+
* @param {BiOptions["byteOffset"]?} options.byteOffset - Byte offset to start writer (default ``0``)
|
|
12818
|
+
* @param {BiOptions["bitOffset"]?} options.bitOffset - Bit offset 0-7 to start writer (default ``0``)
|
|
12819
|
+
* @param {BiOptions["endianness"]?} options.endianness - Endianness ``big`` or ``little`` (default ``little``)
|
|
12820
|
+
* @param {BiOptions["strict"]?} options.strict - Strict mode: if ``true`` does not extend supplied array on outside write (default ``false``)
|
|
12821
|
+
* @param {BiOptions["extendBufferSize"]?} options.extendBufferSize - Amount of data to add when extending the buffer array when strict mode is false. Note: Changes logic in ``.get`` and ``.return``.
|
|
12822
|
+
*
|
|
12823
|
+
* @since 2.0
|
|
12824
|
+
*/
|
|
12825
|
+
declare const BiWriter: typeof BiWrite;
|
|
12800
12826
|
|
|
12801
|
-
declare const BiReaderStreamer: typeof BiBaseStreamer;
|
|
12802
12827
|
/**
|
|
12803
12828
|
* Binary reader, includes bitfields and strings.
|
|
12804
12829
|
*
|
|
@@ -12812,7 +12837,7 @@ declare const BiReaderStreamer: typeof BiBaseStreamer;
|
|
|
12812
12837
|
*
|
|
12813
12838
|
* @since 3.1
|
|
12814
12839
|
*/
|
|
12815
|
-
declare class
|
|
12840
|
+
declare class BiReaderStreamer extends BiBaseStreamer implements BinaryAliasReaderStreamer {
|
|
12816
12841
|
/**
|
|
12817
12842
|
* Binary reader, includes bitfields and strings.
|
|
12818
12843
|
*
|
|
@@ -13134,8 +13159,21 @@ declare class BiReaderStream extends BiReaderStreamer implements BinaryAliasRead
|
|
|
13134
13159
|
wpstring4be(stripNull?: stringOptions["stripNull"]): string;
|
|
13135
13160
|
wpstring4le(stripNull?: stringOptions["stripNull"]): string;
|
|
13136
13161
|
}
|
|
13162
|
+
/**
|
|
13163
|
+
* Binary reader, includes bitfields and strings.
|
|
13164
|
+
*
|
|
13165
|
+
* @param {string} filePath - Path to file
|
|
13166
|
+
* @param {BiOptions?} options - Any options to set at start
|
|
13167
|
+
* @param {number?} options.byteOffset - Byte offset to start reader (default ``0``)
|
|
13168
|
+
* @param {number?} options.bitOffset - Bit offset 0-7 to start reader (default ``0``)
|
|
13169
|
+
* @param {string?} options.endianness - Endianness ``big`` or ``little`` (default ``little``)
|
|
13170
|
+
* @param {boolean?} options.strict - Strict mode: if ``true`` does not extend supplied array on outside write (default ``true``)
|
|
13171
|
+
* @param {number?} options.extendBufferSize - Amount of data to add when extending the buffer array when strict mode is false. Note: Changes logic in ``.get`` and ``.return``.
|
|
13172
|
+
*
|
|
13173
|
+
* @since 3.1
|
|
13174
|
+
*/
|
|
13175
|
+
declare const BiReaderStream: typeof BiReaderStreamer;
|
|
13137
13176
|
|
|
13138
|
-
declare const BiWriterStreamer: typeof BiBaseStreamer;
|
|
13139
13177
|
/**
|
|
13140
13178
|
* Binary writer, includes bitfields and strings.
|
|
13141
13179
|
*
|
|
@@ -13151,7 +13189,7 @@ declare const BiWriterStreamer: typeof BiBaseStreamer;
|
|
|
13151
13189
|
*
|
|
13152
13190
|
* @since 3.1
|
|
13153
13191
|
*/
|
|
13154
|
-
declare class
|
|
13192
|
+
declare class BiWriterStreamer extends BiBaseStreamer implements BinaryAliasWriterStreamer {
|
|
13155
13193
|
/**
|
|
13156
13194
|
* Binary writer, includes bitfields and strings.
|
|
13157
13195
|
*
|
|
@@ -13478,6 +13516,22 @@ declare class BiWriterStream extends BiWriterStreamer implements BinaryAliasWrit
|
|
|
13478
13516
|
wpstring4le(string: string): void;
|
|
13479
13517
|
wpstring4be(string: string): void;
|
|
13480
13518
|
}
|
|
13519
|
+
/**
|
|
13520
|
+
* Binary writer, includes bitfields and strings.
|
|
13521
|
+
*
|
|
13522
|
+
* Note: Must start with .open() before writing.
|
|
13523
|
+
*
|
|
13524
|
+
* @param {string} filePath - Path to file
|
|
13525
|
+
* @param {BiOptions?} options - Any options to set at start
|
|
13526
|
+
* @param {BiOptions["byteOffset"]?} options.byteOffset - Byte offset to start writer (default ``0``)
|
|
13527
|
+
* @param {BiOptions["bitOffset"]?} options.bitOffset - Bit offset 0-7 to start writer (default ``0``)
|
|
13528
|
+
* @param {BiOptions["endianness"]?} options.endianness - Endianness ``big`` or ``little`` (default ``little``)
|
|
13529
|
+
* @param {BiOptions["strict"]?} options.strict - Strict mode: if ``true`` does not extend supplied array on outside write (default ``false``)
|
|
13530
|
+
* @param {BiOptions["extendBufferSize"]?} options.extendBufferSize - Amount of data to add when extending the buffer array when strict mode is false. Note: Changes logic in ``.get`` and ``.return``.
|
|
13531
|
+
*
|
|
13532
|
+
* @since 3.1
|
|
13533
|
+
*/
|
|
13534
|
+
declare const BiWriterStream: typeof BiWriterStreamer;
|
|
13481
13535
|
|
|
13482
13536
|
/**
|
|
13483
13537
|
* Not in use anymore.
|
package/dist/index.esm.js
CHANGED
|
@@ -66,7 +66,7 @@ function _hexDump(data, options = {}, start, end) {
|
|
|
66
66
|
var addr = "";
|
|
67
67
|
for (let i = start; i < end; i += 16) {
|
|
68
68
|
addr = i.toString(16).padStart(5, '0');
|
|
69
|
-
var row = data.
|
|
69
|
+
var row = data.subarray(i, i + 16) || [];
|
|
70
70
|
var hex = Array.from(row, (byte) => byte.toString(16).padStart(2, '0')).join(' ');
|
|
71
71
|
rows.push(`${addr} ${hex.padEnd(47)} `);
|
|
72
72
|
}
|
|
@@ -370,7 +370,7 @@ function remove$1(ctx, startOffset, endOffset, consume, remove, fillValue) {
|
|
|
370
370
|
ctx.errorDump ? console.log("[Error], hexdump:\n" + ctx.hexdump({ returnString: true })) : "";
|
|
371
371
|
throw new Error("\x1b[33m[Strict mode]\x1b[0m: Can not remove data in strict mode: endOffset " + endOffset + " of " + ctx.size);
|
|
372
372
|
}
|
|
373
|
-
const data_removed = ctx.data.
|
|
373
|
+
const data_removed = ctx.data.subarray(new_start, new_offset);
|
|
374
374
|
if (remove) {
|
|
375
375
|
const part1 = ctx.data.subarray(0, new_start);
|
|
376
376
|
const part2 = ctx.data.subarray(new_offset, ctx.size);
|
|
@@ -6592,7 +6592,6 @@ function applyBinaryAliasReader(Base) {
|
|
|
6592
6592
|
};
|
|
6593
6593
|
}
|
|
6594
6594
|
|
|
6595
|
-
const BiReaderBase = applyBinaryAliasReader(BiBase);
|
|
6596
6595
|
/**
|
|
6597
6596
|
* Binary reader, includes bitfields and strings.
|
|
6598
6597
|
*
|
|
@@ -6606,7 +6605,7 @@ const BiReaderBase = applyBinaryAliasReader(BiBase);
|
|
|
6606
6605
|
*
|
|
6607
6606
|
* @since 2.0
|
|
6608
6607
|
*/
|
|
6609
|
-
class
|
|
6608
|
+
class BiRead extends BiBase {
|
|
6610
6609
|
/**
|
|
6611
6610
|
* Binary reader, includes bitfields and strings.
|
|
6612
6611
|
*
|
|
@@ -7594,6 +7593,20 @@ class BiReader extends BiReaderBase {
|
|
|
7594
7593
|
throw new Error("Method not implemented.");
|
|
7595
7594
|
}
|
|
7596
7595
|
}
|
|
7596
|
+
/**
|
|
7597
|
+
* Binary reader, includes bitfields and strings.
|
|
7598
|
+
*
|
|
7599
|
+
* @param {Buffer|Uint8Array} data - ``Buffer`` or ``Uint8Array``. Always found in ``BiReader.data``
|
|
7600
|
+
* @param {BiOptions?} options - Any options to set at start
|
|
7601
|
+
* @param {number?} options.byteOffset - Byte offset to start reader (default ``0``)
|
|
7602
|
+
* @param {number?} options.bitOffset - Bit offset 0-7 to start reader (default ``0``)
|
|
7603
|
+
* @param {string?} options.endianness - Endianness ``big`` or ``little`` (default ``little``)
|
|
7604
|
+
* @param {boolean?} options.strict - Strict mode: if ``true`` does not extend supplied array on outside write (default ``true``)
|
|
7605
|
+
* @param {number?} options.extendBufferSize - Amount of data to add when extending the buffer array when strict mode is false. Note: Changes logic in ``.get`` and ``.return``.
|
|
7606
|
+
*
|
|
7607
|
+
* @since 2.0
|
|
7608
|
+
*/
|
|
7609
|
+
const BiReader = applyBinaryAliasReader(BiRead);
|
|
7597
7610
|
|
|
7598
7611
|
function applyBinaryAliasWriter(Base) {
|
|
7599
7612
|
return class extends Base {
|
|
@@ -10572,7 +10585,6 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10572
10585
|
};
|
|
10573
10586
|
}
|
|
10574
10587
|
|
|
10575
|
-
const BiWriterBase = applyBinaryAliasWriter(BiBase);
|
|
10576
10588
|
/**
|
|
10577
10589
|
* Binary writer, includes bitfields and strings.
|
|
10578
10590
|
*
|
|
@@ -10586,7 +10598,7 @@ const BiWriterBase = applyBinaryAliasWriter(BiBase);
|
|
|
10586
10598
|
*
|
|
10587
10599
|
* @since 2.0
|
|
10588
10600
|
*/
|
|
10589
|
-
class
|
|
10601
|
+
class BiWrite extends BiBase {
|
|
10590
10602
|
/**
|
|
10591
10603
|
* Binary writer, includes bitfields and strings.
|
|
10592
10604
|
*
|
|
@@ -11594,6 +11606,20 @@ class BiWriter extends BiWriterBase {
|
|
|
11594
11606
|
throw new Error("Method not implemented.");
|
|
11595
11607
|
}
|
|
11596
11608
|
}
|
|
11609
|
+
/**
|
|
11610
|
+
* Binary writer, includes bitfields and strings.
|
|
11611
|
+
*
|
|
11612
|
+
* @param {Buffer|Uint8Array} data - ``Buffer`` or ``Uint8Array``. Always found in ``BiWriter.data``
|
|
11613
|
+
* @param {BiOptions?} options - Any options to set at start
|
|
11614
|
+
* @param {BiOptions["byteOffset"]?} options.byteOffset - Byte offset to start writer (default ``0``)
|
|
11615
|
+
* @param {BiOptions["bitOffset"]?} options.bitOffset - Bit offset 0-7 to start writer (default ``0``)
|
|
11616
|
+
* @param {BiOptions["endianness"]?} options.endianness - Endianness ``big`` or ``little`` (default ``little``)
|
|
11617
|
+
* @param {BiOptions["strict"]?} options.strict - Strict mode: if ``true`` does not extend supplied array on outside write (default ``false``)
|
|
11618
|
+
* @param {BiOptions["extendBufferSize"]?} options.extendBufferSize - Amount of data to add when extending the buffer array when strict mode is false. Note: Changes logic in ``.get`` and ``.return``.
|
|
11619
|
+
*
|
|
11620
|
+
* @since 2.0
|
|
11621
|
+
*/
|
|
11622
|
+
const BiWriter = applyBinaryAliasWriter(BiWrite);
|
|
11597
11623
|
|
|
11598
11624
|
function MAX_LENGTH() {
|
|
11599
11625
|
return buff.constants.MAX_LENGTH;
|
|
@@ -15424,7 +15450,6 @@ class BiBaseStreamer {
|
|
|
15424
15450
|
}
|
|
15425
15451
|
}
|
|
15426
15452
|
|
|
15427
|
-
const BiReaderStreamer = applyBinaryAliasReader(BiBaseStreamer);
|
|
15428
15453
|
/**
|
|
15429
15454
|
* Binary reader, includes bitfields and strings.
|
|
15430
15455
|
*
|
|
@@ -15438,7 +15463,7 @@ const BiReaderStreamer = applyBinaryAliasReader(BiBaseStreamer);
|
|
|
15438
15463
|
*
|
|
15439
15464
|
* @since 3.1
|
|
15440
15465
|
*/
|
|
15441
|
-
class
|
|
15466
|
+
class BiReaderStreamer extends BiBaseStreamer {
|
|
15442
15467
|
/**
|
|
15443
15468
|
* Binary reader, includes bitfields and strings.
|
|
15444
15469
|
*
|
|
@@ -16395,8 +16420,21 @@ class BiReaderStream extends BiReaderStreamer {
|
|
|
16395
16420
|
throw new Error("Method not implemented.");
|
|
16396
16421
|
}
|
|
16397
16422
|
}
|
|
16423
|
+
/**
|
|
16424
|
+
* Binary reader, includes bitfields and strings.
|
|
16425
|
+
*
|
|
16426
|
+
* @param {string} filePath - Path to file
|
|
16427
|
+
* @param {BiOptions?} options - Any options to set at start
|
|
16428
|
+
* @param {number?} options.byteOffset - Byte offset to start reader (default ``0``)
|
|
16429
|
+
* @param {number?} options.bitOffset - Bit offset 0-7 to start reader (default ``0``)
|
|
16430
|
+
* @param {string?} options.endianness - Endianness ``big`` or ``little`` (default ``little``)
|
|
16431
|
+
* @param {boolean?} options.strict - Strict mode: if ``true`` does not extend supplied array on outside write (default ``true``)
|
|
16432
|
+
* @param {number?} options.extendBufferSize - Amount of data to add when extending the buffer array when strict mode is false. Note: Changes logic in ``.get`` and ``.return``.
|
|
16433
|
+
*
|
|
16434
|
+
* @since 3.1
|
|
16435
|
+
*/
|
|
16436
|
+
const BiReaderStream = applyBinaryAliasReader(BiReaderStreamer);
|
|
16398
16437
|
|
|
16399
|
-
const BiWriterStreamer = applyBinaryAliasWriter(BiBaseStreamer);
|
|
16400
16438
|
/**
|
|
16401
16439
|
* Binary writer, includes bitfields and strings.
|
|
16402
16440
|
*
|
|
@@ -16412,7 +16450,7 @@ const BiWriterStreamer = applyBinaryAliasWriter(BiBaseStreamer);
|
|
|
16412
16450
|
*
|
|
16413
16451
|
* @since 3.1
|
|
16414
16452
|
*/
|
|
16415
|
-
class
|
|
16453
|
+
class BiWriterStreamer extends BiBaseStreamer {
|
|
16416
16454
|
/**
|
|
16417
16455
|
* Binary writer, includes bitfields and strings.
|
|
16418
16456
|
*
|
|
@@ -17384,6 +17422,22 @@ class BiWriterStream extends BiWriterStreamer {
|
|
|
17384
17422
|
throw new Error("Method not implemented.");
|
|
17385
17423
|
}
|
|
17386
17424
|
}
|
|
17425
|
+
/**
|
|
17426
|
+
* Binary writer, includes bitfields and strings.
|
|
17427
|
+
*
|
|
17428
|
+
* Note: Must start with .open() before writing.
|
|
17429
|
+
*
|
|
17430
|
+
* @param {string} filePath - Path to file
|
|
17431
|
+
* @param {BiOptions?} options - Any options to set at start
|
|
17432
|
+
* @param {BiOptions["byteOffset"]?} options.byteOffset - Byte offset to start writer (default ``0``)
|
|
17433
|
+
* @param {BiOptions["bitOffset"]?} options.bitOffset - Bit offset 0-7 to start writer (default ``0``)
|
|
17434
|
+
* @param {BiOptions["endianness"]?} options.endianness - Endianness ``big`` or ``little`` (default ``little``)
|
|
17435
|
+
* @param {BiOptions["strict"]?} options.strict - Strict mode: if ``true`` does not extend supplied array on outside write (default ``false``)
|
|
17436
|
+
* @param {BiOptions["extendBufferSize"]?} options.extendBufferSize - Amount of data to add when extending the buffer array when strict mode is false. Note: Changes logic in ``.get`` and ``.return``.
|
|
17437
|
+
*
|
|
17438
|
+
* @since 3.1
|
|
17439
|
+
*/
|
|
17440
|
+
const BiWriterStream = applyBinaryAliasWriter(BiWriterStreamer);
|
|
17387
17441
|
|
|
17388
17442
|
/**
|
|
17389
17443
|
* Not in use anymore.
|