@yume-chan/struct 0.0.13 → 0.0.16

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 (69) hide show
  1. package/CHANGELOG.json +33 -0
  2. package/CHANGELOG.md +21 -1
  3. package/LICENSE +21 -21
  4. package/README.md +767 -769
  5. package/esm/basic/definition.d.ts +3 -3
  6. package/esm/basic/definition.d.ts.map +1 -1
  7. package/esm/basic/definition.js +0 -1
  8. package/esm/basic/definition.js.map +1 -1
  9. package/esm/basic/field-value.d.ts +1 -0
  10. package/esm/basic/field-value.d.ts.map +1 -1
  11. package/esm/basic/field-value.js +4 -0
  12. package/esm/basic/field-value.js.map +1 -1
  13. package/esm/basic/stream.d.ts +2 -1
  14. package/esm/basic/stream.d.ts.map +1 -1
  15. package/esm/basic/struct-value.d.ts +7 -5
  16. package/esm/basic/struct-value.d.ts.map +1 -1
  17. package/esm/basic/struct-value.js +30 -14
  18. package/esm/basic/struct-value.js.map +1 -1
  19. package/esm/struct.d.ts +11 -11
  20. package/esm/struct.d.ts.map +1 -1
  21. package/esm/struct.js +55 -41
  22. package/esm/struct.js.map +1 -1
  23. package/esm/sync-promise.d.ts +13 -0
  24. package/esm/sync-promise.d.ts.map +1 -0
  25. package/esm/sync-promise.js +71 -0
  26. package/esm/sync-promise.js.map +1 -0
  27. package/esm/types/bigint.d.ts.map +1 -1
  28. package/esm/types/bigint.js +7 -5
  29. package/esm/types/bigint.js.map +1 -1
  30. package/esm/types/buffer/base.d.ts +4 -3
  31. package/esm/types/buffer/base.d.ts.map +1 -1
  32. package/esm/types/buffer/base.js +9 -7
  33. package/esm/types/buffer/base.js.map +1 -1
  34. package/esm/types/buffer/fixed-length.d.ts +1 -1
  35. package/esm/types/buffer/fixed-length.d.ts.map +1 -1
  36. package/esm/types/buffer/fixed-length.js.map +1 -1
  37. package/esm/types/buffer/variable-length.d.ts +2 -2
  38. package/esm/types/buffer/variable-length.d.ts.map +1 -1
  39. package/esm/types/buffer/variable-length.js.map +1 -1
  40. package/esm/types/number.d.ts +6 -5
  41. package/esm/types/number.d.ts.map +1 -1
  42. package/esm/types/number.js +25 -14
  43. package/esm/types/number.js.map +1 -1
  44. package/package.json +11 -11
  45. package/src/basic/definition.ts +68 -70
  46. package/src/basic/field-value.ts +72 -67
  47. package/src/basic/index.ts +5 -5
  48. package/src/basic/options.ts +19 -19
  49. package/src/basic/stream.ts +21 -19
  50. package/src/basic/struct-value.ts +61 -39
  51. package/src/index.ts +17 -17
  52. package/src/struct.ts +632 -609
  53. package/src/sync-promise.ts +114 -0
  54. package/src/types/bigint.ts +103 -102
  55. package/src/types/buffer/base.ts +179 -176
  56. package/src/types/buffer/fixed-length.ts +20 -17
  57. package/src/types/buffer/index.ts +3 -3
  58. package/src/types/buffer/variable-length.ts +158 -156
  59. package/src/types/index.ts +3 -3
  60. package/src/types/number.ts +127 -115
  61. package/src/utils.ts +70 -70
  62. package/tsconfig.build.json +3 -0
  63. package/tsconfig.build.tsbuildinfo +1 -0
  64. package/tsconfig.test.json +8 -0
  65. package/esm/syncbird.d.ts +0 -65
  66. package/esm/syncbird.d.ts.map +0 -1
  67. package/esm/syncbird.js +0 -38
  68. package/esm/syncbird.js.map +0 -1
  69. package/src/syncbird.ts +0 -131
@@ -1,156 +1,158 @@
1
- import { StructFieldValue, type StructFieldDefinition, type StructOptions, type StructValue } from '../../basic/index.js';
2
- import type { KeysOfType } from '../../utils.js';
3
- import { BufferLikeFieldDefinition, BufferLikeFieldValue, type BufferFieldSubType } from './base.js';
4
-
5
- export type LengthField<TFields> = KeysOfType<TFields, number | string>;
6
-
7
- export interface VariableLengthBufferLikeFieldOptions<
8
- TFields = object,
9
- TLengthField extends LengthField<TFields> = any,
10
- > {
11
- /**
12
- * The name of the field that contains the length of the buffer.
13
- *
14
- * This field must be a `number` or `string` (can't be `bigint`) field.
15
- */
16
- lengthField: TLengthField;
17
-
18
- /**
19
- * If the `lengthField` refers to a string field,
20
- * what radix to use when converting the string to a number.
21
- *
22
- * @default 10
23
- */
24
- lengthFieldRadix?: number;
25
- }
26
-
27
- export class VariableLengthBufferLikeFieldDefinition<
28
- TType extends BufferFieldSubType = BufferFieldSubType,
29
- TOptions extends VariableLengthBufferLikeFieldOptions = VariableLengthBufferLikeFieldOptions
30
- > extends BufferLikeFieldDefinition<
31
- TType,
32
- TOptions,
33
- TOptions['lengthField']
34
- > {
35
- public getSize(): number {
36
- return 0;
37
- }
38
-
39
- protected override getDeserializeSize(struct: StructValue) {
40
- let value = struct.value[this.options.lengthField] as number | string;
41
- if (typeof value === 'string') {
42
- value = Number.parseInt(value, this.options.lengthFieldRadix ?? 10);
43
- }
44
- return value;
45
- }
46
-
47
- public override create(
48
- options: Readonly<StructOptions>,
49
- struct: StructValue,
50
- value: TType['TTypeScriptType'],
51
- array?: Uint8Array
52
- ): VariableLengthBufferLikeStructFieldValue<this> {
53
- return new VariableLengthBufferLikeStructFieldValue(
54
- this,
55
- options,
56
- struct,
57
- value,
58
- array,
59
- );
60
- }
61
- }
62
-
63
- export class VariableLengthBufferLikeStructFieldValue<
64
- TDefinition extends VariableLengthBufferLikeFieldDefinition = VariableLengthBufferLikeFieldDefinition,
65
- > extends BufferLikeFieldValue<TDefinition> {
66
- protected length: number | undefined;
67
-
68
- protected lengthFieldValue: VariableLengthBufferLikeFieldLengthValue;
69
-
70
- public constructor(
71
- definition: TDefinition,
72
- options: Readonly<StructOptions>,
73
- struct: StructValue,
74
- value: TDefinition['TValue'],
75
- array?: Uint8Array,
76
- ) {
77
- super(definition, options, struct, value, array);
78
-
79
- if (array) {
80
- this.length = array.byteLength;
81
- }
82
-
83
- // Patch the associated length field.
84
- const lengthField = this.definition.options.lengthField;
85
-
86
- const originalValue = struct.get(lengthField);
87
- this.lengthFieldValue = new VariableLengthBufferLikeFieldLengthValue(
88
- originalValue,
89
- this,
90
- );
91
- struct.set(lengthField, this.lengthFieldValue);
92
- }
93
-
94
- public override getSize() {
95
- if (this.length === undefined) {
96
- this.length = this.definition.type.getSize(this.value);
97
- if (this.length === -1) {
98
- this.array = this.definition.type.toBuffer(this.value);
99
- this.length = this.array.byteLength;
100
- }
101
- }
102
-
103
- return this.length;
104
- }
105
-
106
- public override set(value: unknown) {
107
- super.set(value);
108
- this.array = undefined;
109
- this.length = undefined;
110
- }
111
- }
112
-
113
- // Not using `VariableLengthBufferLikeStructFieldValue` directly makes writing tests much easier...
114
- type VariableLengthBufferLikeFieldValueLike =
115
- StructFieldValue<StructFieldDefinition<VariableLengthBufferLikeFieldOptions, any, any>>;
116
-
117
- export class VariableLengthBufferLikeFieldLengthValue
118
- extends StructFieldValue {
119
- protected originalField: StructFieldValue;
120
-
121
- protected bufferField: VariableLengthBufferLikeFieldValueLike;
122
-
123
- public constructor(
124
- originalField: StructFieldValue,
125
- arrayBufferField: VariableLengthBufferLikeFieldValueLike,
126
- ) {
127
- super(originalField.definition, originalField.options, originalField.struct, 0);
128
- this.originalField = originalField;
129
- this.bufferField = arrayBufferField;
130
- }
131
-
132
- public override getSize() {
133
- return this.originalField.getSize();
134
- }
135
-
136
- public override get() {
137
- let value: string | number = this.bufferField.getSize();
138
-
139
- const originalValue = this.originalField.get();
140
- if (typeof originalValue === 'string') {
141
- value = value.toString(this.bufferField.definition.options.lengthFieldRadix ?? 10);
142
- }
143
-
144
- return value;
145
- }
146
-
147
- public override set() {
148
- // Ignore setting
149
- // It will always be in sync with the buffer size
150
- }
151
-
152
- serialize(dataView: DataView, offset: number) {
153
- this.originalField.set(this.get());
154
- this.originalField.serialize(dataView, offset);
155
- }
156
- }
1
+ import { StructFieldValue, type StructFieldDefinition, type StructOptions, type StructValue } from '../../basic/index.js';
2
+ import type { KeysOfType } from '../../utils.js';
3
+ import { BufferLikeFieldDefinition, BufferLikeFieldValue, type BufferFieldSubType } from './base.js';
4
+
5
+ export type LengthField<TFields> = KeysOfType<TFields, number | string>;
6
+
7
+ export interface VariableLengthBufferLikeFieldOptions<
8
+ TFields = object,
9
+ TLengthField extends LengthField<TFields> = any,
10
+ > {
11
+ /**
12
+ * The name of the field that contains the length of the buffer.
13
+ *
14
+ * This field must be a `number` or `string` (can't be `bigint`) field.
15
+ */
16
+ lengthField: TLengthField;
17
+
18
+ /**
19
+ * If the `lengthField` refers to a string field,
20
+ * what radix to use when converting the string to a number.
21
+ *
22
+ * @default 10
23
+ */
24
+ lengthFieldRadix?: number;
25
+ }
26
+
27
+ export class VariableLengthBufferLikeFieldDefinition<
28
+ TType extends BufferFieldSubType = BufferFieldSubType,
29
+ TOptions extends VariableLengthBufferLikeFieldOptions = VariableLengthBufferLikeFieldOptions,
30
+ TTypeScriptType = TType["TTypeScriptType"],
31
+ > extends BufferLikeFieldDefinition<
32
+ TType,
33
+ TOptions,
34
+ TOptions['lengthField'],
35
+ TTypeScriptType
36
+ > {
37
+ public getSize(): number {
38
+ return 0;
39
+ }
40
+
41
+ protected override getDeserializeSize(struct: StructValue) {
42
+ let value = struct.value[this.options.lengthField] as number | string;
43
+ if (typeof value === 'string') {
44
+ value = Number.parseInt(value, this.options.lengthFieldRadix ?? 10);
45
+ }
46
+ return value;
47
+ }
48
+
49
+ public override create(
50
+ options: Readonly<StructOptions>,
51
+ struct: StructValue,
52
+ value: TTypeScriptType,
53
+ array?: Uint8Array
54
+ ): VariableLengthBufferLikeStructFieldValue<this> {
55
+ return new VariableLengthBufferLikeStructFieldValue(
56
+ this,
57
+ options,
58
+ struct,
59
+ value,
60
+ array,
61
+ );
62
+ }
63
+ }
64
+
65
+ export class VariableLengthBufferLikeStructFieldValue<
66
+ TDefinition extends VariableLengthBufferLikeFieldDefinition = VariableLengthBufferLikeFieldDefinition,
67
+ > extends BufferLikeFieldValue<TDefinition> {
68
+ protected length: number | undefined;
69
+
70
+ protected lengthFieldValue: VariableLengthBufferLikeFieldLengthValue;
71
+
72
+ public constructor(
73
+ definition: TDefinition,
74
+ options: Readonly<StructOptions>,
75
+ struct: StructValue,
76
+ value: TDefinition['TValue'],
77
+ array?: Uint8Array,
78
+ ) {
79
+ super(definition, options, struct, value, array);
80
+
81
+ if (array) {
82
+ this.length = array.byteLength;
83
+ }
84
+
85
+ // Patch the associated length field.
86
+ const lengthField = this.definition.options.lengthField;
87
+
88
+ const originalValue = struct.get(lengthField);
89
+ this.lengthFieldValue = new VariableLengthBufferLikeFieldLengthValue(
90
+ originalValue,
91
+ this,
92
+ );
93
+ struct.set(lengthField, this.lengthFieldValue);
94
+ }
95
+
96
+ public override getSize() {
97
+ if (this.length === undefined) {
98
+ this.length = this.definition.type.getSize(this.value);
99
+ if (this.length === -1) {
100
+ this.array = this.definition.type.toBuffer(this.value);
101
+ this.length = this.array.byteLength;
102
+ }
103
+ }
104
+
105
+ return this.length;
106
+ }
107
+
108
+ public override set(value: unknown) {
109
+ super.set(value);
110
+ this.array = undefined;
111
+ this.length = undefined;
112
+ }
113
+ }
114
+
115
+ // Not using `VariableLengthBufferLikeStructFieldValue` directly makes writing tests much easier...
116
+ type VariableLengthBufferLikeFieldValueLike =
117
+ StructFieldValue<StructFieldDefinition<VariableLengthBufferLikeFieldOptions, any, any>>;
118
+
119
+ export class VariableLengthBufferLikeFieldLengthValue
120
+ extends StructFieldValue {
121
+ protected originalField: StructFieldValue;
122
+
123
+ protected bufferField: VariableLengthBufferLikeFieldValueLike;
124
+
125
+ public constructor(
126
+ originalField: StructFieldValue,
127
+ arrayBufferField: VariableLengthBufferLikeFieldValueLike,
128
+ ) {
129
+ super(originalField.definition, originalField.options, originalField.struct, 0);
130
+ this.originalField = originalField;
131
+ this.bufferField = arrayBufferField;
132
+ }
133
+
134
+ public override getSize() {
135
+ return this.originalField.getSize();
136
+ }
137
+
138
+ public override get() {
139
+ let value: string | number = this.bufferField.getSize();
140
+
141
+ const originalValue = this.originalField.get();
142
+ if (typeof originalValue === 'string') {
143
+ value = value.toString(this.bufferField.definition.options.lengthFieldRadix ?? 10);
144
+ }
145
+
146
+ return value;
147
+ }
148
+
149
+ public override set() {
150
+ // Ignore setting
151
+ // It will always be in sync with the buffer size
152
+ }
153
+
154
+ serialize(dataView: DataView, offset: number) {
155
+ this.originalField.set(this.get());
156
+ this.originalField.serialize(dataView, offset);
157
+ }
158
+ }
@@ -1,3 +1,3 @@
1
- export * from "./bigint.js";
2
- export * from "./buffer/index.js";
3
- export * from "./number.js";
1
+ export * from "./bigint.js";
2
+ export * from "./buffer/index.js";
3
+ export * from "./number.js";
@@ -1,115 +1,127 @@
1
- // cspell: ignore syncbird
2
-
3
- import { StructFieldDefinition, StructFieldValue, StructValue, type StructAsyncDeserializeStream, type StructDeserializeStream, type StructOptions } from '../basic/index.js';
4
- import { Syncbird } from "../syncbird.js";
5
- import type { ValueOrPromise } from "../utils.js";
6
-
7
- export type DataViewGetters =
8
- { [TKey in keyof DataView]: TKey extends `get${string}` ? TKey : never }[keyof DataView];
9
-
10
- export type DataViewSetters =
11
- { [TKey in keyof DataView]: TKey extends `set${string}` ? TKey : never }[keyof DataView];
12
-
13
- export class NumberFieldType {
14
- public readonly TTypeScriptType!: number;
15
-
16
- public readonly size: number;
17
-
18
- public readonly dataViewGetter: DataViewGetters;
19
-
20
- public readonly dataViewSetter: DataViewSetters;
21
-
22
- public constructor(
23
- size: number,
24
- dataViewGetter: DataViewGetters,
25
- dataViewSetter: DataViewSetters
26
- ) {
27
- this.size = size;
28
- this.dataViewGetter = dataViewGetter;
29
- this.dataViewSetter = dataViewSetter;
30
- }
31
-
32
- public static readonly Int8 = new NumberFieldType(1, 'getInt8', 'setInt8');
33
-
34
- public static readonly Uint8 = new NumberFieldType(1, 'getUint8', 'setUint8');
35
-
36
- public static readonly Int16 = new NumberFieldType(2, 'getInt16', 'setInt16');
37
-
38
- public static readonly Uint16 = new NumberFieldType(2, 'getUint16', 'setUint16');
39
-
40
- public static readonly Int32 = new NumberFieldType(4, 'getInt32', 'setInt32');
41
-
42
- public static readonly Uint32 = new NumberFieldType(4, 'getUint32', 'setUint32');
43
- }
44
-
45
- export class NumberFieldDefinition<
46
- TType extends NumberFieldType = NumberFieldType,
47
- TTypeScriptType = TType["TTypeScriptType"],
48
- > extends StructFieldDefinition<
49
- void,
50
- TTypeScriptType
51
- > {
52
- public readonly type: TType;
53
-
54
- public constructor(type: TType, _typescriptType?: TTypeScriptType) {
55
- super();
56
- this.type = type;
57
- }
58
-
59
- public getSize(): number {
60
- return this.type.size;
61
- }
62
-
63
- public create(
64
- options: Readonly<StructOptions>,
65
- struct: StructValue,
66
- value: TTypeScriptType,
67
- ): NumberFieldValue<this> {
68
- return new NumberFieldValue(this, options, struct, value);
69
- }
70
-
71
- public override deserialize(
72
- options: Readonly<StructOptions>,
73
- stream: StructDeserializeStream,
74
- struct: StructValue,
75
- ): NumberFieldValue<this>;
76
- public override deserialize(
77
- options: Readonly<StructOptions>,
78
- stream: StructAsyncDeserializeStream,
79
- struct: StructValue,
80
- ): Promise<NumberFieldValue<this>>;
81
- public override deserialize(
82
- options: Readonly<StructOptions>,
83
- stream: StructDeserializeStream | StructAsyncDeserializeStream,
84
- struct: StructValue,
85
- ): ValueOrPromise<NumberFieldValue<this>> {
86
- return Syncbird
87
- .try(() => {
88
- return stream.read(this.getSize());
89
- })
90
- .then(array => {
91
- const view = new DataView(array.buffer, array.byteOffset, array.byteLength);
92
- const value = view[this.type.dataViewGetter](
93
- 0,
94
- options.littleEndian
95
- );
96
- return this.create(options, struct, value as any);
97
- })
98
- .valueOrPromise();
99
- }
100
- }
101
-
102
- export class NumberFieldValue<
103
- TDefinition extends NumberFieldDefinition<NumberFieldType, any>,
104
- > extends StructFieldValue<TDefinition> {
105
- public serialize(dataView: DataView, offset: number): void {
106
- // `setBigInt64` requires a `bigint` while others require `number`
107
- // So `dataView[DataViewSetters]` requires `bigint & number`
108
- // and that is, `never`
109
- (dataView[this.definition.type.dataViewSetter] as any)(
110
- offset,
111
- this.value!,
112
- this.options.littleEndian
113
- );
114
- }
115
- }
1
+ import { StructFieldDefinition, StructFieldValue, StructValue, type StructAsyncDeserializeStream, type StructDeserializeStream, type StructOptions } from '../basic/index.js';
2
+ import { SyncPromise } from "../sync-promise.js";
3
+ import type { ValueOrPromise } from "../utils.js";
4
+
5
+ type NumberTypeDeserializer = (array: Uint8Array, littleEndian: boolean) => number;
6
+
7
+ const DESERIALIZERS: Record<number, NumberTypeDeserializer> = {
8
+ 1: (array, littleEndian) =>
9
+ array[0]!,
10
+ 2: (array, littleEndian) =>
11
+ ((array[1]! << 8) | array[0]!) * (littleEndian as any) |
12
+ ((array[0]! << 8) | array[1]!) * (!littleEndian as any),
13
+ 4: (array, littleEndian) =>
14
+ ((array[3]! << 24) | (array[2]! << 16) | (array[1]! << 8) | array[0]!) * (littleEndian as any) |
15
+ ((array[0]! << 24) | (array[1]! << 16) | (array[2]! << 8) | array[3]!) * (!littleEndian as any),
16
+ };
17
+
18
+ export type DataViewSetters =
19
+ { [TKey in keyof DataView]: TKey extends `set${string}` ? TKey : never }[keyof DataView];
20
+
21
+ export class NumberFieldType {
22
+ public readonly TTypeScriptType!: number;
23
+
24
+ public readonly signed: boolean;
25
+
26
+ public readonly size: number;
27
+
28
+ public readonly deserializer: NumberTypeDeserializer;
29
+ public readonly convertSign: (value: number) => number;
30
+
31
+ public readonly dataViewSetter: DataViewSetters;
32
+
33
+ public constructor(
34
+ size: number,
35
+ signed: boolean,
36
+ convertSign: (value: number) => number,
37
+ dataViewSetter: DataViewSetters
38
+ ) {
39
+ this.size = size;
40
+ this.signed = signed;
41
+ this.deserializer = DESERIALIZERS[size]!;
42
+ this.convertSign = convertSign;
43
+ this.dataViewSetter = dataViewSetter;
44
+ }
45
+
46
+ public static readonly Int8 = new NumberFieldType(1, true, value => value << 24 >> 24, 'setInt8');
47
+
48
+ public static readonly Uint8 = new NumberFieldType(1, false, value => value, 'setUint8');
49
+
50
+ public static readonly Int16 = new NumberFieldType(2, true, value => value << 16 >> 16, 'setInt16');
51
+
52
+ public static readonly Uint16 = new NumberFieldType(2, false, value => value, 'setUint16');
53
+
54
+ public static readonly Int32 = new NumberFieldType(4, true, value => value, 'setInt32');
55
+
56
+ public static readonly Uint32 = new NumberFieldType(4, false, value => value >>> 0, 'setUint32');
57
+ }
58
+
59
+ export class NumberFieldDefinition<
60
+ TType extends NumberFieldType = NumberFieldType,
61
+ TTypeScriptType = TType["TTypeScriptType"],
62
+ > extends StructFieldDefinition<
63
+ void,
64
+ TTypeScriptType
65
+ > {
66
+ public readonly type: TType;
67
+
68
+ public constructor(type: TType, _typescriptType?: TTypeScriptType) {
69
+ super();
70
+ this.type = type;
71
+ }
72
+
73
+ public getSize(): number {
74
+ return this.type.size;
75
+ }
76
+
77
+ public create(
78
+ options: Readonly<StructOptions>,
79
+ struct: StructValue,
80
+ value: TTypeScriptType,
81
+ ): NumberFieldValue<this> {
82
+ return new NumberFieldValue(this, options, struct, value);
83
+ }
84
+
85
+ public override deserialize(
86
+ options: Readonly<StructOptions>,
87
+ stream: StructDeserializeStream,
88
+ struct: StructValue,
89
+ ): NumberFieldValue<this>;
90
+ public override deserialize(
91
+ options: Readonly<StructOptions>,
92
+ stream: StructAsyncDeserializeStream,
93
+ struct: StructValue,
94
+ ): Promise<NumberFieldValue<this>>;
95
+ public override deserialize(
96
+ options: Readonly<StructOptions>,
97
+ stream: StructDeserializeStream | StructAsyncDeserializeStream,
98
+ struct: StructValue,
99
+ ): ValueOrPromise<NumberFieldValue<this>> {
100
+ return SyncPromise
101
+ .try(() => {
102
+ return stream.read(this.getSize());
103
+ })
104
+ .then(array => {
105
+ let value: number;
106
+ value = this.type.deserializer(array, options.littleEndian);
107
+ value = this.type.convertSign(value);
108
+ return this.create(options, struct, value as any);
109
+ })
110
+ .valueOrPromise();
111
+ }
112
+ }
113
+
114
+ export class NumberFieldValue<
115
+ TDefinition extends NumberFieldDefinition<NumberFieldType, any>,
116
+ > extends StructFieldValue<TDefinition> {
117
+ public serialize(dataView: DataView, offset: number): void {
118
+ // `setBigInt64` requires a `bigint` while others require `number`
119
+ // So `dataView[DataViewSetters]` requires `bigint & number`
120
+ // and that is, `never`
121
+ (dataView[this.definition.type.dataViewSetter] as any)(
122
+ offset,
123
+ this.value!,
124
+ this.options.littleEndian
125
+ );
126
+ }
127
+ }