node-opcua-binary-stream 2.74.0 → 2.76.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.
- package/dist/binaryStream.d.ts +161 -161
- package/dist/binaryStream.js +436 -436
- 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 +5 -5
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/**
|
|
3
|
-
* a BinaryStreamSizeCalculator can be used to quickly evaluate the required size
|
|
4
|
-
* of a buffer by performing the same sequence of write operation.
|
|
5
|
-
*
|
|
6
|
-
* a BinaryStreamSizeCalculator has the same writeXXX methods as the BinaryStream stream
|
|
7
|
-
* object.
|
|
8
|
-
*
|
|
9
|
-
* @class BinaryStreamSizeCalculator
|
|
10
|
-
* @extends BinaryStream
|
|
11
|
-
* @constructor
|
|
12
|
-
*
|
|
13
|
-
*/
|
|
14
|
-
export declare class BinaryStreamSizeCalculator {
|
|
15
|
-
length: number;
|
|
16
|
-
constructor();
|
|
17
|
-
rewind(): void;
|
|
18
|
-
writeInt8(value: number): void;
|
|
19
|
-
writeUInt8(value: number): void;
|
|
20
|
-
writeInt16(value: number): void;
|
|
21
|
-
writeInteger(value: number): void;
|
|
22
|
-
writeUInt32(value: number): void;
|
|
23
|
-
writeUInt16(value: number): void;
|
|
24
|
-
writeFloat(value: number): void;
|
|
25
|
-
writeDouble(value: number): void;
|
|
26
|
-
writeArrayBuffer(arrayBuf: ArrayBuffer, offset: number, byteLength: number): void;
|
|
27
|
-
writeByteStream(buf: Buffer): void;
|
|
28
|
-
writeString(str: null | string): void;
|
|
29
|
-
}
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/**
|
|
3
|
+
* a BinaryStreamSizeCalculator can be used to quickly evaluate the required size
|
|
4
|
+
* of a buffer by performing the same sequence of write operation.
|
|
5
|
+
*
|
|
6
|
+
* a BinaryStreamSizeCalculator has the same writeXXX methods as the BinaryStream stream
|
|
7
|
+
* object.
|
|
8
|
+
*
|
|
9
|
+
* @class BinaryStreamSizeCalculator
|
|
10
|
+
* @extends BinaryStream
|
|
11
|
+
* @constructor
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
14
|
+
export declare class BinaryStreamSizeCalculator {
|
|
15
|
+
length: number;
|
|
16
|
+
constructor();
|
|
17
|
+
rewind(): void;
|
|
18
|
+
writeInt8(value: number): void;
|
|
19
|
+
writeUInt8(value: number): void;
|
|
20
|
+
writeInt16(value: number): void;
|
|
21
|
+
writeInteger(value: number): void;
|
|
22
|
+
writeUInt32(value: number): void;
|
|
23
|
+
writeUInt16(value: number): void;
|
|
24
|
+
writeFloat(value: number): void;
|
|
25
|
+
writeDouble(value: number): void;
|
|
26
|
+
writeArrayBuffer(arrayBuf: ArrayBuffer, offset: number, byteLength: number): void;
|
|
27
|
+
writeByteStream(buf: Buffer): void;
|
|
28
|
+
writeString(str: null | string): void;
|
|
29
|
+
}
|
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BinaryStreamSizeCalculator = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* @module node-opcua-binary-stream
|
|
6
|
-
*/
|
|
7
|
-
const node_opcua_assert_1 = require("node-opcua-assert");
|
|
8
|
-
const binaryStream_1 = require("./binaryStream");
|
|
9
|
-
/**
|
|
10
|
-
* a BinaryStreamSizeCalculator can be used to quickly evaluate the required size
|
|
11
|
-
* of a buffer by performing the same sequence of write operation.
|
|
12
|
-
*
|
|
13
|
-
* a BinaryStreamSizeCalculator has the same writeXXX methods as the BinaryStream stream
|
|
14
|
-
* object.
|
|
15
|
-
*
|
|
16
|
-
* @class BinaryStreamSizeCalculator
|
|
17
|
-
* @extends BinaryStream
|
|
18
|
-
* @constructor
|
|
19
|
-
*
|
|
20
|
-
*/
|
|
21
|
-
class BinaryStreamSizeCalculator {
|
|
22
|
-
constructor() {
|
|
23
|
-
this.length = 0;
|
|
24
|
-
}
|
|
25
|
-
rewind() {
|
|
26
|
-
this.length = 0;
|
|
27
|
-
}
|
|
28
|
-
writeInt8(value) {
|
|
29
|
-
this.length += 1;
|
|
30
|
-
}
|
|
31
|
-
writeUInt8(value) {
|
|
32
|
-
this.length += 1;
|
|
33
|
-
}
|
|
34
|
-
writeInt16(value) {
|
|
35
|
-
this.length += 2;
|
|
36
|
-
}
|
|
37
|
-
writeInteger(value) {
|
|
38
|
-
this.length += 4;
|
|
39
|
-
}
|
|
40
|
-
writeUInt32(value) {
|
|
41
|
-
this.length += 4;
|
|
42
|
-
}
|
|
43
|
-
writeUInt16(value) {
|
|
44
|
-
this.length += 2;
|
|
45
|
-
}
|
|
46
|
-
writeFloat(value) {
|
|
47
|
-
this.length += 4;
|
|
48
|
-
}
|
|
49
|
-
writeDouble(value) {
|
|
50
|
-
this.length += 8;
|
|
51
|
-
}
|
|
52
|
-
writeArrayBuffer(arrayBuf, offset, byteLength) {
|
|
53
|
-
offset = offset || 0;
|
|
54
|
-
(0, node_opcua_assert_1.assert)(arrayBuf instanceof ArrayBuffer);
|
|
55
|
-
this.length += byteLength || arrayBuf.byteLength;
|
|
56
|
-
}
|
|
57
|
-
writeByteStream(buf) {
|
|
58
|
-
if (!buf) {
|
|
59
|
-
this.writeUInt32(0);
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
this.writeUInt32(buf.length);
|
|
63
|
-
this.length += buf.length;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
writeString(str) {
|
|
67
|
-
if (str === undefined || str === null) {
|
|
68
|
-
this.writeUInt32(-1);
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
const bufLength = (0, binaryStream_1.calculateByteLength)(str);
|
|
72
|
-
this.writeUInt32(bufLength);
|
|
73
|
-
this.length += bufLength;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
exports.BinaryStreamSizeCalculator = BinaryStreamSizeCalculator;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BinaryStreamSizeCalculator = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* @module node-opcua-binary-stream
|
|
6
|
+
*/
|
|
7
|
+
const node_opcua_assert_1 = require("node-opcua-assert");
|
|
8
|
+
const binaryStream_1 = require("./binaryStream");
|
|
9
|
+
/**
|
|
10
|
+
* a BinaryStreamSizeCalculator can be used to quickly evaluate the required size
|
|
11
|
+
* of a buffer by performing the same sequence of write operation.
|
|
12
|
+
*
|
|
13
|
+
* a BinaryStreamSizeCalculator has the same writeXXX methods as the BinaryStream stream
|
|
14
|
+
* object.
|
|
15
|
+
*
|
|
16
|
+
* @class BinaryStreamSizeCalculator
|
|
17
|
+
* @extends BinaryStream
|
|
18
|
+
* @constructor
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
class BinaryStreamSizeCalculator {
|
|
22
|
+
constructor() {
|
|
23
|
+
this.length = 0;
|
|
24
|
+
}
|
|
25
|
+
rewind() {
|
|
26
|
+
this.length = 0;
|
|
27
|
+
}
|
|
28
|
+
writeInt8(value) {
|
|
29
|
+
this.length += 1;
|
|
30
|
+
}
|
|
31
|
+
writeUInt8(value) {
|
|
32
|
+
this.length += 1;
|
|
33
|
+
}
|
|
34
|
+
writeInt16(value) {
|
|
35
|
+
this.length += 2;
|
|
36
|
+
}
|
|
37
|
+
writeInteger(value) {
|
|
38
|
+
this.length += 4;
|
|
39
|
+
}
|
|
40
|
+
writeUInt32(value) {
|
|
41
|
+
this.length += 4;
|
|
42
|
+
}
|
|
43
|
+
writeUInt16(value) {
|
|
44
|
+
this.length += 2;
|
|
45
|
+
}
|
|
46
|
+
writeFloat(value) {
|
|
47
|
+
this.length += 4;
|
|
48
|
+
}
|
|
49
|
+
writeDouble(value) {
|
|
50
|
+
this.length += 8;
|
|
51
|
+
}
|
|
52
|
+
writeArrayBuffer(arrayBuf, offset, byteLength) {
|
|
53
|
+
offset = offset || 0;
|
|
54
|
+
(0, node_opcua_assert_1.assert)(arrayBuf instanceof ArrayBuffer);
|
|
55
|
+
this.length += byteLength || arrayBuf.byteLength;
|
|
56
|
+
}
|
|
57
|
+
writeByteStream(buf) {
|
|
58
|
+
if (!buf) {
|
|
59
|
+
this.writeUInt32(0);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
this.writeUInt32(buf.length);
|
|
63
|
+
this.length += buf.length;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
writeString(str) {
|
|
67
|
+
if (str === undefined || str === null) {
|
|
68
|
+
this.writeUInt32(-1);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
const bufLength = (0, binaryStream_1.calculateByteLength)(str);
|
|
72
|
+
this.writeUInt32(bufLength);
|
|
73
|
+
this.length += bufLength;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
exports.BinaryStreamSizeCalculator = BinaryStreamSizeCalculator;
|
|
77
77
|
//# sourceMappingURL=binaryStreamSizeCalculator.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module node-opcua-binary-stream
|
|
3
|
-
*/
|
|
4
|
-
import { BinaryStream } from "./binaryStream";
|
|
5
|
-
import { BinaryStreamSizeCalculator } from "./binaryStreamSizeCalculator";
|
|
6
|
-
export declare type OutputBinaryStream = BinaryStream | BinaryStreamSizeCalculator;
|
|
7
|
-
export * from "./binaryStream";
|
|
8
|
-
export * from "./binaryStreamSizeCalculator";
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opcua-binary-stream
|
|
3
|
+
*/
|
|
4
|
+
import { BinaryStream } from "./binaryStream";
|
|
5
|
+
import { BinaryStreamSizeCalculator } from "./binaryStreamSizeCalculator";
|
|
6
|
+
export declare type OutputBinaryStream = BinaryStream | BinaryStreamSizeCalculator;
|
|
7
|
+
export * from "./binaryStream";
|
|
8
|
+
export * from "./binaryStreamSizeCalculator";
|
package/dist/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./binaryStream"), exports);
|
|
18
|
-
__exportStar(require("./binaryStreamSizeCalculator"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./binaryStream"), exports);
|
|
18
|
+
__exportStar(require("./binaryStreamSizeCalculator"), exports);
|
|
19
19
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-opcua-binary-stream",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.76.0",
|
|
4
4
|
"description": "pure nodejs OPCUA SDK - module -binary-stream",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
"lint": "eslint source/**/*.ts"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"node-opcua-assert": "2.
|
|
15
|
-
"node-opcua-buffer-utils": "2.
|
|
14
|
+
"node-opcua-assert": "2.76.0",
|
|
15
|
+
"node-opcua-buffer-utils": "2.76.0"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"node-opcua-benchmarker": "2.
|
|
18
|
+
"node-opcua-benchmarker": "2.76.0",
|
|
19
19
|
"should": "^13.2.3"
|
|
20
20
|
},
|
|
21
21
|
"author": "Etienne Rossignon",
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"internet of things"
|
|
34
34
|
],
|
|
35
35
|
"homepage": "http://node-opcua.github.io/",
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "75d9b8cf894c8fbadf77d2c4a48a730d055465e7"
|
|
37
37
|
}
|