rw-parser-ng 2.0.0 → 2.0.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,60 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ByteStream = void 0;
4
- var ByteStream = /** @class */ (function () {
5
- function ByteStream(stream) {
6
- this._cursor = 0;
7
- this._stream = stream;
8
- }
9
- ByteStream.prototype.readUint8 = function () {
10
- var uint8 = this._stream.readUInt8(this._cursor);
11
- this._cursor++;
12
- return uint8;
13
- };
14
- ByteStream.prototype.readUint16 = function () {
15
- var uint16 = this._stream.readUInt16LE(this._cursor);
16
- this._cursor += 2;
17
- return uint16;
18
- };
19
- ByteStream.prototype.readUint32 = function () {
20
- var uint32 = this._stream.readUInt32LE(this._cursor);
21
- this._cursor += 4;
22
- return uint32;
23
- };
24
- ByteStream.prototype.readInt32 = function () {
25
- var int32 = this._stream.readInt32LE(this._cursor);
26
- this._cursor += 4;
27
- return int32;
28
- };
29
- ByteStream.prototype.readFloat = function () {
30
- var float = this._stream.readFloatLE(this._cursor);
31
- this._cursor += 4;
32
- return float;
33
- };
34
- ByteStream.prototype.readString = function (size) {
35
- var string = this._stream.toString('ascii', this._cursor, this._cursor + size);
36
- this._cursor += size;
37
- return string.split(/\0/g).shift() || '';
38
- };
39
- ByteStream.prototype.read = function (size) {
40
- var data = new Uint8Array(size);
41
- for (var i = 0; i < size; i++) {
42
- data[i] = this.readUint8();
43
- }
44
- return data;
45
- };
46
- ByteStream.prototype.getSize = function () {
47
- return this._stream.byteLength;
48
- };
49
- ByteStream.prototype.getPosition = function () {
50
- return this._cursor;
51
- };
52
- ByteStream.prototype.setPosition = function (position) {
53
- this._cursor = position;
54
- };
55
- ByteStream.prototype.skip = function (size) {
56
- this._cursor += size;
57
- };
58
- return ByteStream;
59
- }());
60
- exports.ByteStream = ByteStream;