bireader 3.0.0 → 3.1.0

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.
Files changed (55) hide show
  1. package/README.md +91 -29
  2. package/dist/BiReader.d.ts +33 -0
  3. package/dist/BiReaderStream.d.ts +34 -0
  4. package/dist/BiWriter.d.ts +33 -0
  5. package/dist/BiWriterStream.d.ts +36 -0
  6. package/dist/aliases/BinaryAliasReader.d.ts +7 -0
  7. package/dist/aliases/BinaryAliasWriter.d.ts +7 -0
  8. package/dist/common.d.ts +90 -0
  9. package/{build/cjs/common.d.ts → dist/core/BiBase.d.ts} +132 -221
  10. package/dist/core/BiBaseStream.d.ts +1363 -0
  11. package/{build/esm/common.d.ts → dist/index.browser.d.ts} +208 -169
  12. package/dist/index.browser.js +9706 -0
  13. package/dist/index.browser.js.map +1 -0
  14. package/dist/index.cjs.d.ts +2895 -0
  15. package/dist/index.cjs.js +13662 -0
  16. package/dist/index.cjs.js.map +1 -0
  17. package/dist/index.d.ts +2895 -0
  18. package/dist/index.esm.d.ts +2895 -0
  19. package/dist/index.esm.js +13635 -0
  20. package/dist/index.esm.js.map +1 -0
  21. package/dist/indexBrowser.d.ts +19 -0
  22. package/dist/indexImport.d.ts +21 -0
  23. package/package.json +23 -14
  24. package/rollup.config.js +76 -0
  25. package/tsconfig.json +15 -0
  26. package/build/cjs/bireader.d.ts +0 -2372
  27. package/build/cjs/bireader.d.ts.map +0 -1
  28. package/build/cjs/bireader.js +0 -3060
  29. package/build/cjs/bireader.js.map +0 -1
  30. package/build/cjs/biwriter.d.ts +0 -2359
  31. package/build/cjs/biwriter.d.ts.map +0 -1
  32. package/build/cjs/biwriter.js +0 -3094
  33. package/build/cjs/biwriter.js.map +0 -1
  34. package/build/cjs/common.d.ts.map +0 -1
  35. package/build/cjs/common.js +0 -3615
  36. package/build/cjs/common.js.map +0 -1
  37. package/build/cjs/index.d.ts +0 -18
  38. package/build/cjs/index.d.ts.map +0 -1
  39. package/build/cjs/index.js +0 -30
  40. package/build/cjs/index.js.map +0 -1
  41. package/build/esm/bireader.d.ts +0 -2372
  42. package/build/esm/bireader.d.ts.map +0 -1
  43. package/build/esm/bireader.js +0 -3060
  44. package/build/esm/bireader.js.map +0 -1
  45. package/build/esm/biwriter.d.ts +0 -2359
  46. package/build/esm/biwriter.d.ts.map +0 -1
  47. package/build/esm/biwriter.js +0 -3094
  48. package/build/esm/biwriter.js.map +0 -1
  49. package/build/esm/common.d.ts.map +0 -1
  50. package/build/esm/common.js +0 -3615
  51. package/build/esm/common.js.map +0 -1
  52. package/build/esm/index.d.ts +0 -18
  53. package/build/esm/index.d.ts.map +0 -1
  54. package/build/esm/index.js +0 -30
  55. package/build/esm/index.js.map +0 -1
@@ -1,3094 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BiWriter = void 0;
4
- const common_1 = require("./common");
5
- /**
6
- * Binary writer, includes bitfields and strings.
7
- *
8
- * @param {Buffer|Uint8Array} data - ``Buffer`` or ``Uint8Array``. Always found in ``BiWriter.data``
9
- * @param {BiOptions} options - Any options to set at start
10
- * @param {number?} options.byteOffset - Byte offset to start writer, default is ``0``
11
- * @param {number?} options.bitOffset - Bit offset 0-7 to start writer (default ``0``)
12
- * @param {string?} options.endianness - Endianness ``big`` or ``little`` (default ``little``)
13
- * @param {boolean?} options.strict - Strict mode: if ``true`` does not extend supplied array on outside write (default ``false``)
14
- * @param {number?} options.extendBufferSize - Amount of data to add when extending the buffer array when strict mode is false. Note: Changes login in ``.get`` and ``.return``.
15
- *
16
- * @since 2.0
17
- */
18
- class BiWriter extends common_1.ReaderBase {
19
- /**
20
- * Binary writer, includes bitfields and strings.
21
- *
22
- * @param {Buffer|Uint8Array} data - ``Buffer`` or ``Uint8Array``. Always found in ``BiWriter.data``
23
- * @param {BiOptions?} options - Any options to set at start
24
- * @param {number?} options.byteOffset - Byte offset to start writer, default is ``0``
25
- * @param {number?} options.bitOffset - Bit offset 0-7 to start writer (default ``0``)
26
- * @param {string?} options.endianness - Endianness ``big`` or ``little`` (default ``little``)
27
- * @param {boolean?} options.strict - Strict mode: if ``true`` does not extend supplied array on outside write (default ``false``)
28
- * @param {number?} options.extendBufferSize - Amount of data to add when extending the buffer array when strict mode is false. Note: Changes login in ``.get`` and ``.return``.
29
- */
30
- constructor(data, options = {}) {
31
- super();
32
- this.strict = false;
33
- if (data == undefined) {
34
- if (typeof Buffer !== 'undefined') {
35
- this.data = Buffer.alloc(this.offset || 1 + (this.bitoffset != 0 ? 1 : 0));
36
- }
37
- else {
38
- this.data = new Uint8Array(this.offset || 1 + (this.bitoffset != 0 ? 1 : 0));
39
- }
40
- }
41
- else {
42
- if (!this.isBufferOrUint8Array(data)) {
43
- throw new Error("Write data must be Uint8Array or Buffer.");
44
- }
45
- this.data = data;
46
- }
47
- if (options.extendBufferSize != undefined && options.extendBufferSize != 0) {
48
- this.extendBufferSize = options.extendBufferSize;
49
- }
50
- this.size = this.data.length;
51
- this.sizeB = this.data.length * 8;
52
- if (typeof options.strict == "boolean") {
53
- this.strict = options.strict;
54
- }
55
- else {
56
- if (options.strict != undefined) {
57
- throw new Error("Strict mode must be true of false.");
58
- }
59
- }
60
- if (options.endianness != undefined && typeof options.endianness != "string") {
61
- throw new Error("endianness must be big or little.");
62
- }
63
- if (options.endianness != undefined && !(options.endianness == "big" || options.endianness == "little")) {
64
- throw new Error("Endianness must be big or little.");
65
- }
66
- this.endian = options.endianness || "little";
67
- if (options.byteOffset != undefined || options.bitOffset != undefined) {
68
- this.offset = ((Math.abs(options.byteOffset || 0)) + Math.ceil((Math.abs(options.bitOffset || 0)) / 8));
69
- // Adjust byte offset based on bit overflow
70
- this.offset += Math.floor((Math.abs(options.bitOffset || 0)) / 8);
71
- // Adjust bit offset
72
- this.bitoffset = (Math.abs(options.bitOffset || 0) + 64) % 8;
73
- // Ensure bit offset stays between 0-7
74
- this.bitoffset = Math.min(Math.max(this.bitoffset, 0), 7);
75
- // Ensure offset doesn't go negative
76
- this.offset = Math.max(this.offset, 0);
77
- if (this.offset > this.size) {
78
- if (this.strict == false) {
79
- if (this.extendBufferSize != 0) {
80
- this.extendArray(this.extendBufferSize);
81
- }
82
- else {
83
- this.extendArray(this.offset - this.size);
84
- }
85
- }
86
- else {
87
- throw new Error(`Starting offset outside of size: ${this.offset} of ${this.size}`);
88
- }
89
- }
90
- }
91
- }
92
- //
93
- //bit writer
94
- //
95
- /**
96
- * Bit field writer.
97
- *
98
- * Note: When returning to a byte write, remaining bits are dropped.
99
- *
100
- * @param {number} value - value as int
101
- * @param {number} bits - bits to write
102
- * @param {boolean} unsigned - if the value is unsigned
103
- * @param {string} endian - ``big`` or ``little``
104
- * @returns {number}
105
- */
106
- bit(value, bits, unsigned, endian) {
107
- return this.writeBit(value, bits, unsigned, endian);
108
- }
109
- /**
110
- * Bit field writer.
111
- *
112
- * Note: When returning to a byte write, remaining bits are dropped.
113
- *
114
- * @param {number} value - value as int
115
- * @param {number} bits - bits to write
116
- * @param {string} endian - ``big`` or ``little``
117
- * @returns {number}
118
- */
119
- ubit(value, bits, endian) {
120
- return this.writeBit(value, bits, true, endian);
121
- }
122
- /**
123
- * Bit field writer.
124
- *
125
- * Note: When returning to a byte write, remaining bits are dropped.
126
- *
127
- * @param {number} value - value as int
128
- * @param {number} bits - bits to write
129
- * @param {boolean} unsigned - if the value is unsigned
130
- * @returns {number}
131
- */
132
- bitbe(value, bits, unsigned) {
133
- return this.bit(value, bits, unsigned, "big");
134
- }
135
- /**
136
- * Bit field writer.
137
- *
138
- * Note: When returning to a byte write, remaining bits are dropped.
139
- *
140
- * @param {number} value - value as int
141
- * @param {number} bits - bits to write
142
- * @returns {number}
143
- */
144
- ubitbe(value, bits) {
145
- return this.bit(value, bits, true, "big");
146
- }
147
- /**
148
- * Bit field writer.
149
- *
150
- * Note: When returning to a byte write, remaining bits are dropped.
151
- *
152
- * @param {number} value - value as int
153
- * @param {number} bits - bits to write
154
- * @returns {number}
155
- */
156
- ubitle(value, bits) {
157
- return this.bit(value, bits, true, "little");
158
- }
159
- /**
160
- * Bit field writer.
161
- *
162
- * Note: When returning to a byte write, remaining bits are dropped.
163
- *
164
- * @param {number} value - value as int
165
- * @param {number} bits - bits to write
166
- * @param {boolean} unsigned - if the value is unsigned
167
- * @returns {number}
168
- */
169
- bitle(value, bits, unsigned) {
170
- return this.bit(value, bits, unsigned, "little");
171
- }
172
- /**
173
- * Bit field writer. Writes 1 bit.
174
- *
175
- * Note: When returning to a byte write, remaining bits are dropped.
176
- *
177
- * @param {number} value - value as int
178
- */
179
- set bit1(value) {
180
- this.bit(value, 1);
181
- }
182
- /**
183
- * Bit field writer. Writes 1 bit.
184
- *
185
- * Note: When returning to a byte write, remaining bits are dropped.
186
- *
187
- * @param {number} value - value as int
188
- */
189
- set bit1le(value) {
190
- this.bit(value, 1, undefined, "little");
191
- }
192
- /**
193
- * Bit field writer. Writes 1 bit.
194
- *
195
- * Note: When returning to a byte write, remaining bits are dropped.
196
- *
197
- * @param {number} value - value as int
198
- */
199
- set bit1be(value) {
200
- this.bit(value, 1, undefined, "big");
201
- }
202
- /**
203
- * Bit field writer. Writes 1 bit.
204
- *
205
- * Note: When returning to a byte write, remaining bits are dropped.
206
- *
207
- * @param {number} value - value as int
208
- */
209
- set ubit1(value) {
210
- this.bit(value, 1, true);
211
- }
212
- /**
213
- * Bit field writer. Writes 1 bit.
214
- *
215
- * Note: When returning to a byte write, remaining bits are dropped.
216
- *
217
- * @param {number} value - value as int
218
- */
219
- set ubit1le(value) {
220
- this.bit(value, 1, true, "little");
221
- ;
222
- }
223
- /**
224
- * Bit field writer. Writes 1 bit.
225
- *
226
- * Note: When returning to a byte write, remaining bits are dropped.
227
- *
228
- * @param {number} value - value as int
229
- */
230
- set ubit1be(value) {
231
- this.bit(value, 1, true, "big");
232
- }
233
- /**
234
- * Bit field writer. Writes 2 bits.
235
- *
236
- * Note: When returning to a byte write, remaining bits are dropped.
237
- *
238
- * @param {number} value - value as int
239
- */
240
- set bit2(value) {
241
- this.bit(value, 2);
242
- }
243
- /**
244
- * Bit field writer. Writes 2 bits.
245
- *
246
- * Note: When returning to a byte write, remaining bits are dropped.
247
- *
248
- * @param {number} value - value as int
249
- */
250
- set bit2le(value) {
251
- this.bit(value, 2, undefined, "little");
252
- }
253
- /**
254
- * Bit field writer. Writes 2 bits.
255
- *
256
- * Note: When returning to a byte write, remaining bits are dropped.
257
- *
258
- * @param {number} value - value as int
259
- */
260
- set bit2be(value) {
261
- this.bit(value, 2, undefined, "big");
262
- }
263
- /**
264
- * Bit field writer. Writes 2 bits.
265
- *
266
- * Note: When returning to a byte write, remaining bits are dropped.
267
- *
268
- * @param {number} value - value as int
269
- */
270
- set ubit2(value) {
271
- this.bit(value, 2, true);
272
- }
273
- /**
274
- * Bit field writer. Writes 2 bits.
275
- *
276
- * Note: When returning to a byte write, remaining bits are dropped.
277
- *
278
- * @param {number} value - value as int
279
- */
280
- set ubit2le(value) {
281
- this.bit(value, 2, true, "little");
282
- ;
283
- }
284
- /**
285
- * Bit field writer. Writes 2 bits.
286
- *
287
- * Note: When returning to a byte write, remaining bits are dropped.
288
- *
289
- * @param {number} value - value as int
290
- */
291
- set ubit2be(value) {
292
- this.bit(value, 2, true, "big");
293
- }
294
- /**
295
- * Bit field writer. Writes 3 bits.
296
- *
297
- * Note: When returning to a byte write, remaining bits are dropped.
298
- *
299
- * @param {number} value - value as int
300
- */
301
- set bit3(value) {
302
- this.bit(value, 3);
303
- }
304
- /**
305
- * Bit field writer. Writes 3 bits.
306
- *
307
- * Note: When returning to a byte write, remaining bits are dropped.
308
- *
309
- * @param {number} value - value as int
310
- */
311
- set bit3le(value) {
312
- this.bit(value, 3, undefined, "little");
313
- }
314
- /**
315
- * Bit field writer. Writes 3 bits.
316
- *
317
- * Note: When returning to a byte write, remaining bits are dropped.
318
- *
319
- * @param {number} value - value as int
320
- */
321
- set bit3be(value) {
322
- this.bit(value, 3, undefined, "big");
323
- }
324
- /**
325
- * Bit field writer. Writes 3 bits.
326
- *
327
- * Note: When returning to a byte write, remaining bits are dropped.
328
- *
329
- * @param {number} value - value as int
330
- */
331
- set ubit3(value) {
332
- this.bit(value, 3, true);
333
- }
334
- /**
335
- * Bit field writer. Writes 3 bits.
336
- *
337
- * Note: When returning to a byte write, remaining bits are dropped.
338
- *
339
- * @param {number} value - value as int
340
- */
341
- set ubit3le(value) {
342
- this.bit(value, 3, true, "little");
343
- ;
344
- }
345
- /**
346
- * Bit field writer. Writes 3 bits.
347
- *
348
- * Note: When returning to a byte write, remaining bits are dropped.
349
- *
350
- * @param {number} value - value as int
351
- */
352
- set ubit3be(value) {
353
- this.bit(value, 3, true, "big");
354
- }
355
- /**
356
- * Bit field writer. Writes 4 bits.
357
- *
358
- * Note: When returning to a byte write, remaining bits are dropped.
359
- *
360
- * @param {number} value - value as int
361
- */
362
- set bit4(value) {
363
- this.bit(value, 4);
364
- }
365
- /**
366
- * Bit field writer. Writes 4 bits.
367
- *
368
- * Note: When returning to a byte write, remaining bits are dropped.
369
- *
370
- * @param {number} value - value as int
371
- */
372
- set bit4le(value) {
373
- this.bit(value, 4, undefined, "little");
374
- }
375
- /**
376
- * Bit field writer. Writes 4 bits.
377
- *
378
- * Note: When returning to a byte write, remaining bits are dropped.
379
- *
380
- * @param {number} value - value as int
381
- */
382
- set bit4be(value) {
383
- this.bit(value, 4, undefined, "big");
384
- }
385
- /**
386
- * Bit field writer. Writes 4 bits.
387
- *
388
- * Note: When returning to a byte write, remaining bits are dropped.
389
- *
390
- * @param {number} value - value as int
391
- */
392
- set ubit4(value) {
393
- this.bit(value, 4, true);
394
- }
395
- /**
396
- * Bit field writer. Writes 4 bits.
397
- *
398
- * Note: When returning to a byte write, remaining bits are dropped.
399
- *
400
- * @param {number} value - value as int
401
- */
402
- set ubit4le(value) {
403
- this.bit(value, 4, true, "little");
404
- ;
405
- }
406
- /**
407
- * Bit field writer. Writes 4 bits.
408
- *
409
- * Note: When returning to a byte write, remaining bits are dropped.
410
- *
411
- * @param {number} value - value as int
412
- */
413
- set ubit4be(value) {
414
- this.bit(value, 4, true, "big");
415
- }
416
- /**
417
- * Bit field writer. Writes 5 bits.
418
- *
419
- * Note: When returning to a byte write, remaining bits are dropped.
420
- *
421
- * @param {number} value - value as int
422
- */
423
- set bit5(value) {
424
- this.bit(value, 5);
425
- }
426
- /**
427
- * Bit field writer. Writes 5 bits.
428
- *
429
- * Note: When returning to a byte write, remaining bits are dropped.
430
- *
431
- * @param {number} value - value as int
432
- */
433
- set bit5le(value) {
434
- this.bit(value, 5, undefined, "little");
435
- }
436
- /**
437
- * Bit field writer. Writes 5 bits.
438
- *
439
- * Note: When returning to a byte write, remaining bits are dropped.
440
- *
441
- * @param {number} value - value as int
442
- */
443
- set bit5be(value) {
444
- this.bit(value, 5, undefined, "big");
445
- }
446
- /**
447
- * Bit field writer. Writes 5 bits.
448
- *
449
- * Note: When returning to a byte write, remaining bits are dropped.
450
- *
451
- * @param {number} value - value as int
452
- */
453
- set ubit5(value) {
454
- this.bit(value, 5, true);
455
- }
456
- /**
457
- * Bit field writer. Writes 5 bits.
458
- *
459
- * Note: When returning to a byte write, remaining bits are dropped.
460
- *
461
- * @param {number} value - value as int
462
- */
463
- set ubit5le(value) {
464
- this.bit(value, 5, true, "little");
465
- ;
466
- }
467
- /**
468
- * Bit field writer. Writes 5 bits.
469
- *
470
- * Note: When returning to a byte write, remaining bits are dropped.
471
- *
472
- * @param {number} value - value as int
473
- */
474
- set ubit5be(value) {
475
- this.bit(value, 5, true, "big");
476
- }
477
- /**
478
- * Bit field writer. Writes 6 bits.
479
- *
480
- * Note: When returning to a byte write, remaining bits are dropped.
481
- *
482
- * @param {number} value - value as int
483
- */
484
- set bit6(value) {
485
- this.bit(value, 6);
486
- }
487
- /**
488
- * Bit field writer. Writes 6 bits.
489
- *
490
- * Note: When returning to a byte write, remaining bits are dropped.
491
- *
492
- * @param {number} value - value as int
493
- */
494
- set bit6le(value) {
495
- this.bit(value, 6, undefined, "little");
496
- }
497
- /**
498
- * Bit field writer. Writes 6 bits.
499
- *
500
- * Note: When returning to a byte write, remaining bits are dropped.
501
- *
502
- * @param {number} value - value as int
503
- */
504
- set bit6be(value) {
505
- this.bit(value, 6, undefined, "big");
506
- }
507
- /**
508
- * Bit field writer. Writes 6 bits.
509
- *
510
- * Note: When returning to a byte write, remaining bits are dropped.
511
- *
512
- * @param {number} value - value as int
513
- */
514
- set ubit6(value) {
515
- this.bit(value, 6, true);
516
- }
517
- /**
518
- * Bit field writer. Writes 6 bits.
519
- *
520
- * Note: When returning to a byte write, remaining bits are dropped.
521
- *
522
- * @param {number} value - value as int
523
- */
524
- set ubit6le(value) {
525
- this.bit(value, 6, true, "little");
526
- ;
527
- }
528
- /**
529
- * Bit field writer. Writes 6 bits.
530
- *
531
- * Note: When returning to a byte write, remaining bits are dropped.
532
- *
533
- * @param {number} value - value as int
534
- */
535
- set ubit6be(value) {
536
- this.bit(value, 6, true, "big");
537
- }
538
- /**
539
- * Bit field writer. Writes 7 bits.
540
- *
541
- * Note: When returning to a byte write, remaining bits are dropped.
542
- *
543
- * @param {number} value - value as int
544
- */
545
- set bit7(value) {
546
- this.bit(value, 7);
547
- }
548
- /**
549
- * Bit field writer. Writes 7 bits.
550
- *
551
- * Note: When returning to a byte write, remaining bits are dropped.
552
- *
553
- * @param {number} value - value as int
554
- */
555
- set bit7le(value) {
556
- this.bit(value, 7, undefined, "little");
557
- }
558
- /**
559
- * Bit field writer. Writes 7 bits.
560
- *
561
- * Note: When returning to a byte write, remaining bits are dropped.
562
- *
563
- * @param {number} value - value as int
564
- */
565
- set bit7be(value) {
566
- this.bit(value, 7, undefined, "big");
567
- }
568
- /**
569
- * Bit field writer. Writes 7 bits.
570
- *
571
- * Note: When returning to a byte write, remaining bits are dropped.
572
- *
573
- * @param {number} value - value as int
574
- */
575
- set ubit7(value) {
576
- this.bit(value, 7, true);
577
- }
578
- /**
579
- * Bit field writer. Writes 7 bits.
580
- *
581
- * Note: When returning to a byte write, remaining bits are dropped.
582
- *
583
- * @param {number} value - value as int
584
- */
585
- set ubit7le(value) {
586
- this.bit(value, 7, true, "little");
587
- ;
588
- }
589
- /**
590
- * Bit field writer. Writes 7 bits.
591
- *
592
- * Note: When returning to a byte write, remaining bits are dropped.
593
- *
594
- * @param {number} value - value as int
595
- */
596
- set ubit7be(value) {
597
- this.bit(value, 7, true, "big");
598
- }
599
- /**
600
- * Bit field writer. Writes 8 bits.
601
- *
602
- * Note: When returning to a byte write, remaining bits are dropped.
603
- *
604
- * @param {number} value - value as int
605
- */
606
- set bit8(value) {
607
- this.bit(value, 8);
608
- }
609
- /**
610
- * Bit field writer. Writes 8 bits.
611
- *
612
- * Note: When returning to a byte write, remaining bits are dropped.
613
- *
614
- * @param {number} value - value as int
615
- */
616
- set bit8le(value) {
617
- this.bit(value, 8, undefined, "little");
618
- }
619
- /**
620
- * Bit field writer. Writes 8 bits.
621
- *
622
- * Note: When returning to a byte write, remaining bits are dropped.
623
- *
624
- * @param {number} value - value as int
625
- */
626
- set bit8be(value) {
627
- this.bit(value, 8, undefined, "big");
628
- }
629
- /**
630
- * Bit field writer. Writes 8 bits.
631
- *
632
- * Note: When returning to a byte write, remaining bits are dropped.
633
- *
634
- * @param {number} value - value as int
635
- */
636
- set ubit8(value) {
637
- this.bit(value, 8, true);
638
- }
639
- /**
640
- * Bit field writer. Writes 8 bits.
641
- *
642
- * Note: When returning to a byte write, remaining bits are dropped.
643
- *
644
- * @param {number} value - value as int
645
- */
646
- set ubit8le(value) {
647
- this.bit(value, 8, true, "little");
648
- ;
649
- }
650
- /**
651
- * Bit field writer. Writes 8 bits.
652
- *
653
- * Note: When returning to a byte write, remaining bits are dropped.
654
- *
655
- * @param {number} value - value as int
656
- */
657
- set ubit8be(value) {
658
- this.bit(value, 8, true, "big");
659
- }
660
- /**
661
- * Bit field writer. Writes 9 bits.
662
- *
663
- * Note: When returning to a byte write, remaining bits are dropped.
664
- *
665
- * @param {number} value - value as int
666
- */
667
- set bit9(value) {
668
- this.bit(value, 9);
669
- }
670
- /**
671
- * Bit field writer. Writes 9 bits.
672
- *
673
- * Note: When returning to a byte write, remaining bits are dropped.
674
- *
675
- * @param {number} value - value as int
676
- */
677
- set bit9le(value) {
678
- this.bit(value, 9, undefined, "little");
679
- }
680
- /**
681
- * Bit field writer. Writes 9 bits.
682
- *
683
- * Note: When returning to a byte write, remaining bits are dropped.
684
- *
685
- * @param {number} value - value as int
686
- */
687
- set bit9be(value) {
688
- this.bit(value, 9, undefined, "big");
689
- }
690
- /**
691
- * Bit field writer. Writes 9 bits.
692
- *
693
- * Note: When returning to a byte write, remaining bits are dropped.
694
- *
695
- * @param {number} value - value as int
696
- */
697
- set ubit9(value) {
698
- this.bit(value, 9, true);
699
- }
700
- /**
701
- * Bit field writer. Writes 9 bits.
702
- *
703
- * Note: When returning to a byte write, remaining bits are dropped.
704
- *
705
- * @param {number} value - value as int
706
- */
707
- set ubit9le(value) {
708
- this.bit(value, 9, true, "little");
709
- ;
710
- }
711
- /**
712
- * Bit field writer. Writes 9 bits.
713
- *
714
- * Note: When returning to a byte write, remaining bits are dropped.
715
- *
716
- * @param {number} value - value as int
717
- */
718
- set ubit9be(value) {
719
- this.bit(value, 9, true, "big");
720
- }
721
- /**
722
- * Bit field writer. Writes 10 bits.
723
- *
724
- * Note: When returning to a byte write, remaining bits are dropped.
725
- *
726
- * @param {number} value - value as int
727
- */
728
- set bit10(value) {
729
- this.bit(value, 10);
730
- }
731
- /**
732
- * Bit field writer. Writes 10 bits.
733
- *
734
- * Note: When returning to a byte write, remaining bits are dropped.
735
- *
736
- * @param {number} value - value as int
737
- */
738
- set bit10le(value) {
739
- this.bit(value, 10, undefined, "little");
740
- }
741
- /**
742
- * Bit field writer. Writes 10 bits.
743
- *
744
- * Note: When returning to a byte write, remaining bits are dropped.
745
- *
746
- * @param {number} value - value as int
747
- */
748
- set bit10be(value) {
749
- this.bit(value, 10, undefined, "big");
750
- }
751
- /**
752
- * Bit field writer. Writes 10 bits.
753
- *
754
- * Note: When returning to a byte write, remaining bits are dropped.
755
- *
756
- * @param {number} value - value as int
757
- */
758
- set ubit10(value) {
759
- this.bit(value, 10, true);
760
- }
761
- /**
762
- * Bit field writer. Writes 10 bits.
763
- *
764
- * Note: When returning to a byte write, remaining bits are dropped.
765
- *
766
- * @param {number} value - value as int
767
- */
768
- set ubit10le(value) {
769
- this.bit(value, 10, true, "little");
770
- ;
771
- }
772
- /**
773
- * Bit field writer. Writes 10 bits.
774
- *
775
- * Note: When returning to a byte write, remaining bits are dropped.
776
- *
777
- * @param {number} value - value as int
778
- */
779
- set ubit10be(value) {
780
- this.bit(value, 10, true, "big");
781
- }
782
- /**
783
- * Bit field writer. Writes 11 bits.
784
- *
785
- * Note: When returning to a byte write, remaining bits are dropped.
786
- *
787
- * @param {number} value - value as int
788
- */
789
- set bit11(value) {
790
- this.bit(value, 11);
791
- }
792
- /**
793
- * Bit field writer. Writes 11 bits.
794
- *
795
- * Note: When returning to a byte write, remaining bits are dropped.
796
- *
797
- * @param {number} value - value as int
798
- */
799
- set bit11le(value) {
800
- this.bit(value, 11, undefined, "little");
801
- }
802
- /**
803
- * Bit field writer. Writes 11 bits.
804
- *
805
- * Note: When returning to a byte write, remaining bits are dropped.
806
- *
807
- * @param {number} value - value as int
808
- */
809
- set bit11be(value) {
810
- this.bit(value, 11, undefined, "big");
811
- }
812
- /**
813
- * Bit field writer. Writes 11 bits.
814
- *
815
- * Note: When returning to a byte write, remaining bits are dropped.
816
- *
817
- * @param {number} value - value as int
818
- */
819
- set ubit11(value) {
820
- this.bit(value, 11, true);
821
- }
822
- /**
823
- * Bit field writer. Writes 11 bits.
824
- *
825
- * Note: When returning to a byte write, remaining bits are dropped.
826
- *
827
- * @param {number} value - value as int
828
- */
829
- set ubit11le(value) {
830
- this.bit(value, 11, true, "little");
831
- ;
832
- }
833
- /**
834
- * Bit field writer. Writes 11 bits.
835
- *
836
- * Note: When returning to a byte write, remaining bits are dropped.
837
- *
838
- * @param {number} value - value as int
839
- */
840
- set ubit11be(value) {
841
- this.bit(value, 11, true, "big");
842
- }
843
- /**
844
- * Bit field writer. Writes 12 bits.
845
- *
846
- * Note: When returning to a byte write, remaining bits are dropped.
847
- *
848
- * @param {number} value - value as int
849
- */
850
- set bit12(value) {
851
- this.bit(value, 12);
852
- }
853
- /**
854
- * Bit field writer. Writes 12 bits.
855
- *
856
- * Note: When returning to a byte write, remaining bits are dropped.
857
- *
858
- * @param {number} value - value as int
859
- */
860
- set bit12le(value) {
861
- this.bit(value, 12, undefined, "little");
862
- }
863
- /**
864
- * Bit field writer. Writes 12 bits.
865
- *
866
- * Note: When returning to a byte write, remaining bits are dropped.
867
- *
868
- * @param {number} value - value as int
869
- */
870
- set bit12be(value) {
871
- this.bit(value, 12, undefined, "big");
872
- }
873
- /**
874
- * Bit field writer. Writes 12 bits.
875
- *
876
- * Note: When returning to a byte write, remaining bits are dropped.
877
- *
878
- * @param {number} value - value as int
879
- */
880
- set ubit12(value) {
881
- this.bit(value, 12, true);
882
- }
883
- /**
884
- * Bit field writer. Writes 12 bits.
885
- *
886
- * Note: When returning to a byte write, remaining bits are dropped.
887
- *
888
- * @param {number} value - value as int
889
- */
890
- set ubit12le(value) {
891
- this.bit(value, 12, true, "little");
892
- ;
893
- }
894
- /**
895
- * Bit field writer. Writes 12 bits.
896
- *
897
- * Note: When returning to a byte write, remaining bits are dropped.
898
- *
899
- * @param {number} value - value as int
900
- */
901
- set ubit12be(value) {
902
- this.bit(value, 12, true, "big");
903
- }
904
- /**
905
- * Bit field writer. Writes 13 bits.
906
- *
907
- * Note: When returning to a byte write, remaining bits are dropped.
908
- *
909
- * @param {number} value - value as int
910
- */
911
- set bit13(value) {
912
- this.bit(value, 13);
913
- }
914
- /**
915
- * Bit field writer. Writes 13 bits.
916
- *
917
- * Note: When returning to a byte write, remaining bits are dropped.
918
- *
919
- * @param {number} value - value as int
920
- */
921
- set bit13le(value) {
922
- this.bit(value, 13, undefined, "little");
923
- }
924
- /**
925
- * Bit field writer. Writes 13 bits.
926
- *
927
- * Note: When returning to a byte write, remaining bits are dropped.
928
- *
929
- * @param {number} value - value as int
930
- */
931
- set bit13be(value) {
932
- this.bit(value, 13, undefined, "big");
933
- }
934
- /**
935
- * Bit field writer. Writes 13 bits.
936
- *
937
- * Note: When returning to a byte write, remaining bits are dropped.
938
- *
939
- * @param {number} value - value as int
940
- */
941
- set ubit13(value) {
942
- this.bit(value, 13, true);
943
- }
944
- /**
945
- * Bit field writer. Writes 13 bits.
946
- *
947
- * Note: When returning to a byte write, remaining bits are dropped.
948
- *
949
- * @param {number} value - value as int
950
- */
951
- set ubit13le(value) {
952
- this.bit(value, 13, true, "little");
953
- ;
954
- }
955
- /**
956
- * Bit field writer. Writes 13 bits.
957
- *
958
- * Note: When returning to a byte write, remaining bits are dropped.
959
- *
960
- * @param {number} value - value as int
961
- */
962
- set ubit13be(value) {
963
- this.bit(value, 13, true, "big");
964
- }
965
- /**
966
- * Bit field writer. Writes 14 bits.
967
- *
968
- * Note: When returning to a byte write, remaining bits are dropped.
969
- *
970
- * @param {number} value - value as int
971
- */
972
- set bit14(value) {
973
- this.bit(value, 14);
974
- }
975
- /**
976
- * Bit field writer. Writes 14 bits.
977
- *
978
- * Note: When returning to a byte write, remaining bits are dropped.
979
- *
980
- * @param {number} value - value as int
981
- */
982
- set bit14le(value) {
983
- this.bit(value, 14, undefined, "little");
984
- }
985
- /**
986
- * Bit field writer. Writes 14 bits.
987
- *
988
- * Note: When returning to a byte write, remaining bits are dropped.
989
- *
990
- * @param {number} value - value as int
991
- */
992
- set bit14be(value) {
993
- this.bit(value, 14, undefined, "big");
994
- }
995
- /**
996
- * Bit field writer. Writes 14 bits.
997
- *
998
- * Note: When returning to a byte write, remaining bits are dropped.
999
- *
1000
- * @param {number} value - value as int
1001
- */
1002
- set ubit14(value) {
1003
- this.bit(value, 14, true);
1004
- }
1005
- /**
1006
- * Bit field writer. Writes 14 bits.
1007
- *
1008
- * Note: When returning to a byte write, remaining bits are dropped.
1009
- *
1010
- * @param {number} value - value as int
1011
- */
1012
- set ubit14le(value) {
1013
- this.bit(value, 14, true, "little");
1014
- ;
1015
- }
1016
- /**
1017
- * Bit field writer. Writes 14 bits.
1018
- *
1019
- * Note: When returning to a byte write, remaining bits are dropped.
1020
- *
1021
- * @param {number} value - value as int
1022
- */
1023
- set ubit14be(value) {
1024
- this.bit(value, 14, true, "big");
1025
- }
1026
- /**
1027
- * Bit field writer. Writes 15 bits.
1028
- *
1029
- * Note: When returning to a byte write, remaining bits are dropped.
1030
- *
1031
- * @param {number} value - value as int
1032
- */
1033
- set bit15(value) {
1034
- this.bit(value, 15);
1035
- }
1036
- /**
1037
- * Bit field writer. Writes 15 bits.
1038
- *
1039
- * Note: When returning to a byte write, remaining bits are dropped.
1040
- *
1041
- * @param {number} value - value as int
1042
- */
1043
- set bit15le(value) {
1044
- this.bit(value, 15, undefined, "little");
1045
- }
1046
- /**
1047
- * Bit field writer. Writes 15 bits.
1048
- *
1049
- * Note: When returning to a byte write, remaining bits are dropped.
1050
- *
1051
- * @param {number} value - value as int
1052
- */
1053
- set bit15be(value) {
1054
- this.bit(value, 15, undefined, "big");
1055
- }
1056
- /**
1057
- * Bit field writer. Writes 15 bits.
1058
- *
1059
- * Note: When returning to a byte write, remaining bits are dropped.
1060
- *
1061
- * @param {number} value - value as int
1062
- */
1063
- set ubit15(value) {
1064
- this.bit(value, 15, true);
1065
- }
1066
- /**
1067
- * Bit field writer. Writes 15 bits.
1068
- *
1069
- * Note: When returning to a byte write, remaining bits are dropped.
1070
- *
1071
- * @param {number} value - value as int
1072
- */
1073
- set ubit15le(value) {
1074
- this.bit(value, 15, true, "little");
1075
- ;
1076
- }
1077
- /**
1078
- * Bit field writer. Writes 15 bits.
1079
- *
1080
- * Note: When returning to a byte write, remaining bits are dropped.
1081
- *
1082
- * @param {number} value - value as int
1083
- */
1084
- set ubit15be(value) {
1085
- this.bit(value, 15, true, "big");
1086
- }
1087
- /**
1088
- * Bit field writer. Writes 16 bits.
1089
- *
1090
- * Note: When returning to a byte write, remaining bits are dropped.
1091
- *
1092
- * @param {number} value - value as int
1093
- */
1094
- set bit16(value) {
1095
- this.bit(value, 16);
1096
- }
1097
- /**
1098
- * Bit field writer. Writes 16 bits.
1099
- *
1100
- * Note: When returning to a byte write, remaining bits are dropped.
1101
- *
1102
- * @param {number} value - value as int
1103
- */
1104
- set bit16le(value) {
1105
- this.bit(value, 16, undefined, "little");
1106
- }
1107
- /**
1108
- * Bit field writer. Writes 16 bits.
1109
- *
1110
- * Note: When returning to a byte write, remaining bits are dropped.
1111
- *
1112
- * @param {number} value - value as int
1113
- */
1114
- set bit16be(value) {
1115
- this.bit(value, 16, undefined, "big");
1116
- }
1117
- /**
1118
- * Bit field writer. Writes 16 bits.
1119
- *
1120
- * Note: When returning to a byte write, remaining bits are dropped.
1121
- *
1122
- * @param {number} value - value as int
1123
- */
1124
- set ubit16(value) {
1125
- this.bit(value, 16, true);
1126
- }
1127
- /**
1128
- * Bit field writer. Writes 16 bits.
1129
- *
1130
- * Note: When returning to a byte write, remaining bits are dropped.
1131
- *
1132
- * @param {number} value - value as int
1133
- */
1134
- set ubit16le(value) {
1135
- this.bit(value, 16, true, "little");
1136
- ;
1137
- }
1138
- /**
1139
- * Bit field writer. Writes 16 bits.
1140
- *
1141
- * Note: When returning to a byte write, remaining bits are dropped.
1142
- *
1143
- * @param {number} value - value as int
1144
- */
1145
- set ubit16be(value) {
1146
- this.bit(value, 16, true, "big");
1147
- }
1148
- /**
1149
- * Bit field writer. Writes 17 bits.
1150
- *
1151
- * Note: When returning to a byte write, remaining bits are dropped.
1152
- *
1153
- * @param {number} value - value as int
1154
- */
1155
- set bit17(value) {
1156
- this.bit(value, 17);
1157
- }
1158
- /**
1159
- * Bit field writer. Writes 17 bits.
1160
- *
1161
- * Note: When returning to a byte write, remaining bits are dropped.
1162
- *
1163
- * @param {number} value - value as int
1164
- */
1165
- set bit17le(value) {
1166
- this.bit(value, 17, undefined, "little");
1167
- }
1168
- /**
1169
- * Bit field writer. Writes 17 bits.
1170
- *
1171
- * Note: When returning to a byte write, remaining bits are dropped.
1172
- *
1173
- * @param {number} value - value as int
1174
- */
1175
- set bit17be(value) {
1176
- this.bit(value, 17, undefined, "big");
1177
- }
1178
- /**
1179
- * Bit field writer. Writes 17 bits.
1180
- *
1181
- * Note: When returning to a byte write, remaining bits are dropped.
1182
- *
1183
- * @param {number} value - value as int
1184
- */
1185
- set ubit17(value) {
1186
- this.bit(value, 17, true);
1187
- }
1188
- /**
1189
- * Bit field writer. Writes 17 bits.
1190
- *
1191
- * Note: When returning to a byte write, remaining bits are dropped.
1192
- *
1193
- * @param {number} value - value as int
1194
- */
1195
- set ubit17le(value) {
1196
- this.bit(value, 17, true, "little");
1197
- ;
1198
- }
1199
- /**
1200
- * Bit field writer. Writes 17 bits.
1201
- *
1202
- * Note: When returning to a byte write, remaining bits are dropped.
1203
- *
1204
- * @param {number} value - value as int
1205
- */
1206
- set ubit17be(value) {
1207
- this.bit(value, 17, true, "big");
1208
- }
1209
- /**
1210
- * Bit field writer. Writes 18 bits.
1211
- *
1212
- * Note: When returning to a byte write, remaining bits are dropped.
1213
- *
1214
- * @param {number} value - value as int
1215
- */
1216
- set bit18(value) {
1217
- this.bit(value, 18);
1218
- }
1219
- /**
1220
- * Bit field writer. Writes 18 bits.
1221
- *
1222
- * Note: When returning to a byte write, remaining bits are dropped.
1223
- *
1224
- * @param {number} value - value as int
1225
- */
1226
- set bit18le(value) {
1227
- this.bit(value, 18, undefined, "little");
1228
- }
1229
- /**
1230
- * Bit field writer. Writes 18 bits.
1231
- *
1232
- * Note: When returning to a byte write, remaining bits are dropped.
1233
- *
1234
- * @param {number} value - value as int
1235
- */
1236
- set bit18be(value) {
1237
- this.bit(value, 18, undefined, "big");
1238
- }
1239
- /**
1240
- * Bit field writer. Writes 18 bits.
1241
- *
1242
- * Note: When returning to a byte write, remaining bits are dropped.
1243
- *
1244
- * @param {number} value - value as int
1245
- */
1246
- set ubit18(value) {
1247
- this.bit(value, 18, true);
1248
- }
1249
- /**
1250
- * Bit field writer. Writes 18 bits.
1251
- *
1252
- * Note: When returning to a byte write, remaining bits are dropped.
1253
- *
1254
- * @param {number} value - value as int
1255
- */
1256
- set ubit18le(value) {
1257
- this.bit(value, 18, true, "little");
1258
- ;
1259
- }
1260
- /**
1261
- * Bit field writer. Writes 18 bits.
1262
- *
1263
- * Note: When returning to a byte write, remaining bits are dropped.
1264
- *
1265
- * @param {number} value - value as int
1266
- */
1267
- set ubit18be(value) {
1268
- this.bit(value, 18, true, "big");
1269
- }
1270
- /**
1271
- * Bit field writer. Writes 19 bits.
1272
- *
1273
- * Note: When returning to a byte write, remaining bits are dropped.
1274
- *
1275
- * @param {number} value - value as int
1276
- */
1277
- set bit19(value) {
1278
- this.bit(value, 19);
1279
- }
1280
- /**
1281
- * Bit field writer. Writes 19 bits.
1282
- *
1283
- * Note: When returning to a byte write, remaining bits are dropped.
1284
- *
1285
- * @param {number} value - value as int
1286
- */
1287
- set bit19le(value) {
1288
- this.bit(value, 19, undefined, "little");
1289
- }
1290
- /**
1291
- * Bit field writer. Writes 19 bits.
1292
- *
1293
- * Note: When returning to a byte write, remaining bits are dropped.
1294
- *
1295
- * @param {number} value - value as int
1296
- */
1297
- set bit19be(value) {
1298
- this.bit(value, 19, undefined, "big");
1299
- }
1300
- /**
1301
- * Bit field writer. Writes 19 bits.
1302
- *
1303
- * Note: When returning to a byte write, remaining bits are dropped.
1304
- *
1305
- * @param {number} value - value as int
1306
- */
1307
- set ubit19(value) {
1308
- this.bit(value, 19, true);
1309
- }
1310
- /**
1311
- * Bit field writer. Writes 19 bits.
1312
- *
1313
- * Note: When returning to a byte write, remaining bits are dropped.
1314
- *
1315
- * @param {number} value - value as int
1316
- */
1317
- set ubit19le(value) {
1318
- this.bit(value, 19, true, "little");
1319
- ;
1320
- }
1321
- /**
1322
- * Bit field writer. Writes 19 bits.
1323
- *
1324
- * Note: When returning to a byte write, remaining bits are dropped.
1325
- *
1326
- * @param {number} value - value as int
1327
- */
1328
- set ubit19be(value) {
1329
- this.bit(value, 19, true, "big");
1330
- }
1331
- /**
1332
- * Bit field writer. Writes 20 bits.
1333
- *
1334
- * Note: When returning to a byte write, remaining bits are dropped.
1335
- *
1336
- * @param {number} value - value as int
1337
- */
1338
- set bit20(value) {
1339
- this.bit(value, 20);
1340
- }
1341
- /**
1342
- * Bit field writer. Writes 20 bits.
1343
- *
1344
- * Note: When returning to a byte write, remaining bits are dropped.
1345
- *
1346
- * @param {number} value - value as int
1347
- */
1348
- set bit20le(value) {
1349
- this.bit(value, 20, undefined, "little");
1350
- }
1351
- /**
1352
- * Bit field writer. Writes 20 bits.
1353
- *
1354
- * Note: When returning to a byte write, remaining bits are dropped.
1355
- *
1356
- * @param {number} value - value as int
1357
- */
1358
- set bit20be(value) {
1359
- this.bit(value, 20, undefined, "big");
1360
- }
1361
- /**
1362
- * Bit field writer. Writes 20 bits.
1363
- *
1364
- * Note: When returning to a byte write, remaining bits are dropped.
1365
- *
1366
- * @param {number} value - value as int
1367
- */
1368
- set ubit20(value) {
1369
- this.bit(value, 20, true);
1370
- }
1371
- /**
1372
- * Bit field writer. Writes 20 bits.
1373
- *
1374
- * Note: When returning to a byte write, remaining bits are dropped.
1375
- *
1376
- * @param {number} value - value as int
1377
- */
1378
- set ubit20le(value) {
1379
- this.bit(value, 20, true, "little");
1380
- ;
1381
- }
1382
- /**
1383
- * Bit field writer. Writes 20 bits.
1384
- *
1385
- * Note: When returning to a byte write, remaining bits are dropped.
1386
- *
1387
- * @param {number} value - value as int
1388
- */
1389
- set ubit20be(value) {
1390
- this.bit(value, 20, true, "big");
1391
- }
1392
- /**
1393
- * Bit field writer. Writes 21 bits.
1394
- *
1395
- * Note: When returning to a byte write, remaining bits are dropped.
1396
- *
1397
- * @param {number} value - value as int
1398
- */
1399
- set bit21(value) {
1400
- this.bit(value, 21);
1401
- }
1402
- /**
1403
- * Bit field writer. Writes 21 bits.
1404
- *
1405
- * Note: When returning to a byte write, remaining bits are dropped.
1406
- *
1407
- * @param {number} value - value as int
1408
- */
1409
- set bit21le(value) {
1410
- this.bit(value, 21, undefined, "little");
1411
- }
1412
- /**
1413
- * Bit field writer. Writes 21 bits.
1414
- *
1415
- * Note: When returning to a byte write, remaining bits are dropped.
1416
- *
1417
- * @param {number} value - value as int
1418
- */
1419
- set bit21be(value) {
1420
- this.bit(value, 21, undefined, "big");
1421
- }
1422
- /**
1423
- * Bit field writer. Writes 21 bits.
1424
- *
1425
- * Note: When returning to a byte write, remaining bits are dropped.
1426
- *
1427
- * @param {number} value - value as int
1428
- */
1429
- set ubit21(value) {
1430
- this.bit(value, 21, true);
1431
- }
1432
- /**
1433
- * Bit field writer. Writes 21 bits.
1434
- *
1435
- * Note: When returning to a byte write, remaining bits are dropped.
1436
- *
1437
- * @param {number} value - value as int
1438
- */
1439
- set ubit21le(value) {
1440
- this.bit(value, 21, true, "little");
1441
- ;
1442
- }
1443
- /**
1444
- * Bit field writer. Writes 21 bits.
1445
- *
1446
- * Note: When returning to a byte write, remaining bits are dropped.
1447
- *
1448
- * @param {number} value - value as int
1449
- */
1450
- set ubit21be(value) {
1451
- this.bit(value, 21, true, "big");
1452
- }
1453
- /**
1454
- * Bit field writer. Writes 22 bits.
1455
- *
1456
- * Note: When returning to a byte write, remaining bits are dropped.
1457
- *
1458
- * @param {number} value - value as int
1459
- */
1460
- set bit22(value) {
1461
- this.bit(value, 22);
1462
- }
1463
- /**
1464
- * Bit field writer. Writes 22 bits.
1465
- *
1466
- * Note: When returning to a byte write, remaining bits are dropped.
1467
- *
1468
- * @param {number} value - value as int
1469
- */
1470
- set bit22le(value) {
1471
- this.bit(value, 22, undefined, "little");
1472
- }
1473
- /**
1474
- * Bit field writer. Writes 22 bits.
1475
- *
1476
- * Note: When returning to a byte write, remaining bits are dropped.
1477
- *
1478
- * @param {number} value - value as int
1479
- */
1480
- set bit22be(value) {
1481
- this.bit(value, 22, undefined, "big");
1482
- }
1483
- /**
1484
- * Bit field writer. Writes 22 bits.
1485
- *
1486
- * Note: When returning to a byte write, remaining bits are dropped.
1487
- *
1488
- * @param {number} value - value as int
1489
- */
1490
- set ubit22(value) {
1491
- this.bit(value, 22, true);
1492
- }
1493
- /**
1494
- * Bit field writer. Writes 22 bits.
1495
- *
1496
- * Note: When returning to a byte write, remaining bits are dropped.
1497
- *
1498
- * @param {number} value - value as int
1499
- */
1500
- set ubit22le(value) {
1501
- this.bit(value, 22, true, "little");
1502
- ;
1503
- }
1504
- /**
1505
- * Bit field writer. Writes 22 bits.
1506
- *
1507
- * Note: When returning to a byte write, remaining bits are dropped.
1508
- *
1509
- * @param {number} value - value as int
1510
- */
1511
- set ubit22be(value) {
1512
- this.bit(value, 22, true, "big");
1513
- }
1514
- /**
1515
- * Bit field writer. Writes 23 bits.
1516
- *
1517
- * Note: When returning to a byte write, remaining bits are dropped.
1518
- *
1519
- * @param {number} value - value as int
1520
- */
1521
- set bit23(value) {
1522
- this.bit(value, 23);
1523
- }
1524
- /**
1525
- * Bit field writer. Writes 23 bits.
1526
- *
1527
- * Note: When returning to a byte write, remaining bits are dropped.
1528
- *
1529
- * @param {number} value - value as int
1530
- */
1531
- set bit23le(value) {
1532
- this.bit(value, 23, undefined, "little");
1533
- }
1534
- /**
1535
- * Bit field writer. Writes 23 bits.
1536
- *
1537
- * Note: When returning to a byte write, remaining bits are dropped.
1538
- *
1539
- * @param {number} value - value as int
1540
- */
1541
- set bit23be(value) {
1542
- this.bit(value, 23, undefined, "big");
1543
- }
1544
- /**
1545
- * Bit field writer. Writes 23 bits.
1546
- *
1547
- * Note: When returning to a byte write, remaining bits are dropped.
1548
- *
1549
- * @param {number} value - value as int
1550
- */
1551
- set ubit23(value) {
1552
- this.bit(value, 23, true);
1553
- }
1554
- /**
1555
- * Bit field writer. Writes 23 bits.
1556
- *
1557
- * Note: When returning to a byte write, remaining bits are dropped.
1558
- *
1559
- * @param {number} value - value as int
1560
- */
1561
- set ubit23le(value) {
1562
- this.bit(value, 23, true, "little");
1563
- ;
1564
- }
1565
- /**
1566
- * Bit field writer. Writes 23 bits.
1567
- *
1568
- * Note: When returning to a byte write, remaining bits are dropped.
1569
- *
1570
- * @param {number} value - value as int
1571
- */
1572
- set ubit23be(value) {
1573
- this.bit(value, 23, true, "big");
1574
- }
1575
- /**
1576
- * Bit field writer. Writes 24 bits.
1577
- *
1578
- * Note: When returning to a byte write, remaining bits are dropped.
1579
- *
1580
- * @param {number} value - value as int
1581
- */
1582
- set bit24(value) {
1583
- this.bit(value, 24);
1584
- }
1585
- /**
1586
- * Bit field writer. Writes 24 bits.
1587
- *
1588
- * Note: When returning to a byte write, remaining bits are dropped.
1589
- *
1590
- * @param {number} value - value as int
1591
- */
1592
- set bit24le(value) {
1593
- this.bit(value, 24, undefined, "little");
1594
- }
1595
- /**
1596
- * Bit field writer. Writes 24 bits.
1597
- *
1598
- * Note: When returning to a byte write, remaining bits are dropped.
1599
- *
1600
- * @param {number} value - value as int
1601
- */
1602
- set bit24be(value) {
1603
- this.bit(value, 24, undefined, "big");
1604
- }
1605
- /**
1606
- * Bit field writer. Writes 24 bits.
1607
- *
1608
- * Note: When returning to a byte write, remaining bits are dropped.
1609
- *
1610
- * @param {number} value - value as int
1611
- */
1612
- set ubit24(value) {
1613
- this.bit(value, 24, true);
1614
- }
1615
- /**
1616
- * Bit field writer. Writes 24 bits.
1617
- *
1618
- * Note: When returning to a byte write, remaining bits are dropped.
1619
- *
1620
- * @param {number} value - value as int
1621
- */
1622
- set ubit24le(value) {
1623
- this.bit(value, 24, true, "little");
1624
- ;
1625
- }
1626
- /**
1627
- * Bit field writer. Writes 24 bits.
1628
- *
1629
- * Note: When returning to a byte write, remaining bits are dropped.
1630
- *
1631
- * @param {number} value - value as int
1632
- */
1633
- set ubit24be(value) {
1634
- this.bit(value, 24, true, "big");
1635
- }
1636
- /**
1637
- * Bit field writer. Writes 25 bits.
1638
- *
1639
- * Note: When returning to a byte write, remaining bits are dropped.
1640
- *
1641
- * @param {number} value - value as int
1642
- */
1643
- set bit25(value) {
1644
- this.bit(value, 25);
1645
- }
1646
- /**
1647
- * Bit field writer. Writes 25 bits.
1648
- *
1649
- * Note: When returning to a byte write, remaining bits are dropped.
1650
- *
1651
- * @param {number} value - value as int
1652
- */
1653
- set bit25le(value) {
1654
- this.bit(value, 25, undefined, "little");
1655
- }
1656
- /**
1657
- * Bit field writer. Writes 25 bits.
1658
- *
1659
- * Note: When returning to a byte write, remaining bits are dropped.
1660
- *
1661
- * @param {number} value - value as int
1662
- */
1663
- set bit25be(value) {
1664
- this.bit(value, 25, undefined, "big");
1665
- }
1666
- /**
1667
- * Bit field writer. Writes 25 bits.
1668
- *
1669
- * Note: When returning to a byte write, remaining bits are dropped.
1670
- *
1671
- * @param {number} value - value as int
1672
- */
1673
- set ubit25(value) {
1674
- this.bit(value, 25, true);
1675
- }
1676
- /**
1677
- * Bit field writer. Writes 25 bits.
1678
- *
1679
- * Note: When returning to a byte write, remaining bits are dropped.
1680
- *
1681
- * @param {number} value - value as int
1682
- */
1683
- set ubit25le(value) {
1684
- this.bit(value, 25, true, "little");
1685
- ;
1686
- }
1687
- /**
1688
- * Bit field writer. Writes 25 bits.
1689
- *
1690
- * Note: When returning to a byte write, remaining bits are dropped.
1691
- *
1692
- * @param {number} value - value as int
1693
- */
1694
- set ubit25be(value) {
1695
- this.bit(value, 25, true, "big");
1696
- }
1697
- /**
1698
- * Bit field writer. Writes 26 bits.
1699
- *
1700
- * Note: When returning to a byte write, remaining bits are dropped.
1701
- *
1702
- * @param {number} value - value as int
1703
- */
1704
- set bit26(value) {
1705
- this.bit(value, 26);
1706
- }
1707
- /**
1708
- * Bit field writer. Writes 26 bits.
1709
- *
1710
- * Note: When returning to a byte write, remaining bits are dropped.
1711
- *
1712
- * @param {number} value - value as int
1713
- */
1714
- set bit26le(value) {
1715
- this.bit(value, 26, undefined, "little");
1716
- }
1717
- /**
1718
- * Bit field writer. Writes 26 bits.
1719
- *
1720
- * Note: When returning to a byte write, remaining bits are dropped.
1721
- *
1722
- * @param {number} value - value as int
1723
- */
1724
- set bit26be(value) {
1725
- this.bit(value, 26, undefined, "big");
1726
- }
1727
- /**
1728
- * Bit field writer. Writes 26 bits.
1729
- *
1730
- * Note: When returning to a byte write, remaining bits are dropped.
1731
- *
1732
- * @param {number} value - value as int
1733
- */
1734
- set ubit26(value) {
1735
- this.bit(value, 26, true);
1736
- }
1737
- /**
1738
- * Bit field writer. Writes 26 bits.
1739
- *
1740
- * Note: When returning to a byte write, remaining bits are dropped.
1741
- *
1742
- * @param {number} value - value as int
1743
- */
1744
- set ubit26le(value) {
1745
- this.bit(value, 26, true, "little");
1746
- ;
1747
- }
1748
- /**
1749
- * Bit field writer. Writes 26 bits.
1750
- *
1751
- * Note: When returning to a byte write, remaining bits are dropped.
1752
- *
1753
- * @param {number} value - value as int
1754
- */
1755
- set ubit26be(value) {
1756
- this.bit(value, 26, true, "big");
1757
- }
1758
- /**
1759
- * Bit field writer. Writes 27 bits.
1760
- *
1761
- * Note: When returning to a byte write, remaining bits are dropped.
1762
- *
1763
- * @param {number} value - value as int
1764
- */
1765
- set bit27(value) {
1766
- this.bit(value, 27);
1767
- }
1768
- /**
1769
- * Bit field writer. Writes 27 bits.
1770
- *
1771
- * Note: When returning to a byte write, remaining bits are dropped.
1772
- *
1773
- * @param {number} value - value as int
1774
- */
1775
- set bit27le(value) {
1776
- this.bit(value, 27, undefined, "little");
1777
- }
1778
- /**
1779
- * Bit field writer. Writes 27 bits.
1780
- *
1781
- * Note: When returning to a byte write, remaining bits are dropped.
1782
- *
1783
- * @param {number} value - value as int
1784
- */
1785
- set bit27be(value) {
1786
- this.bit(value, 27, undefined, "big");
1787
- }
1788
- /**
1789
- * Bit field writer. Writes 27 bits.
1790
- *
1791
- * Note: When returning to a byte write, remaining bits are dropped.
1792
- *
1793
- * @param {number} value - value as int
1794
- */
1795
- set ubit27(value) {
1796
- this.bit(value, 27, true);
1797
- }
1798
- /**
1799
- * Bit field writer. Writes 27 bits.
1800
- *
1801
- * Note: When returning to a byte write, remaining bits are dropped.
1802
- *
1803
- * @param {number} value - value as int
1804
- */
1805
- set ubit27le(value) {
1806
- this.bit(value, 27, true, "little");
1807
- ;
1808
- }
1809
- /**
1810
- * Bit field writer. Writes 27 bits.
1811
- *
1812
- * Note: When returning to a byte write, remaining bits are dropped.
1813
- *
1814
- * @param {number} value - value as int
1815
- */
1816
- set ubit27be(value) {
1817
- this.bit(value, 27, true, "big");
1818
- }
1819
- /**
1820
- * Bit field writer. Writes 28 bits.
1821
- *
1822
- * Note: When returning to a byte write, remaining bits are dropped.
1823
- *
1824
- * @param {number} value - value as int
1825
- */
1826
- set bit28(value) {
1827
- this.bit(value, 28);
1828
- }
1829
- /**
1830
- * Bit field writer. Writes 28 bits.
1831
- *
1832
- * Note: When returning to a byte write, remaining bits are dropped.
1833
- *
1834
- * @param {number} value - value as int
1835
- */
1836
- set bit28le(value) {
1837
- this.bit(value, 28, undefined, "little");
1838
- }
1839
- /**
1840
- * Bit field writer. Writes 28 bits.
1841
- *
1842
- * Note: When returning to a byte write, remaining bits are dropped.
1843
- *
1844
- * @param {number} value - value as int
1845
- */
1846
- set bit28be(value) {
1847
- this.bit(value, 28, undefined, "big");
1848
- }
1849
- /**
1850
- * Bit field writer. Writes 28 bits.
1851
- *
1852
- * Note: When returning to a byte write, remaining bits are dropped.
1853
- *
1854
- * @param {number} value - value as int
1855
- */
1856
- set ubit28(value) {
1857
- this.bit(value, 28, true);
1858
- }
1859
- /**
1860
- * Bit field writer. Writes 28 bits.
1861
- *
1862
- * Note: When returning to a byte write, remaining bits are dropped.
1863
- *
1864
- * @param {number} value - value as int
1865
- */
1866
- set ubit28le(value) {
1867
- this.bit(value, 28, true, "little");
1868
- ;
1869
- }
1870
- /**
1871
- * Bit field writer. Writes 28 bits.
1872
- *
1873
- * Note: When returning to a byte write, remaining bits are dropped.
1874
- *
1875
- * @param {number} value - value as int
1876
- */
1877
- set ubit28be(value) {
1878
- this.bit(value, 28, true, "big");
1879
- }
1880
- /**
1881
- * Bit field writer. Writes 29 bits.
1882
- *
1883
- * Note: When returning to a byte write, remaining bits are dropped.
1884
- *
1885
- * @param {number} value - value as int
1886
- */
1887
- set bit29(value) {
1888
- this.bit(value, 29);
1889
- }
1890
- /**
1891
- * Bit field writer. Writes 29 bits.
1892
- *
1893
- * Note: When returning to a byte write, remaining bits are dropped.
1894
- *
1895
- * @param {number} value - value as int
1896
- */
1897
- set bit29le(value) {
1898
- this.bit(value, 29, undefined, "little");
1899
- }
1900
- /**
1901
- * Bit field writer. Writes 29 bits.
1902
- *
1903
- * Note: When returning to a byte write, remaining bits are dropped.
1904
- *
1905
- * @param {number} value - value as int
1906
- */
1907
- set bit29be(value) {
1908
- this.bit(value, 29, undefined, "big");
1909
- }
1910
- /**
1911
- * Bit field writer. Writes 29 bits.
1912
- *
1913
- * Note: When returning to a byte write, remaining bits are dropped.
1914
- *
1915
- * @param {number} value - value as int
1916
- */
1917
- set ubit29(value) {
1918
- this.bit(value, 29, true);
1919
- }
1920
- /**
1921
- * Bit field writer. Writes 29 bits.
1922
- *
1923
- * Note: When returning to a byte write, remaining bits are dropped.
1924
- *
1925
- * @param {number} value - value as int
1926
- */
1927
- set ubit29le(value) {
1928
- this.bit(value, 29, true, "little");
1929
- ;
1930
- }
1931
- /**
1932
- * Bit field writer. Writes 29 bits.
1933
- *
1934
- * Note: When returning to a byte write, remaining bits are dropped.
1935
- *
1936
- * @param {number} value - value as int
1937
- */
1938
- set ubit29be(value) {
1939
- this.bit(value, 29, true, "big");
1940
- }
1941
- /**
1942
- * Bit field writer. Writes 30 bits.
1943
- *
1944
- * Note: When returning to a byte write, remaining bits are dropped.
1945
- *
1946
- * @param {number} value - value as int
1947
- */
1948
- set bit30(value) {
1949
- this.bit(value, 30);
1950
- }
1951
- /**
1952
- * Bit field writer. Writes 30 bits.
1953
- *
1954
- * Note: When returning to a byte write, remaining bits are dropped.
1955
- *
1956
- * @param {number} value - value as int
1957
- */
1958
- set bit30le(value) {
1959
- this.bit(value, 30, undefined, "little");
1960
- }
1961
- /**
1962
- * Bit field writer. Writes 30 bits.
1963
- *
1964
- * Note: When returning to a byte write, remaining bits are dropped.
1965
- *
1966
- * @param {number} value - value as int
1967
- */
1968
- set bit30be(value) {
1969
- this.bit(value, 30, undefined, "big");
1970
- }
1971
- /**
1972
- * Bit field writer. Writes 30 bits.
1973
- *
1974
- * Note: When returning to a byte write, remaining bits are dropped.
1975
- *
1976
- * @param {number} value - value as int
1977
- */
1978
- set ubit30(value) {
1979
- this.bit(value, 30, true);
1980
- }
1981
- /**
1982
- * Bit field writer. Writes 30 bits.
1983
- *
1984
- * Note: When returning to a byte write, remaining bits are dropped.
1985
- *
1986
- * @param {number} value - value as int
1987
- */
1988
- set ubit30le(value) {
1989
- this.bit(value, 30, true, "little");
1990
- ;
1991
- }
1992
- /**
1993
- * Bit field writer. Writes 30 bits.
1994
- *
1995
- * Note: When returning to a byte write, remaining bits are dropped.
1996
- *
1997
- * @param {number} value - value as int
1998
- */
1999
- set ubit30be(value) {
2000
- this.bit(value, 30, true, "big");
2001
- }
2002
- /**
2003
- * Bit field writer. Writes 31 bits.
2004
- *
2005
- * Note: When returning to a byte write, remaining bits are dropped.
2006
- *
2007
- * @param {number} value - value as int
2008
- */
2009
- set bit31(value) {
2010
- this.bit(value, 31);
2011
- }
2012
- /**
2013
- * Bit field writer. Writes 31 bits.
2014
- *
2015
- * Note: When returning to a byte write, remaining bits are dropped.
2016
- *
2017
- * @param {number} value - value as int
2018
- */
2019
- set bit31le(value) {
2020
- this.bit(value, 31, undefined, "little");
2021
- }
2022
- /**
2023
- * Bit field writer. Writes 31 bits.
2024
- *
2025
- * Note: When returning to a byte write, remaining bits are dropped.
2026
- *
2027
- * @param {number} value - value as int
2028
- */
2029
- set bit31be(value) {
2030
- this.bit(value, 31, undefined, "big");
2031
- }
2032
- /**
2033
- * Bit field writer. Writes 31 bits.
2034
- *
2035
- * Note: When returning to a byte write, remaining bits are dropped.
2036
- *
2037
- * @param {number} value - value as int
2038
- */
2039
- set ubit31(value) {
2040
- this.bit(value, 31, true);
2041
- }
2042
- /**
2043
- * Bit field writer. Writes 31 bits.
2044
- *
2045
- * Note: When returning to a byte write, remaining bits are dropped.
2046
- *
2047
- * @param {number} value - value as int
2048
- */
2049
- set ubit31le(value) {
2050
- this.bit(value, 31, true, "little");
2051
- ;
2052
- }
2053
- /**
2054
- * Bit field writer. Writes 31 bits.
2055
- *
2056
- * Note: When returning to a byte write, remaining bits are dropped.
2057
- *
2058
- * @param {number} value - value as int
2059
- */
2060
- set ubit31be(value) {
2061
- this.bit(value, 31, true, "big");
2062
- }
2063
- /**
2064
- * Bit field writer. Writes 32 bits.
2065
- *
2066
- * Note: When returning to a byte write, remaining bits are dropped.
2067
- *
2068
- * @param {number} value - value as int
2069
- */
2070
- set bit32(value) {
2071
- this.bit(value, 32);
2072
- }
2073
- /**
2074
- * Bit field writer. Writes 32 bits.
2075
- *
2076
- * Note: When returning to a byte write, remaining bits are dropped.
2077
- *
2078
- * @param {number} value - value as int
2079
- */
2080
- set bit32le(value) {
2081
- this.bit(value, 32, undefined, "little");
2082
- }
2083
- /**
2084
- * Bit field writer. Writes 32 bits.
2085
- *
2086
- * Note: When returning to a byte write, remaining bits are dropped.
2087
- *
2088
- * @param {number} value - value as int
2089
- */
2090
- set bit32be(value) {
2091
- this.bit(value, 32, undefined, "big");
2092
- }
2093
- /**
2094
- * Bit field writer. Writes 32 bits.
2095
- *
2096
- * Note: When returning to a byte write, remaining bits are dropped.
2097
- *
2098
- * @param {number} value - value as int
2099
- */
2100
- set ubit32(value) {
2101
- this.bit(value, 32, true);
2102
- }
2103
- /**
2104
- * Bit field writer. Writes 32 bits.
2105
- *
2106
- * Note: When returning to a byte write, remaining bits are dropped.
2107
- *
2108
- * @param {number} value - value as int
2109
- */
2110
- set ubit32le(value) {
2111
- this.bit(value, 32, true, "little");
2112
- ;
2113
- }
2114
- /**
2115
- * Bit field writer. Writes 32 bits.
2116
- *
2117
- * Note: When returning to a byte write, remaining bits are dropped.
2118
- *
2119
- * @param {number} value - value as int
2120
- */
2121
- set ubit32be(value) {
2122
- this.bit(value, 32, true, "big");
2123
- }
2124
- //
2125
- // byte write
2126
- //
2127
- /**
2128
- * Write byte.
2129
- *
2130
- * @param {number} value - value as int
2131
- */
2132
- set byte(value) {
2133
- this.writeByte(value);
2134
- }
2135
- /**
2136
- * Write byte.
2137
- *
2138
- * @param {number} value - value as int
2139
- */
2140
- set int8(value) {
2141
- this.writeByte(value);
2142
- }
2143
- /**
2144
- * Write unsigned byte.
2145
- *
2146
- * @param {number} value - value as int
2147
- */
2148
- set uint8(value) {
2149
- this.writeByte(value, true);
2150
- }
2151
- /**
2152
- * Write unsigned byte.
2153
- *
2154
- * @param {number} value - value as int
2155
- */
2156
- set ubyte(value) {
2157
- this.writeByte(value, true);
2158
- }
2159
- //
2160
- // short writes
2161
- //
2162
- /**
2163
- * Write int16.
2164
- *
2165
- * @param {number} value - value as int
2166
- */
2167
- set int16(value) {
2168
- this.writeInt16(value);
2169
- }
2170
- /**
2171
- * Write int16.
2172
- *
2173
- * @param {number} value - value as int
2174
- */
2175
- set short(value) {
2176
- this.writeInt16(value);
2177
- }
2178
- /**
2179
- * Write int16.
2180
- *
2181
- * @param {number} value - value as int
2182
- */
2183
- set word(value) {
2184
- this.writeInt16(value);
2185
- }
2186
- /**
2187
- * Write unsigned int16.
2188
- *
2189
- * @param {number} value - value as int
2190
- */
2191
- set uint16(value) {
2192
- this.writeInt16(value, true);
2193
- }
2194
- /**
2195
- * Write unsigned int16.
2196
- *
2197
- * @param {number} value - value as int
2198
- */
2199
- set ushort(value) {
2200
- this.writeInt16(value, true);
2201
- }
2202
- /**
2203
- * Write unsigned int16.
2204
- *
2205
- * @param {number} value - value as int
2206
- */
2207
- set uword(value) {
2208
- this.writeInt16(value, true);
2209
- }
2210
- /**
2211
- * Write signed int16.
2212
- *
2213
- * @param {number} value - value as int
2214
- */
2215
- set int16be(value) {
2216
- this.writeInt16(value, false, "big");
2217
- }
2218
- /**
2219
- * Write signed int16.
2220
- *
2221
- * @param {number} value - value as int
2222
- */
2223
- set shortbe(value) {
2224
- this.writeInt16(value, false, "big");
2225
- }
2226
- /**
2227
- * Write signed int16.
2228
- *
2229
- * @param {number} value - value as int
2230
- */
2231
- set wordbe(value) {
2232
- this.writeInt16(value, false, "big");
2233
- }
2234
- /**
2235
- * Write unsigned int16.
2236
- *
2237
- * @param {number} value - value as int
2238
- */
2239
- set uint16be(value) {
2240
- this.writeInt16(value, true, "big");
2241
- }
2242
- /**
2243
- * Write unsigned int16.
2244
- *
2245
- * @param {number} value - value as int
2246
- */
2247
- set ushortbe(value) {
2248
- this.writeInt16(value, true, "big");
2249
- }
2250
- /**
2251
- * Write unsigned int16.
2252
- *
2253
- * @param {number} value - value as int
2254
- */
2255
- set uwordbe(value) {
2256
- this.writeInt16(value, true, "big");
2257
- }
2258
- /**
2259
- * Write signed int16.
2260
- *
2261
- * @param {number} value - value as int
2262
- */
2263
- set int16le(value) {
2264
- this.writeInt16(value, false, "little");
2265
- }
2266
- /**
2267
- * Write signed int16.
2268
- *
2269
- * @param {number} value - value as int
2270
- */
2271
- set shortle(value) {
2272
- this.writeInt16(value, false, "little");
2273
- }
2274
- /**
2275
- * Write signed int16.
2276
- *
2277
- * @param {number} value - value as int
2278
- */
2279
- set wordle(value) {
2280
- this.writeInt16(value, false, "little");
2281
- }
2282
- /**
2283
- * Write unsigned int16.
2284
- *
2285
- * @param {number} value - value as int
2286
- */
2287
- set uint16le(value) {
2288
- this.writeInt16(value, true, "little");
2289
- }
2290
- /**
2291
- * Write unsigned int16.
2292
- *
2293
- * @param {number} value - value as int
2294
- */
2295
- set ushortle(value) {
2296
- this.writeInt16(value, true, "little");
2297
- }
2298
- /**
2299
- * Write unsigned int16.
2300
- *
2301
- * @param {number} value - value as int
2302
- */
2303
- set uwordle(value) {
2304
- this.writeInt16(value, true, "little");
2305
- }
2306
- //
2307
- // half float
2308
- //
2309
- /**
2310
- * Writes half float.
2311
- *
2312
- * @param {number} value - value as int
2313
- */
2314
- set half(value) {
2315
- this.writeHalfFloat(value);
2316
- }
2317
- /**
2318
- * Writes half float.
2319
- *
2320
- * @param {number} value - value as int
2321
- */
2322
- set halffloat(value) {
2323
- this.writeHalfFloat(value);
2324
- }
2325
- /**
2326
- * Writes half float.
2327
- *
2328
- * @param {number} value - value as int
2329
- */
2330
- set halffloatbe(value) {
2331
- this.writeHalfFloat(value, "big");
2332
- }
2333
- /**
2334
- * Writes half float.
2335
- *
2336
- * @param {number} value - value as int
2337
- */
2338
- set halfbe(value) {
2339
- this.writeHalfFloat(value, "big");
2340
- }
2341
- /**
2342
- * Writes half float.
2343
- *
2344
- * @param {number} value - value as int
2345
- */
2346
- set halffloatle(value) {
2347
- this.writeHalfFloat(value, "little");
2348
- }
2349
- /**
2350
- * Writes half float.
2351
- *
2352
- * @param {number} value - value as int
2353
- */
2354
- set halfle(value) {
2355
- this.writeHalfFloat(value, "little");
2356
- }
2357
- //
2358
- // int32 write
2359
- //
2360
- /**
2361
- * Write int32.
2362
- *
2363
- * @param {number} value - value as int
2364
- */
2365
- set int(value) {
2366
- this.writeInt32(value);
2367
- }
2368
- /**
2369
- * Write int32.
2370
- *
2371
- * @param {number} value - value as int
2372
- */
2373
- set int32(value) {
2374
- this.writeInt32(value);
2375
- }
2376
- /**
2377
- * Write int32.
2378
- *
2379
- * @param {number} value - value as int
2380
- */
2381
- set double(value) {
2382
- this.writeInt32(value);
2383
- }
2384
- /**
2385
- * Write int32.
2386
- *
2387
- * @param {number} value - value as int
2388
- */
2389
- set long(value) {
2390
- this.writeInt32(value);
2391
- }
2392
- /**
2393
- * Write unsigned int32.
2394
- *
2395
- * @param {number} value - value as int
2396
- */
2397
- set uint32(value) {
2398
- this.writeInt32(value, true);
2399
- }
2400
- /**
2401
- * Write unsigned int32.
2402
- *
2403
- * @param {number} value - value as int
2404
- */
2405
- set uint(value) {
2406
- this.writeInt32(value, true);
2407
- }
2408
- /**
2409
- * Write unsigned int32.
2410
- *
2411
- * @param {number} value - value as int
2412
- */
2413
- set udouble(value) {
2414
- this.writeInt32(value, true);
2415
- }
2416
- /**
2417
- * Write unsigned int32.
2418
- *
2419
- * @param {number} value - value as int
2420
- */
2421
- set ulong(value) {
2422
- this.writeInt32(value, true);
2423
- }
2424
- /**
2425
- * Write signed int32.
2426
- *
2427
- * @param {number} value - value as int
2428
- */
2429
- set int32le(value) {
2430
- this.writeInt32(value, false, "little");
2431
- }
2432
- /**
2433
- * Write signed int32.
2434
- *
2435
- * @param {number} value - value as int
2436
- */
2437
- set intle(value) {
2438
- this.writeInt32(value, false, "little");
2439
- }
2440
- /**
2441
- * Write signed int32.
2442
- *
2443
- * @param {number} value - value as int
2444
- */
2445
- set doublele(value) {
2446
- this.writeInt32(value, false, "little");
2447
- }
2448
- /**
2449
- * Write signed int32.
2450
- *
2451
- * @param {number} value - value as int
2452
- */
2453
- set longle(value) {
2454
- this.writeInt32(value, false, "little");
2455
- }
2456
- /**
2457
- * Write unsigned int32.
2458
- *
2459
- * @param {number} value - value as int
2460
- */
2461
- set uint32le(value) {
2462
- this.writeInt32(value, true, "little");
2463
- }
2464
- /**
2465
- * Write unsigned int32.
2466
- *
2467
- * @param {number} value - value as int
2468
- */
2469
- set uintle(value) {
2470
- this.writeInt32(value, true, "little");
2471
- }
2472
- /**
2473
- * Write unsigned int32.
2474
- *
2475
- * @param {number} value - value as int
2476
- */
2477
- set udoublele(value) {
2478
- this.writeInt32(value, true, "little");
2479
- }
2480
- /**
2481
- * Write unsigned int32.
2482
- *
2483
- * @param {number} value - value as int
2484
- */
2485
- set ulongle(value) {
2486
- this.writeInt32(value, true, "little");
2487
- }
2488
- /**
2489
- * Write signed int32.
2490
- *
2491
- * @param {number} value - value as int
2492
- */
2493
- set intbe(value) {
2494
- this.writeInt32(value, false, "big");
2495
- }
2496
- /**
2497
- * Write signed int32.
2498
- *
2499
- * @param {number} value - value as int
2500
- */
2501
- set int32be(value) {
2502
- this.writeInt32(value, false, "big");
2503
- }
2504
- /**
2505
- * Write signed int32.
2506
- *
2507
- * @param {number} value - value as int
2508
- */
2509
- set doublebe(value) {
2510
- this.writeInt32(value, false, "big");
2511
- }
2512
- /**
2513
- * Write signed int32.
2514
- *
2515
- * @param {number} value - value as int
2516
- */
2517
- set longbe(value) {
2518
- this.writeInt32(value, false, "big");
2519
- }
2520
- /**
2521
- * Write unsigned int32.
2522
- *
2523
- * @param {number} value - value as int
2524
- */
2525
- set writeUInt32BE(value) {
2526
- this.writeInt32(value, true, "big");
2527
- }
2528
- /**
2529
- * Write unsigned int32.
2530
- *
2531
- * @param {number} value - value as int
2532
- */
2533
- set uint32be(value) {
2534
- this.writeInt32(value, true, "big");
2535
- }
2536
- /**
2537
- * Write unsigned int32.
2538
- *
2539
- * @param {number} value - value as int
2540
- */
2541
- set uintbe(value) {
2542
- this.writeInt32(value, true, "big");
2543
- }
2544
- /**
2545
- * Write unsigned int32.
2546
- *
2547
- * @param {number} value - value as int
2548
- */
2549
- set udoublebe(value) {
2550
- this.writeInt32(value, true, "big");
2551
- }
2552
- /**
2553
- * Write unsigned int32.
2554
- *
2555
- * @param {number} value - value as int
2556
- */
2557
- set ulongbe(value) {
2558
- this.writeInt32(value, true, "big");
2559
- }
2560
- //
2561
- // float write
2562
- //
2563
- /**
2564
- * Write float.
2565
- *
2566
- * @param {number} value - value as int
2567
- */
2568
- set float(value) {
2569
- this.writeFloat(value);
2570
- }
2571
- /**
2572
- * Write float.
2573
- *
2574
- * @param {number} value - value as int
2575
- */
2576
- set floatle(value) {
2577
- this.writeFloat(value, "little");
2578
- }
2579
- /**
2580
- * Write float.
2581
- *
2582
- * @param {number} value - value as int
2583
- */
2584
- set floatbe(value) {
2585
- this.writeFloat(value, "big");
2586
- }
2587
- //
2588
- // int64 write
2589
- //
2590
- /**
2591
- * Write 64 bit integer.
2592
- *
2593
- * @param {number} value - value as int
2594
- */
2595
- set int64(value) {
2596
- this.writeInt64(value);
2597
- }
2598
- /**
2599
- * Write 64 bit integer.
2600
- *
2601
- * @param {number} value - value as int
2602
- */
2603
- set quad(value) {
2604
- this.writeInt64(value);
2605
- }
2606
- /**
2607
- * Write 64 bit integer.
2608
- *
2609
- * @param {number} value - value as int
2610
- */
2611
- set bigint(value) {
2612
- this.writeInt64(value);
2613
- }
2614
- /**
2615
- * Write unsigned 64 bit integer.
2616
- *
2617
- * @param {number} value - value as int
2618
- */
2619
- set uint64(value) {
2620
- this.writeInt64(value, true);
2621
- }
2622
- /**
2623
- * Write unsigned 64 bit integer.
2624
- *
2625
- * @param {number} value - value as int
2626
- */
2627
- set ubigint(value) {
2628
- this.writeInt64(value, true);
2629
- }
2630
- /**
2631
- * Write unsigned 64 bit integer.
2632
- *
2633
- * @param {number} value - value as int
2634
- */
2635
- set uquad(value) {
2636
- this.writeInt64(value, true);
2637
- }
2638
- /**
2639
- * Write signed 64 bit integer.
2640
- *
2641
- * @param {number} value - value as int
2642
- */
2643
- set int64le(value) {
2644
- this.writeInt64(value, false, "little");
2645
- }
2646
- /**
2647
- * Write signed 64 bit integer.
2648
- *
2649
- * @param {number} value - value as int
2650
- */
2651
- set bigintle(value) {
2652
- this.writeInt64(value, false, "little");
2653
- }
2654
- /**
2655
- * Write signed 64 bit integer.
2656
- *
2657
- * @param {number} value - value as int
2658
- */
2659
- set quadle(value) {
2660
- this.writeInt64(value, false, "little");
2661
- }
2662
- /**
2663
- * Write unsigned 64 bit integer.
2664
- *
2665
- * @param {number} value - value as int
2666
- */
2667
- set uint64le(value) {
2668
- this.writeInt64(value, true, "little");
2669
- }
2670
- /**
2671
- * Write unsigned 64 bit integer.
2672
- *
2673
- * @param {number} value - value as int
2674
- */
2675
- set ubigintle(value) {
2676
- this.writeInt64(value, true, "little");
2677
- }
2678
- /**
2679
- * Write unsigned 64 bit integer.
2680
- *
2681
- * @param {number} value - value as int
2682
- */
2683
- set uquadle(value) {
2684
- this.writeInt64(value, true, "little");
2685
- }
2686
- /**
2687
- * Write signed 64 bit integer.
2688
- *
2689
- * @param {number} value - value as int
2690
- */
2691
- set int64be(value) {
2692
- this.writeInt64(value, false, "big");
2693
- }
2694
- /**
2695
- * Write signed 64 bit integer.
2696
- *
2697
- * @param {number} value - value as int
2698
- */
2699
- set bigintbe(value) {
2700
- this.writeInt64(value, false, "big");
2701
- }
2702
- /**
2703
- * Write signed 64 bit integer.
2704
- *
2705
- * @param {number} value - value as int
2706
- */
2707
- set quadbe(value) {
2708
- this.writeInt64(value, false, "big");
2709
- }
2710
- /**
2711
- * Write unsigned 64 bit integer.
2712
- *
2713
- * @param {number} value - value as int
2714
- */
2715
- set uint64be(value) {
2716
- this.writeInt64(value, true, "big");
2717
- }
2718
- /**
2719
- * Write unsigned 64 bit integer.
2720
- *
2721
- * @param {number} value - value as int
2722
- */
2723
- set ubigintbe(value) {
2724
- this.writeInt64(value, true, "big");
2725
- }
2726
- /**
2727
- * Write unsigned 64 bit integer.
2728
- *
2729
- * @param {number} value - value as int
2730
- */
2731
- set uquadbe(value) {
2732
- this.writeInt64(value, true, "big");
2733
- }
2734
- //
2735
- // doublefloat
2736
- //
2737
- /**
2738
- * Writes double float.
2739
- *
2740
- * @param {number} value - value as int
2741
- */
2742
- set doublefloat(value) {
2743
- this.writeDoubleFloat(value);
2744
- }
2745
- /**
2746
- * Writes double float.
2747
- *
2748
- * @param {number} value - value as int
2749
- */
2750
- set dfloat(value) {
2751
- this.writeDoubleFloat(value);
2752
- }
2753
- /**
2754
- * Writes double float.
2755
- *
2756
- * @param {number} value - value as int
2757
- */
2758
- set dfloatbe(value) {
2759
- this.writeDoubleFloat(value, "big");
2760
- }
2761
- /**
2762
- * Writes double float.
2763
- *
2764
- * @param {number} value - value as int
2765
- */
2766
- set doublefloatbe(value) {
2767
- this.writeDoubleFloat(value, "big");
2768
- }
2769
- /**
2770
- * Writes double float.
2771
- *
2772
- * @param {number} value - value as int
2773
- */
2774
- set dfloatle(value) {
2775
- this.writeDoubleFloat(value, "little");
2776
- }
2777
- /**
2778
- * Writes double float.
2779
- *
2780
- * @param {number} value - value as int
2781
- */
2782
- set doublefloatle(value) {
2783
- this.writeDoubleFloat(value, "little");
2784
- }
2785
- //
2786
- // string
2787
- //
2788
- /**
2789
- * Writes string, use options object for different types.
2790
- *
2791
- *
2792
- * @param {string} string - text string
2793
- * @param {object} options - options:
2794
- * ```javascript
2795
- * {
2796
- * length: string.length, //for fixed length, non-terminate value utf strings
2797
- * stringType: "utf-8", //utf-8, utf-16, pascal or wide-pascal
2798
- * terminateValue: 0x00, // only with stringType: "utf"
2799
- * lengthWriteSize: 1, //for pascal strings. 1, 2 or 4 byte length write size
2800
- * encoding: "utf-8", //TextEncoder accepted types
2801
- * endian: "little", //for wide-pascal and utf-16
2802
- * }
2803
- * ```
2804
- */
2805
- string(string, options) {
2806
- return this.writeString(string, options);
2807
- }
2808
- /**
2809
- * Writes UTF-8 (C) string.
2810
- *
2811
- * @param {string} string - text string
2812
- * @param {number} length - for fixed length utf strings
2813
- * @param {number} terminateValue - for non-fixed length utf strings
2814
- *
2815
- * @return string
2816
- */
2817
- utf8string(string, length, terminateValue) {
2818
- return this.string(string, { stringType: "utf-8", encoding: "utf-8", length: length, terminateValue: terminateValue });
2819
- }
2820
- /**
2821
- * Writes UTF-8 (C) string.
2822
- *
2823
- * @param {string} string - text string
2824
- * @param {number} length - for fixed length utf strings
2825
- * @param {number} terminateValue - for non-fixed length utf strings
2826
- *
2827
- * @return string
2828
- */
2829
- cstring(string, length, terminateValue) {
2830
- return this.string(string, { stringType: "utf-8", encoding: "utf-8", length: length, terminateValue: terminateValue });
2831
- }
2832
- /**
2833
- * Writes ANSI string.
2834
- *
2835
- * @param {string} string - text string
2836
- * @param {number} length - for fixed length utf strings
2837
- * @param {number} terminateValue - for non-fixed length utf strings
2838
- */
2839
- ansistring(string, length, terminateValue) {
2840
- return this.string(string, { stringType: "utf-8", encoding: "windows-1252", length: length, terminateValue: terminateValue });
2841
- }
2842
- /**
2843
- * Writes UTF-16 (Unicode) string.
2844
- *
2845
- * @param {string} string - text string
2846
- * @param {number} length - for fixed length utf strings
2847
- * @param {number} terminateValue - for non-fixed length utf strings
2848
- * @param {string} endian - ``big`` or ``little``
2849
- */
2850
- utf16string(string, length, terminateValue, endian) {
2851
- return this.string(string, { stringType: "utf-16", encoding: "utf-16", length: length, terminateValue: terminateValue, endian: endian });
2852
- }
2853
- /**
2854
- * Writes UTF-16 (Unicode) string.
2855
- *
2856
- * @param {string} string - text string
2857
- * @param {number} length - for fixed length utf strings
2858
- * @param {number} terminateValue - for non-fixed length utf strings
2859
- * @param {string} endian - ``big`` or ``little``
2860
- */
2861
- unistring(string, length, terminateValue, endian) {
2862
- return this.string(string, { stringType: "utf-16", encoding: "utf-16", length: length, terminateValue: terminateValue, endian: endian });
2863
- }
2864
- /**
2865
- * Writes UTF-16 (Unicode) string in little endian order.
2866
- *
2867
- * @param {string} string - text string
2868
- * @param {number} length - for fixed length utf strings
2869
- * @param {number} terminateValue - for non-fixed length utf strings
2870
- */
2871
- utf16stringle(string, length, terminateValue) {
2872
- return this.string(string, { stringType: "utf-16", encoding: "utf-16", length: length, terminateValue: terminateValue, endian: "little" });
2873
- }
2874
- /**
2875
- * Writes UTF-16 (Unicode) string in little endian order.
2876
- *
2877
- * @param {string} string - text string
2878
- * @param {number} length - for fixed length utf strings
2879
- * @param {number} terminateValue - for non-fixed length utf strings
2880
- */
2881
- unistringle(string, length, terminateValue) {
2882
- return this.string(string, { stringType: "utf-16", encoding: "utf-16", length: length, terminateValue: terminateValue, endian: "little" });
2883
- }
2884
- /**
2885
- * Writes UTF-16 (Unicode) string in big endian order.
2886
- *
2887
- * @param {string} string - text string
2888
- * @param {number} length - for fixed length utf strings
2889
- * @param {number} terminateValue - for non-fixed length utf strings
2890
- */
2891
- utf16stringbe(string, length, terminateValue) {
2892
- return this.string(string, { stringType: "utf-16", encoding: "utf-16", length: length, terminateValue: terminateValue, endian: "big" });
2893
- }
2894
- /**
2895
- * Writes UTF-16 (Unicode) string in big endian order.
2896
- *
2897
- * @param {string} string - text string
2898
- * @param {number} length - for fixed length utf strings
2899
- * @param {number} terminateValue - for non-fixed length utf strings
2900
- */
2901
- unistringbe(string, length, terminateValue) {
2902
- return this.string(string, { stringType: "utf-16", encoding: "utf-16", length: length, terminateValue: terminateValue, endian: "big" });
2903
- }
2904
- /**
2905
- * Writes Pascal string.
2906
- *
2907
- * @param {string} string - text string
2908
- * @param {number} lengthWriteSize - 1, 2 or 4 byte length write size (default 1)
2909
- * @param {string} endian - ``big`` or ``little`` for 2 or 4 byte length write size
2910
- */
2911
- pstring(string, lengthWriteSize, endian) {
2912
- return this.string(string, { stringType: "pascal", encoding: "utf-8", lengthWriteSize: lengthWriteSize, endian: endian });
2913
- }
2914
- /**
2915
- * Writes Pascal string 1 byte length read.
2916
- *
2917
- * @param {string} string - text string
2918
- * @param {string} endian - ``big`` or ``little`` for 2 or 4 byte length write size
2919
- */
2920
- pstring1(string, endian) {
2921
- return this.string(string, { stringType: "pascal", encoding: "utf-8", lengthWriteSize: 1, endian: endian });
2922
- }
2923
- /**
2924
- * Writes Pascal string 1 byte length read in little endian order.
2925
- *
2926
- * @param {string} string - text string
2927
- */
2928
- pstring1le(string) {
2929
- return this.string(string, { stringType: "pascal", encoding: "utf-8", lengthWriteSize: 1, endian: "little" });
2930
- }
2931
- /**
2932
- * Writes Pascal string 1 byte length read in big endian order.
2933
- *
2934
- * @param {string} string - text string
2935
- */
2936
- pstring1be(string) {
2937
- return this.string(string, { stringType: "pascal", encoding: "utf-8", lengthWriteSize: 1, endian: "big" });
2938
- }
2939
- /**
2940
- * Writes Pascal string 2 byte length read.
2941
- *
2942
- * @param {string} string - text string
2943
- * @param {string} endian - ``big`` or ``little``
2944
- */
2945
- pstring2(string, endian) {
2946
- return this.string(string, { stringType: "pascal", encoding: "utf-8", lengthWriteSize: 2, endian: endian });
2947
- }
2948
- /**
2949
- * Writes Pascal string 2 byte length read in little endian order.
2950
- *
2951
- * @param {string} string - text string
2952
- */
2953
- pstring2le(string) {
2954
- return this.string(string, { stringType: "pascal", encoding: "utf-8", lengthWriteSize: 2, endian: "little" });
2955
- }
2956
- /**
2957
- * Writes Pascal string 2 byte length read in big endian order.
2958
- *
2959
- * @param {string} string - text string
2960
- */
2961
- pstring2be(string) {
2962
- return this.string(string, { stringType: "pascal", encoding: "utf-8", lengthWriteSize: 2, endian: "big" });
2963
- }
2964
- /**
2965
- * Writes Pascal string 4 byte length read.
2966
- *
2967
- * @param {string} string - text string
2968
- * @param {string} endian - ``big`` or ``little``
2969
- */
2970
- pstring4(string, endian) {
2971
- return this.string(string, { stringType: "pascal", encoding: "utf-8", lengthWriteSize: 4, endian: endian });
2972
- }
2973
- /**
2974
- * Writes Pascal string 4 byte length read in big endian order.
2975
- *
2976
- * @param {string} string - text string
2977
- */
2978
- pstring4be(string) {
2979
- return this.string(string, { stringType: "pascal", encoding: "utf-8", lengthWriteSize: 4, endian: "big" });
2980
- }
2981
- /**
2982
- * Writes Pascal string 4 byte length read in little endian order.
2983
- *
2984
- * @param {string} string - text string
2985
- */
2986
- pstring4le(string) {
2987
- return this.string(string, { stringType: "pascal", encoding: "utf-8", lengthWriteSize: 4, endian: "little" });
2988
- }
2989
- /**
2990
- * Writes Wide-Pascal string.
2991
- *
2992
- * @param {string} string - text string
2993
- * @param {number} lengthWriteSize - 1, 2 or 4 byte length write size (default 1)
2994
- * @param {string} endian - ``big`` or ``little``
2995
- */
2996
- wpstring(string, lengthWriteSize, endian) {
2997
- return this.string(string, { stringType: "wide-pascal", encoding: "utf-16", lengthWriteSize: lengthWriteSize, endian: endian });
2998
- }
2999
- /**
3000
- * Writes Wide-Pascal string in big endian order.
3001
- *
3002
- * @param {string} string - text string
3003
- * @param {number} lengthWriteSize - 1, 2 or 4 byte length write size (default 1)
3004
- */
3005
- wpstringbe(string, lengthWriteSize) {
3006
- return this.string(string, { stringType: "wide-pascal", encoding: "utf-16", lengthWriteSize: lengthWriteSize, endian: "big" });
3007
- }
3008
- /**
3009
- * Writes Wide-Pascal string in little endian order.
3010
- *
3011
- * @param {string} string - text string
3012
- * @param {number} lengthWriteSize - 1, 2 or 4 byte length write size (default 1)
3013
- */
3014
- wpstringle(string, lengthWriteSize) {
3015
- return this.string(string, { stringType: "wide-pascal", encoding: "utf-16", lengthWriteSize: lengthWriteSize, endian: "little" });
3016
- }
3017
- /**
3018
- * Writes Wide-Pascal string.
3019
- *
3020
- * @param {string} string - text string
3021
- * @param {string} endian - ``big`` or ``little``
3022
- */
3023
- wpstring1(string, endian) {
3024
- return this.string(string, { stringType: "wide-pascal", encoding: "utf-16", lengthWriteSize: 1, endian: endian });
3025
- }
3026
- /**
3027
- * Writes Wide-Pascal string 1 byte length read in big endian order.
3028
- *
3029
- * @param {string} string - text string
3030
- */
3031
- wpstring1be(string) {
3032
- return this.string(string, { stringType: "wide-pascal", encoding: "utf-16", lengthWriteSize: 1, endian: "big" });
3033
- }
3034
- /**
3035
- * Writes Wide-Pascal string 1 byte length read in little endian order.
3036
- *
3037
- * @param {string} string - text string
3038
- */
3039
- wpstring1le(string) {
3040
- return this.string(string, { stringType: "wide-pascal", encoding: "utf-16", lengthWriteSize: 1, endian: "little" });
3041
- }
3042
- /**
3043
- * Writes Wide-Pascal string 2 byte length read.
3044
- *
3045
- * @param {string} string - text string
3046
- * @param {string} endian - ``big`` or ``little``
3047
- */
3048
- wpstring2(string, endian) {
3049
- return this.string(string, { stringType: "wide-pascal", encoding: "utf-16", lengthWriteSize: 2, endian: endian });
3050
- }
3051
- /**
3052
- * Writes Wide-Pascal string 2 byte length read in little endian order.
3053
- *
3054
- * @param {string} string - text string
3055
- */
3056
- wpstring2le(string) {
3057
- return this.string(string, { stringType: "wide-pascal", encoding: "utf-16", lengthWriteSize: 2, endian: "little" });
3058
- }
3059
- /**
3060
- * Writes Wide-Pascal string 2 byte length read in big endian order.
3061
- *
3062
- * @param {string} string - text string
3063
- */
3064
- wpstring2be(string) {
3065
- return this.string(string, { stringType: "wide-pascal", encoding: "utf-16", lengthWriteSize: 2, endian: "big" });
3066
- }
3067
- /**
3068
- * Writes Wide-Pascal string 4 byte length read.
3069
- *
3070
- * @param {string} string - text string
3071
- * @param {string} endian - ``big`` or ``little``
3072
- */
3073
- wpstring4(string, endian) {
3074
- return this.string(string, { stringType: "wide-pascal", encoding: "utf-16", lengthWriteSize: 4, endian: endian });
3075
- }
3076
- /**
3077
- * Writes Wide-Pascal string 4 byte length read in little endian order.
3078
- *
3079
- * @param {string} string - text string
3080
- */
3081
- wpstring4le(string) {
3082
- return this.string(string, { stringType: "wide-pascal", encoding: "utf-16", lengthWriteSize: 4, endian: "little" });
3083
- }
3084
- /**
3085
- * Writes Wide-Pascal string 4 byte length read in big endian order.
3086
- *
3087
- * @param {string} string - text string
3088
- */
3089
- wpstring4be(string) {
3090
- return this.string(string, { stringType: "wide-pascal", encoding: "utf-16", lengthWriteSize: 4, endian: "big" });
3091
- }
3092
- }
3093
- exports.BiWriter = BiWriter;
3094
- //# sourceMappingURL=biwriter.js.map