node-opcua-binary-stream 2.90.1 → 2.98.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/binaryStream.d.ts +161 -161
- package/dist/binaryStream.js +436 -436
- package/dist/binaryStream.js.map +1 -1
- package/dist/binaryStreamSizeCalculator.d.ts +29 -29
- package/dist/binaryStreamSizeCalculator.js +76 -76
- package/dist/index.d.ts +8 -8
- package/dist/index.js +18 -18
- package/package.json +10 -6
package/dist/binaryStream.d.ts
CHANGED
|
@@ -1,161 +1,161 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/**
|
|
3
|
-
* @module node-opcua-binary-stream
|
|
4
|
-
*/
|
|
5
|
-
import "util";
|
|
6
|
-
/**
|
|
7
|
-
* a BinaryStream can be use to perform sequential read or write
|
|
8
|
-
* inside a buffer.
|
|
9
|
-
* The BinaryStream maintains a cursor up to date as the caller
|
|
10
|
-
* operates on the stream using the various read/write methods.
|
|
11
|
-
* It uses the [Little Endian](http://en.wikipedia.org/wiki/Little_endian#Little-endian)
|
|
12
|
-
* It uses the [Little Endian](http://en.wikipedia.org/wiki/Little_endian#Little-endian)
|
|
13
|
-
* convention.
|
|
14
|
-
*
|
|
15
|
-
* data can either be:
|
|
16
|
-
*
|
|
17
|
-
* * a Buffer , in this case the BinaryStream operates on this Buffer
|
|
18
|
-
* * null , in this case a BinaryStream with 1024 bytes is created
|
|
19
|
-
* * any data , in this case the object is converted into a binary buffer.
|
|
20
|
-
*
|
|
21
|
-
* example:
|
|
22
|
-
*
|
|
23
|
-
* ``` javascript
|
|
24
|
-
* var stream = new BinaryStream(32)
|
|
25
|
-
* ```
|
|
26
|
-
*
|
|
27
|
-
* @class BinaryStream
|
|
28
|
-
* @param {null|Buffer|Number} data
|
|
29
|
-
* @constructor
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*/
|
|
34
|
-
export declare class BinaryStream {
|
|
35
|
-
static maxByteStringLength: number;
|
|
36
|
-
static maxStringLength: number;
|
|
37
|
-
/**
|
|
38
|
-
* the current position inside the buffer
|
|
39
|
-
*/
|
|
40
|
-
length: number;
|
|
41
|
-
/**
|
|
42
|
-
* @internal
|
|
43
|
-
*/
|
|
44
|
-
buffer: Buffer;
|
|
45
|
-
constructor(data: undefined | Buffer | number);
|
|
46
|
-
/**
|
|
47
|
-
* set the cursor to the begining of the stream
|
|
48
|
-
* @method BinaryStream.rewind
|
|
49
|
-
*/
|
|
50
|
-
rewind(): void;
|
|
51
|
-
/**
|
|
52
|
-
* write a single signed byte (8 bits) to the stream.
|
|
53
|
-
* value must be in the range of [-127,128]
|
|
54
|
-
* @param value the value to write
|
|
55
|
-
*/
|
|
56
|
-
writeInt8(value: number): void;
|
|
57
|
-
/**
|
|
58
|
-
* write a single unsigned byte (8 bits) to the stream.
|
|
59
|
-
* @param value the value to write
|
|
60
|
-
*/
|
|
61
|
-
writeUInt8(value: number): void;
|
|
62
|
-
/**
|
|
63
|
-
* write a single 16 bit signed integer to the stream.
|
|
64
|
-
* @param value the value to write
|
|
65
|
-
*/
|
|
66
|
-
writeInt16(value: number): void;
|
|
67
|
-
/**
|
|
68
|
-
* write a single 16 bit unsigned integer to the stream.
|
|
69
|
-
* @param value the value to write
|
|
70
|
-
*/
|
|
71
|
-
writeUInt16(value: number): void;
|
|
72
|
-
/**
|
|
73
|
-
* write a single 32 bit signed integer to the stream.
|
|
74
|
-
* @param value the value to write
|
|
75
|
-
*/
|
|
76
|
-
writeInteger(value: number): void;
|
|
77
|
-
/**
|
|
78
|
-
* write a single 32 bit unsigned integer to the stream.
|
|
79
|
-
*
|
|
80
|
-
* @param value the value to write
|
|
81
|
-
*/
|
|
82
|
-
writeUInt32(value: number): void;
|
|
83
|
-
/**
|
|
84
|
-
* write a single 32 bit floating number to the stream.
|
|
85
|
-
* @param value the value to write
|
|
86
|
-
*/
|
|
87
|
-
writeFloat(value: number): void;
|
|
88
|
-
/**
|
|
89
|
-
* write a single 64 bit floating number to the stream.
|
|
90
|
-
* @param value the value to write
|
|
91
|
-
*/
|
|
92
|
-
writeDouble(value: number): void;
|
|
93
|
-
/**
|
|
94
|
-
* @param arrayBuf a buffer or byte array write
|
|
95
|
-
* @param offset the offset position (default =0)
|
|
96
|
-
* @param length the number of byte to write
|
|
97
|
-
*/
|
|
98
|
-
writeArrayBuffer(arrayBuf: ArrayBuffer, offset?: number, length?: number): void;
|
|
99
|
-
/**
|
|
100
|
-
* read a single signed byte (8 bits) from the stream.
|
|
101
|
-
* @return the value read
|
|
102
|
-
*/
|
|
103
|
-
readByte(): number;
|
|
104
|
-
readInt8(): number;
|
|
105
|
-
/**
|
|
106
|
-
* read a single unsigned byte (8 bits) from the stream.
|
|
107
|
-
*/
|
|
108
|
-
readUInt8(): number;
|
|
109
|
-
/**
|
|
110
|
-
* read a single signed 16-bit integer from the stream.
|
|
111
|
-
*/
|
|
112
|
-
readInt16(): number;
|
|
113
|
-
/**
|
|
114
|
-
* read a single unsigned 16-bit integer from the stream.
|
|
115
|
-
*/
|
|
116
|
-
readUInt16(): number;
|
|
117
|
-
/**
|
|
118
|
-
* read a single signed 32-bit integer from the stream.
|
|
119
|
-
*/
|
|
120
|
-
readInteger(): number;
|
|
121
|
-
/**
|
|
122
|
-
* read a single unsigned 32-bit integer from the stream.
|
|
123
|
-
*/
|
|
124
|
-
readUInt32(): number;
|
|
125
|
-
/**
|
|
126
|
-
* read a single 32-bit floating point number from the stream.
|
|
127
|
-
*/
|
|
128
|
-
readFloat(): number;
|
|
129
|
-
/**
|
|
130
|
-
* read a single 64-bit floating point number from the stream.
|
|
131
|
-
*/
|
|
132
|
-
readDouble(): number;
|
|
133
|
-
/**
|
|
134
|
-
* write a byte stream to the stream.
|
|
135
|
-
* The method writes the length of the byte array into the stream as a 32 bits integer before the byte stream.
|
|
136
|
-
*
|
|
137
|
-
* @param buf the buffer to write.
|
|
138
|
-
*/
|
|
139
|
-
writeByteStream(buf: Buffer): void;
|
|
140
|
-
writeString(value: null | string): void;
|
|
141
|
-
/**
|
|
142
|
-
* @method readArrayBuffer
|
|
143
|
-
* @param length
|
|
144
|
-
*/
|
|
145
|
-
readArrayBuffer(length: number): Uint8Array;
|
|
146
|
-
/**
|
|
147
|
-
* read a byte stream to the stream.
|
|
148
|
-
* The method reads the length of the byte array from the stream as a 32 bits integer
|
|
149
|
-
* before reading the byte stream.
|
|
150
|
-
*
|
|
151
|
-
*/
|
|
152
|
-
readByteStream(): Buffer | null;
|
|
153
|
-
readString(): string | null;
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
* @function calculateByteLength
|
|
157
|
-
* calculate the size in bytes of a utf8 string
|
|
158
|
-
* @param str {String}
|
|
159
|
-
* @internal
|
|
160
|
-
*/
|
|
161
|
-
export declare function calculateByteLength(str: string): number;
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/**
|
|
3
|
+
* @module node-opcua-binary-stream
|
|
4
|
+
*/
|
|
5
|
+
import "util";
|
|
6
|
+
/**
|
|
7
|
+
* a BinaryStream can be use to perform sequential read or write
|
|
8
|
+
* inside a buffer.
|
|
9
|
+
* The BinaryStream maintains a cursor up to date as the caller
|
|
10
|
+
* operates on the stream using the various read/write methods.
|
|
11
|
+
* It uses the [Little Endian](http://en.wikipedia.org/wiki/Little_endian#Little-endian)
|
|
12
|
+
* It uses the [Little Endian](http://en.wikipedia.org/wiki/Little_endian#Little-endian)
|
|
13
|
+
* convention.
|
|
14
|
+
*
|
|
15
|
+
* data can either be:
|
|
16
|
+
*
|
|
17
|
+
* * a Buffer , in this case the BinaryStream operates on this Buffer
|
|
18
|
+
* * null , in this case a BinaryStream with 1024 bytes is created
|
|
19
|
+
* * any data , in this case the object is converted into a binary buffer.
|
|
20
|
+
*
|
|
21
|
+
* example:
|
|
22
|
+
*
|
|
23
|
+
* ``` javascript
|
|
24
|
+
* var stream = new BinaryStream(32)
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @class BinaryStream
|
|
28
|
+
* @param {null|Buffer|Number} data
|
|
29
|
+
* @constructor
|
|
30
|
+
*
|
|
31
|
+
*
|
|
32
|
+
*
|
|
33
|
+
*/
|
|
34
|
+
export declare class BinaryStream {
|
|
35
|
+
static maxByteStringLength: number;
|
|
36
|
+
static maxStringLength: number;
|
|
37
|
+
/**
|
|
38
|
+
* the current position inside the buffer
|
|
39
|
+
*/
|
|
40
|
+
length: number;
|
|
41
|
+
/**
|
|
42
|
+
* @internal
|
|
43
|
+
*/
|
|
44
|
+
buffer: Buffer;
|
|
45
|
+
constructor(data: undefined | Buffer | number);
|
|
46
|
+
/**
|
|
47
|
+
* set the cursor to the begining of the stream
|
|
48
|
+
* @method BinaryStream.rewind
|
|
49
|
+
*/
|
|
50
|
+
rewind(): void;
|
|
51
|
+
/**
|
|
52
|
+
* write a single signed byte (8 bits) to the stream.
|
|
53
|
+
* value must be in the range of [-127,128]
|
|
54
|
+
* @param value the value to write
|
|
55
|
+
*/
|
|
56
|
+
writeInt8(value: number): void;
|
|
57
|
+
/**
|
|
58
|
+
* write a single unsigned byte (8 bits) to the stream.
|
|
59
|
+
* @param value the value to write
|
|
60
|
+
*/
|
|
61
|
+
writeUInt8(value: number): void;
|
|
62
|
+
/**
|
|
63
|
+
* write a single 16 bit signed integer to the stream.
|
|
64
|
+
* @param value the value to write
|
|
65
|
+
*/
|
|
66
|
+
writeInt16(value: number): void;
|
|
67
|
+
/**
|
|
68
|
+
* write a single 16 bit unsigned integer to the stream.
|
|
69
|
+
* @param value the value to write
|
|
70
|
+
*/
|
|
71
|
+
writeUInt16(value: number): void;
|
|
72
|
+
/**
|
|
73
|
+
* write a single 32 bit signed integer to the stream.
|
|
74
|
+
* @param value the value to write
|
|
75
|
+
*/
|
|
76
|
+
writeInteger(value: number): void;
|
|
77
|
+
/**
|
|
78
|
+
* write a single 32 bit unsigned integer to the stream.
|
|
79
|
+
*
|
|
80
|
+
* @param value the value to write
|
|
81
|
+
*/
|
|
82
|
+
writeUInt32(value: number): void;
|
|
83
|
+
/**
|
|
84
|
+
* write a single 32 bit floating number to the stream.
|
|
85
|
+
* @param value the value to write
|
|
86
|
+
*/
|
|
87
|
+
writeFloat(value: number): void;
|
|
88
|
+
/**
|
|
89
|
+
* write a single 64 bit floating number to the stream.
|
|
90
|
+
* @param value the value to write
|
|
91
|
+
*/
|
|
92
|
+
writeDouble(value: number): void;
|
|
93
|
+
/**
|
|
94
|
+
* @param arrayBuf a buffer or byte array write
|
|
95
|
+
* @param offset the offset position (default =0)
|
|
96
|
+
* @param length the number of byte to write
|
|
97
|
+
*/
|
|
98
|
+
writeArrayBuffer(arrayBuf: ArrayBuffer, offset?: number, length?: number): void;
|
|
99
|
+
/**
|
|
100
|
+
* read a single signed byte (8 bits) from the stream.
|
|
101
|
+
* @return the value read
|
|
102
|
+
*/
|
|
103
|
+
readByte(): number;
|
|
104
|
+
readInt8(): number;
|
|
105
|
+
/**
|
|
106
|
+
* read a single unsigned byte (8 bits) from the stream.
|
|
107
|
+
*/
|
|
108
|
+
readUInt8(): number;
|
|
109
|
+
/**
|
|
110
|
+
* read a single signed 16-bit integer from the stream.
|
|
111
|
+
*/
|
|
112
|
+
readInt16(): number;
|
|
113
|
+
/**
|
|
114
|
+
* read a single unsigned 16-bit integer from the stream.
|
|
115
|
+
*/
|
|
116
|
+
readUInt16(): number;
|
|
117
|
+
/**
|
|
118
|
+
* read a single signed 32-bit integer from the stream.
|
|
119
|
+
*/
|
|
120
|
+
readInteger(): number;
|
|
121
|
+
/**
|
|
122
|
+
* read a single unsigned 32-bit integer from the stream.
|
|
123
|
+
*/
|
|
124
|
+
readUInt32(): number;
|
|
125
|
+
/**
|
|
126
|
+
* read a single 32-bit floating point number from the stream.
|
|
127
|
+
*/
|
|
128
|
+
readFloat(): number;
|
|
129
|
+
/**
|
|
130
|
+
* read a single 64-bit floating point number from the stream.
|
|
131
|
+
*/
|
|
132
|
+
readDouble(): number;
|
|
133
|
+
/**
|
|
134
|
+
* write a byte stream to the stream.
|
|
135
|
+
* The method writes the length of the byte array into the stream as a 32 bits integer before the byte stream.
|
|
136
|
+
*
|
|
137
|
+
* @param buf the buffer to write.
|
|
138
|
+
*/
|
|
139
|
+
writeByteStream(buf: Buffer): void;
|
|
140
|
+
writeString(value: null | string): void;
|
|
141
|
+
/**
|
|
142
|
+
* @method readArrayBuffer
|
|
143
|
+
* @param length
|
|
144
|
+
*/
|
|
145
|
+
readArrayBuffer(length: number): Uint8Array;
|
|
146
|
+
/**
|
|
147
|
+
* read a byte stream to the stream.
|
|
148
|
+
* The method reads the length of the byte array from the stream as a 32 bits integer
|
|
149
|
+
* before reading the byte stream.
|
|
150
|
+
*
|
|
151
|
+
*/
|
|
152
|
+
readByteStream(): Buffer | null;
|
|
153
|
+
readString(): string | null;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* @function calculateByteLength
|
|
157
|
+
* calculate the size in bytes of a utf8 string
|
|
158
|
+
* @param str {String}
|
|
159
|
+
* @internal
|
|
160
|
+
*/
|
|
161
|
+
export declare function calculateByteLength(str: string): number;
|