node-opcua-binary-stream 2.64.0 → 2.64.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.
@@ -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,15 +1,15 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
- };
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- __exportStar(require("./binaryStream"), exports);
14
- __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
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./binaryStream"), exports);
14
+ __exportStar(require("./binaryStreamSizeCalculator"), exports);
15
15
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,37 +1,37 @@
1
1
  {
2
- "name": "node-opcua-binary-stream",
3
- "version": "2.64.0",
4
- "description": "pure nodejs OPCUA SDK - module -binary-stream",
5
- "main": "./dist/index.js",
6
- "types": "./dist/index.d.ts",
7
- "dependencies": {
8
- "node-opcua-assert": "2.64.0",
9
- "node-opcua-buffer-utils": "2.64.0"
10
- },
11
- "devDependencies": {
12
- "node-opcua-benchmarker": "2.64.0",
13
- "should": "^13.2.3"
14
- },
15
- "author": "Etienne Rossignon",
16
- "license": "MIT",
17
- "repository": {
18
- "type": "git",
19
- "url": "git://github.com/node-opcua/node-opcua.git"
20
- },
21
- "keywords": [
22
- "OPCUA",
23
- "opcua",
24
- "m2m",
25
- "iot",
26
- "opc ua",
27
- "internet of things"
28
- ],
29
- "homepage": "http://node-opcua.github.io/",
30
- "gitHead": "e4d73afdfcccb3491423149d9b9785888f4ebb3c",
31
- "scripts": {
32
- "build": "tsc -b",
33
- "test": "mocha",
34
- "clean": "node -e \"require('rimraf').sync('dist');\"",
35
- "lint": "eslint source/**/*.ts"
36
- }
37
- }
2
+ "name": "node-opcua-binary-stream",
3
+ "version": "2.64.1",
4
+ "description": "pure nodejs OPCUA SDK - module -binary-stream",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
+ "scripts": {
8
+ "build": "tsc -b",
9
+ "test": "mocha",
10
+ "clean": "node -e \"require('rimraf').sync('dist');\"",
11
+ "lint": "eslint source/**/*.ts"
12
+ },
13
+ "dependencies": {
14
+ "node-opcua-assert": "2.64.1",
15
+ "node-opcua-buffer-utils": "2.64.1"
16
+ },
17
+ "devDependencies": {
18
+ "node-opcua-benchmarker": "2.64.1",
19
+ "should": "^13.2.3"
20
+ },
21
+ "author": "Etienne Rossignon",
22
+ "license": "MIT",
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "git://github.com/node-opcua/node-opcua.git"
26
+ },
27
+ "keywords": [
28
+ "OPCUA",
29
+ "opcua",
30
+ "m2m",
31
+ "iot",
32
+ "opc ua",
33
+ "internet of things"
34
+ ],
35
+ "homepage": "http://node-opcua.github.io/",
36
+ "gitHead": "b65b8738603cd475d7d99a2b20b0ae9d32b4110c"
37
+ }