@doordeck/doordeck-headless-sdk 0.149.0 → 0.150.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/kotlin/Kermit-kermit-core.js +65 -65
- package/kotlin/Kermit-kermit.js +9 -9
- package/kotlin/KotlinMultiplatformLibsodium-multiplatform-crypto-libsodium-bindings.js +59 -59
- package/kotlin/MultiplatformSettings-multiplatform-settings.js +25 -25
- package/kotlin/doordeck-sdk.d.ts +1 -1
- package/kotlin/doordeck-sdk.js +13852 -15044
- package/kotlin/kotlin-kotlin-stdlib.js +4884 -4836
- package/kotlin/kotlinx-atomicfu.js +92 -88
- package/kotlin/kotlinx-coroutines-core.js +2871 -2878
- package/kotlin/kotlinx-io-kotlinx-io-bytestring.js +71 -71
- package/kotlin/kotlinx-io-kotlinx-io-core.js +697 -676
- package/kotlin/kotlinx-serialization-kotlinx-serialization-core.js +2632 -2628
- package/kotlin/kotlinx-serialization-kotlinx-serialization-json.js +1841 -1829
- package/kotlin/ktor-ktor-client-auth.js +493 -512
- package/kotlin/ktor-ktor-client-content-negotiation.js +300 -308
- package/kotlin/ktor-ktor-client-core.js +3260 -3343
- package/kotlin/ktor-ktor-client-logging.js +1267 -1301
- package/kotlin/ktor-ktor-events.js +18 -18
- package/kotlin/ktor-ktor-http-cio.js +724 -719
- package/kotlin/ktor-ktor-http.js +1171 -1166
- package/kotlin/ktor-ktor-io.js +1413 -1440
- package/kotlin/ktor-ktor-serialization-kotlinx-json.js +9 -9
- package/kotlin/ktor-ktor-serialization-kotlinx.js +295 -311
- package/kotlin/ktor-ktor-serialization.js +128 -136
- package/kotlin/ktor-ktor-utils.js +1128 -1129
- package/kotlin/ktor-ktor-websockets.js +68 -68
- package/package.json +3 -2
|
@@ -2,40 +2,46 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
//region block: imports
|
|
4
4
|
var imul = Math.imul;
|
|
5
|
-
var IndexOutOfBoundsException_init_$Create$ = kotlin_kotlin.$_$.
|
|
6
|
-
var Long = kotlin_kotlin.$_$.
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
var
|
|
19
|
-
var
|
|
5
|
+
var IndexOutOfBoundsException_init_$Create$ = kotlin_kotlin.$_$.u1;
|
|
6
|
+
var Long = kotlin_kotlin.$_$.tf;
|
|
7
|
+
var compare = kotlin_kotlin.$_$.p9;
|
|
8
|
+
var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.n1;
|
|
9
|
+
var subtract = kotlin_kotlin.$_$.da;
|
|
10
|
+
var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.f2;
|
|
11
|
+
var charArrayOf = kotlin_kotlin.$_$.ka;
|
|
12
|
+
var protoOf = kotlin_kotlin.$_$.zb;
|
|
13
|
+
var equalsLong = kotlin_kotlin.$_$.u9;
|
|
14
|
+
var toString = kotlin_kotlin.$_$.cc;
|
|
15
|
+
var Unit_instance = kotlin_kotlin.$_$.z4;
|
|
16
|
+
var toShort = kotlin_kotlin.$_$.bc;
|
|
17
|
+
var add = kotlin_kotlin.$_$.m9;
|
|
18
|
+
var ensureNotNull = kotlin_kotlin.$_$.qg;
|
|
19
|
+
var fromInt = kotlin_kotlin.$_$.v9;
|
|
20
|
+
var convertToInt = kotlin_kotlin.$_$.r9;
|
|
21
|
+
var StringBuilder_init_$Create$ = kotlin_kotlin.$_$.c1;
|
|
22
|
+
var initMetadataForClass = kotlin_kotlin.$_$.za;
|
|
23
|
+
var VOID = kotlin_kotlin.$_$.b;
|
|
24
|
+
var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.r1;
|
|
20
25
|
var UnsafeByteStringOperations_instance = kotlin_org_jetbrains_kotlinx_kotlinx_io_bytestring.$_$.b;
|
|
21
|
-
var AutoCloseable = kotlin_kotlin.$_$.
|
|
22
|
-
var objectCreate = kotlin_kotlin.$_$.
|
|
23
|
-
var initMetadataForCompanion = kotlin_kotlin.$_$.
|
|
24
|
-
var arrayCopy = kotlin_kotlin.$_$.
|
|
25
|
-
var toByte = kotlin_kotlin.$_$.
|
|
26
|
-
var IllegalArgumentException_init_$Create$_0 = kotlin_kotlin.$_$.
|
|
27
|
-
var initMetadataForObject = kotlin_kotlin.$_$.
|
|
28
|
-
var initMetadataForInterface = kotlin_kotlin.$_$.
|
|
29
|
-
var
|
|
30
|
-
var
|
|
31
|
-
var
|
|
32
|
-
var
|
|
33
|
-
var
|
|
34
|
-
var
|
|
35
|
-
var
|
|
36
|
-
var
|
|
37
|
-
var Exception_init_$Init$
|
|
38
|
-
var
|
|
26
|
+
var AutoCloseable = kotlin_kotlin.$_$.hf;
|
|
27
|
+
var objectCreate = kotlin_kotlin.$_$.yb;
|
|
28
|
+
var initMetadataForCompanion = kotlin_kotlin.$_$.ab;
|
|
29
|
+
var arrayCopy = kotlin_kotlin.$_$.r5;
|
|
30
|
+
var toByte = kotlin_kotlin.$_$.ac;
|
|
31
|
+
var IllegalArgumentException_init_$Create$_0 = kotlin_kotlin.$_$.l1;
|
|
32
|
+
var initMetadataForObject = kotlin_kotlin.$_$.fb;
|
|
33
|
+
var initMetadataForInterface = kotlin_kotlin.$_$.db;
|
|
34
|
+
var multiply = kotlin_kotlin.$_$.y9;
|
|
35
|
+
var charCodeAt = kotlin_kotlin.$_$.ma;
|
|
36
|
+
var Char__toInt_impl_vasixd = kotlin_kotlin.$_$.l2;
|
|
37
|
+
var charArray = kotlin_kotlin.$_$.la;
|
|
38
|
+
var numberToChar = kotlin_kotlin.$_$.xb;
|
|
39
|
+
var concatToString = kotlin_kotlin.$_$.ad;
|
|
40
|
+
var Exception_init_$Init$ = kotlin_kotlin.$_$.g1;
|
|
41
|
+
var captureStack = kotlin_kotlin.$_$.ja;
|
|
42
|
+
var Exception_init_$Init$_0 = kotlin_kotlin.$_$.h1;
|
|
43
|
+
var Exception_init_$Init$_1 = kotlin_kotlin.$_$.j1;
|
|
44
|
+
var Exception = kotlin_kotlin.$_$.qf;
|
|
39
45
|
//endregion
|
|
40
46
|
//region block: pre-declaration
|
|
41
47
|
initMetadataForInterface(Source, 'Source', VOID, VOID, [AutoCloseable]);
|
|
@@ -44,10 +50,10 @@
|
|
|
44
50
|
endIndex = endIndex === VOID ? source.length : endIndex;
|
|
45
51
|
var tmp;
|
|
46
52
|
if ($super === VOID) {
|
|
47
|
-
this.
|
|
53
|
+
this.uq(source, startIndex, endIndex);
|
|
48
54
|
tmp = Unit_instance;
|
|
49
55
|
} else {
|
|
50
|
-
tmp = $super.
|
|
56
|
+
tmp = $super.uq.call(this, source, startIndex, endIndex);
|
|
51
57
|
}
|
|
52
58
|
return tmp;
|
|
53
59
|
}
|
|
@@ -74,16 +80,16 @@
|
|
|
74
80
|
var HEX_DIGIT_CHARS;
|
|
75
81
|
function checkBounds(size, startIndex, endIndex) {
|
|
76
82
|
_init_properties__Util_kt__g8tcl9();
|
|
77
|
-
if (startIndex
|
|
83
|
+
if (compare(startIndex, new Long(0, 0)) < 0 || compare(endIndex, size) > 0) {
|
|
78
84
|
throw IndexOutOfBoundsException_init_$Create$('startIndex (' + startIndex.toString() + ') and endIndex (' + endIndex.toString() + ') are not within the range [0..size(' + size.toString() + '))');
|
|
79
85
|
}
|
|
80
|
-
if (startIndex
|
|
86
|
+
if (compare(startIndex, endIndex) > 0) {
|
|
81
87
|
throw IllegalArgumentException_init_$Create$('startIndex (' + startIndex.toString() + ') > endIndex (' + endIndex.toString() + ')');
|
|
82
88
|
}
|
|
83
89
|
}
|
|
84
90
|
function checkOffsetAndCount(size, offset, byteCount) {
|
|
85
91
|
_init_properties__Util_kt__g8tcl9();
|
|
86
|
-
if (offset
|
|
92
|
+
if (compare(offset, new Long(0, 0)) < 0 || compare(offset, size) > 0 || compare(subtract(size, offset), byteCount) < 0 || compare(byteCount, new Long(0, 0)) < 0) {
|
|
87
93
|
throw IllegalArgumentException_init_$Create$('offset (' + offset.toString() + ') and byteCount (' + byteCount.toString() + ') are not within the range [0..size(' + size.toString() + '))');
|
|
88
94
|
}
|
|
89
95
|
}
|
|
@@ -96,42 +102,42 @@
|
|
|
96
102
|
}
|
|
97
103
|
}
|
|
98
104
|
function throwEof($this, byteCount) {
|
|
99
|
-
throw EOFException_init_$Create$_0("Buffer doesn't contain required number of bytes (size: " + $this.
|
|
105
|
+
throw EOFException_init_$Create$_0("Buffer doesn't contain required number of bytes (size: " + $this.u().toString() + ', required: ' + byteCount.toString() + ')');
|
|
100
106
|
}
|
|
101
107
|
function Buffer() {
|
|
102
|
-
this.
|
|
103
|
-
this.
|
|
104
|
-
this.
|
|
108
|
+
this.hp_1 = null;
|
|
109
|
+
this.ip_1 = null;
|
|
110
|
+
this.jp_1 = new Long(0, 0);
|
|
105
111
|
}
|
|
106
|
-
protoOf(Buffer).
|
|
107
|
-
return this.
|
|
112
|
+
protoOf(Buffer).u = function () {
|
|
113
|
+
return this.jp_1;
|
|
108
114
|
};
|
|
109
|
-
protoOf(Buffer).
|
|
115
|
+
protoOf(Buffer).kp = function () {
|
|
110
116
|
return this;
|
|
111
117
|
};
|
|
112
|
-
protoOf(Buffer).
|
|
113
|
-
return this.
|
|
118
|
+
protoOf(Buffer).lp = function () {
|
|
119
|
+
return equalsLong(this.u(), new Long(0, 0));
|
|
114
120
|
};
|
|
115
|
-
protoOf(Buffer).
|
|
121
|
+
protoOf(Buffer).mp = function (byteCount) {
|
|
116
122
|
// Inline function 'kotlin.require' call
|
|
117
|
-
if (!(byteCount
|
|
123
|
+
if (!(compare(byteCount, new Long(0, 0)) >= 0)) {
|
|
118
124
|
var message = 'byteCount: ' + byteCount.toString();
|
|
119
125
|
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
120
126
|
}
|
|
121
|
-
if (this.
|
|
122
|
-
throw EOFException_init_$Create$_0("Buffer doesn't contain required number of bytes (size: " + this.
|
|
127
|
+
if (compare(this.u(), byteCount) < 0) {
|
|
128
|
+
throw EOFException_init_$Create$_0("Buffer doesn't contain required number of bytes (size: " + this.u().toString() + ', required: ' + byteCount.toString() + ')');
|
|
123
129
|
}
|
|
124
130
|
};
|
|
125
|
-
protoOf(Buffer).
|
|
131
|
+
protoOf(Buffer).np = function (byteCount) {
|
|
126
132
|
// Inline function 'kotlin.require' call
|
|
127
|
-
if (!(byteCount
|
|
133
|
+
if (!(compare(byteCount, new Long(0, 0)) >= 0)) {
|
|
128
134
|
var message = 'byteCount: ' + byteCount.toString() + ' < 0';
|
|
129
135
|
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
130
136
|
}
|
|
131
|
-
return this.
|
|
137
|
+
return compare(this.u(), byteCount) >= 0;
|
|
132
138
|
};
|
|
133
|
-
protoOf(Buffer).
|
|
134
|
-
var tmp0_elvis_lhs = this.
|
|
139
|
+
protoOf(Buffer).op = function () {
|
|
140
|
+
var tmp0_elvis_lhs = this.hp_1;
|
|
135
141
|
var tmp;
|
|
136
142
|
if (tmp0_elvis_lhs == null) {
|
|
137
143
|
throwEof(this, new Long(1, 0));
|
|
@@ -139,20 +145,20 @@
|
|
|
139
145
|
tmp = tmp0_elvis_lhs;
|
|
140
146
|
}
|
|
141
147
|
var segment = tmp;
|
|
142
|
-
var segmentSize = segment.
|
|
148
|
+
var segmentSize = segment.u();
|
|
143
149
|
if (segmentSize === 0) {
|
|
144
|
-
this.
|
|
145
|
-
return this.
|
|
150
|
+
this.wp();
|
|
151
|
+
return this.op();
|
|
146
152
|
}
|
|
147
|
-
var v = segment.
|
|
148
|
-
this.
|
|
153
|
+
var v = segment.xp();
|
|
154
|
+
this.jp_1 = subtract(this.jp_1, new Long(1, 0));
|
|
149
155
|
if (segmentSize === 1) {
|
|
150
|
-
this.
|
|
156
|
+
this.wp();
|
|
151
157
|
}
|
|
152
158
|
return v;
|
|
153
159
|
};
|
|
154
|
-
protoOf(Buffer).
|
|
155
|
-
var tmp0_elvis_lhs = this.
|
|
160
|
+
protoOf(Buffer).yp = function () {
|
|
161
|
+
var tmp0_elvis_lhs = this.hp_1;
|
|
156
162
|
var tmp;
|
|
157
163
|
if (tmp0_elvis_lhs == null) {
|
|
158
164
|
throwEof(this, new Long(2, 0));
|
|
@@ -160,131 +166,131 @@
|
|
|
160
166
|
tmp = tmp0_elvis_lhs;
|
|
161
167
|
}
|
|
162
168
|
var segment = tmp;
|
|
163
|
-
var segmentSize = segment.
|
|
169
|
+
var segmentSize = segment.u();
|
|
164
170
|
if (segmentSize < 2) {
|
|
165
|
-
this.
|
|
171
|
+
this.mp(new Long(2, 0));
|
|
166
172
|
if (segmentSize === 0) {
|
|
167
|
-
this.
|
|
168
|
-
return this.
|
|
173
|
+
this.wp();
|
|
174
|
+
return this.yp();
|
|
169
175
|
}
|
|
170
176
|
// Inline function 'kotlinx.io.and' call
|
|
171
|
-
var tmp_0 = (this.
|
|
177
|
+
var tmp_0 = (this.op() & 255) << 8;
|
|
172
178
|
// Inline function 'kotlinx.io.and' call
|
|
173
|
-
var tmp$ret$1 = this.
|
|
179
|
+
var tmp$ret$1 = this.op() & 255;
|
|
174
180
|
return toShort(tmp_0 | tmp$ret$1);
|
|
175
181
|
}
|
|
176
|
-
var v = segment.
|
|
177
|
-
this.
|
|
182
|
+
var v = segment.zp();
|
|
183
|
+
this.jp_1 = subtract(this.jp_1, new Long(2, 0));
|
|
178
184
|
if (segmentSize === 2) {
|
|
179
|
-
this.
|
|
185
|
+
this.wp();
|
|
180
186
|
}
|
|
181
187
|
return v;
|
|
182
188
|
};
|
|
183
|
-
protoOf(Buffer).
|
|
189
|
+
protoOf(Buffer).aq = function () {
|
|
184
190
|
return Unit_instance;
|
|
185
191
|
};
|
|
186
|
-
protoOf(Buffer).
|
|
187
|
-
checkBounds(this.
|
|
188
|
-
if (startIndex
|
|
192
|
+
protoOf(Buffer).bq = function (out, startIndex, endIndex) {
|
|
193
|
+
checkBounds(this.u(), startIndex, endIndex);
|
|
194
|
+
if (equalsLong(startIndex, endIndex))
|
|
189
195
|
return Unit_instance;
|
|
190
196
|
var currentOffset = startIndex;
|
|
191
|
-
var remainingByteCount = endIndex
|
|
192
|
-
out.
|
|
193
|
-
var s = this.
|
|
194
|
-
while (currentOffset
|
|
195
|
-
currentOffset = currentOffset
|
|
196
|
-
s = s.
|
|
197
|
-
}
|
|
198
|
-
while (remainingByteCount
|
|
199
|
-
var copy = ensureNotNull(s).
|
|
200
|
-
copy.
|
|
197
|
+
var remainingByteCount = subtract(endIndex, startIndex);
|
|
198
|
+
out.jp_1 = add(out.jp_1, remainingByteCount);
|
|
199
|
+
var s = this.hp_1;
|
|
200
|
+
while (compare(currentOffset, fromInt(ensureNotNull(s).rp_1 - s.qp_1 | 0)) >= 0) {
|
|
201
|
+
currentOffset = subtract(currentOffset, fromInt(s.rp_1 - s.qp_1 | 0));
|
|
202
|
+
s = s.up_1;
|
|
203
|
+
}
|
|
204
|
+
while (compare(remainingByteCount, new Long(0, 0)) > 0) {
|
|
205
|
+
var copy = ensureNotNull(s).cq();
|
|
206
|
+
copy.qp_1 = copy.qp_1 + convertToInt(currentOffset) | 0;
|
|
201
207
|
var tmp = copy;
|
|
202
|
-
var tmp0 = copy.
|
|
208
|
+
var tmp0 = copy.qp_1 + convertToInt(remainingByteCount) | 0;
|
|
203
209
|
// Inline function 'kotlin.comparisons.minOf' call
|
|
204
|
-
var b = copy.
|
|
205
|
-
tmp.
|
|
210
|
+
var b = copy.rp_1;
|
|
211
|
+
tmp.rp_1 = Math.min(tmp0, b);
|
|
206
212
|
// Inline function 'kotlinx.io.Buffer.pushSegment' call
|
|
207
|
-
if (out.
|
|
208
|
-
out.
|
|
209
|
-
out.
|
|
213
|
+
if (out.hp_1 == null) {
|
|
214
|
+
out.hp_1 = copy;
|
|
215
|
+
out.ip_1 = copy;
|
|
210
216
|
} else if (false) {
|
|
211
|
-
out.
|
|
212
|
-
if (ensureNotNull(out.
|
|
213
|
-
out.
|
|
217
|
+
out.ip_1 = ensureNotNull(out.ip_1).dq(copy).eq();
|
|
218
|
+
if (ensureNotNull(out.ip_1).vp_1 == null) {
|
|
219
|
+
out.hp_1 = out.ip_1;
|
|
214
220
|
}
|
|
215
221
|
} else {
|
|
216
|
-
out.
|
|
222
|
+
out.ip_1 = ensureNotNull(out.ip_1).dq(copy);
|
|
217
223
|
}
|
|
218
|
-
remainingByteCount = remainingByteCount
|
|
224
|
+
remainingByteCount = subtract(remainingByteCount, fromInt(copy.rp_1 - copy.qp_1 | 0));
|
|
219
225
|
currentOffset = new Long(0, 0);
|
|
220
|
-
s = s.
|
|
226
|
+
s = s.up_1;
|
|
221
227
|
}
|
|
222
228
|
};
|
|
223
|
-
protoOf(Buffer).
|
|
224
|
-
var result = this.
|
|
225
|
-
if (result
|
|
229
|
+
protoOf(Buffer).fq = function () {
|
|
230
|
+
var result = this.u();
|
|
231
|
+
if (equalsLong(result, new Long(0, 0)))
|
|
226
232
|
return new Long(0, 0);
|
|
227
|
-
var tail = ensureNotNull(this.
|
|
228
|
-
if (tail.
|
|
229
|
-
result = result
|
|
233
|
+
var tail = ensureNotNull(this.ip_1);
|
|
234
|
+
if (tail.rp_1 < 8192 && tail.tp_1) {
|
|
235
|
+
result = subtract(result, fromInt(tail.rp_1 - tail.qp_1 | 0));
|
|
230
236
|
}
|
|
231
237
|
return result;
|
|
232
238
|
};
|
|
233
|
-
protoOf(Buffer).
|
|
234
|
-
if (position
|
|
235
|
-
throw IndexOutOfBoundsException_init_$Create$('position (' + position.toString() + ') is not within the range [0..size(' + this.
|
|
239
|
+
protoOf(Buffer).gq = function (position) {
|
|
240
|
+
if (compare(position, new Long(0, 0)) < 0 || compare(position, this.u()) >= 0) {
|
|
241
|
+
throw IndexOutOfBoundsException_init_$Create$('position (' + position.toString() + ') is not within the range [0..size(' + this.u().toString() + '))');
|
|
236
242
|
}
|
|
237
|
-
if (position
|
|
238
|
-
return ensureNotNull(this.
|
|
243
|
+
if (equalsLong(position, new Long(0, 0))) {
|
|
244
|
+
return ensureNotNull(this.hp_1).hq(0);
|
|
239
245
|
}
|
|
240
246
|
// Inline function 'kotlinx.io.seek' call
|
|
241
|
-
if (this.
|
|
247
|
+
if (this.hp_1 == null) {
|
|
242
248
|
var offset = new Long(-1, -1);
|
|
243
|
-
return ensureNotNull(null).
|
|
244
|
-
}
|
|
245
|
-
if (this.
|
|
246
|
-
var s = this.
|
|
247
|
-
var offset_0 = this.
|
|
248
|
-
$l$loop: while (!(s == null) && offset_0
|
|
249
|
-
offset_0 = offset_0
|
|
250
|
-
if (offset_0
|
|
249
|
+
return ensureNotNull(null).hq(convertToInt(subtract(position, offset)));
|
|
250
|
+
}
|
|
251
|
+
if (compare(subtract(this.u(), position), position) < 0) {
|
|
252
|
+
var s = this.ip_1;
|
|
253
|
+
var offset_0 = this.u();
|
|
254
|
+
$l$loop: while (!(s == null) && compare(offset_0, position) > 0) {
|
|
255
|
+
offset_0 = subtract(offset_0, fromInt(s.rp_1 - s.qp_1 | 0));
|
|
256
|
+
if (compare(offset_0, position) <= 0)
|
|
251
257
|
break $l$loop;
|
|
252
|
-
s = s.
|
|
258
|
+
s = s.vp_1;
|
|
253
259
|
}
|
|
254
260
|
var tmp0 = s;
|
|
255
261
|
var offset_1 = offset_0;
|
|
256
|
-
return ensureNotNull(tmp0).
|
|
262
|
+
return ensureNotNull(tmp0).hq(convertToInt(subtract(position, offset_1)));
|
|
257
263
|
} else {
|
|
258
|
-
var s_0 = this.
|
|
264
|
+
var s_0 = this.hp_1;
|
|
259
265
|
var offset_2 = new Long(0, 0);
|
|
260
266
|
$l$loop_0: while (!(s_0 == null)) {
|
|
261
267
|
var tmp0_0 = offset_2;
|
|
262
268
|
// Inline function 'kotlin.Long.plus' call
|
|
263
|
-
var other = s_0.
|
|
264
|
-
var nextOffset = tmp0_0
|
|
265
|
-
if (nextOffset
|
|
269
|
+
var other = s_0.rp_1 - s_0.qp_1 | 0;
|
|
270
|
+
var nextOffset = add(tmp0_0, fromInt(other));
|
|
271
|
+
if (compare(nextOffset, position) > 0)
|
|
266
272
|
break $l$loop_0;
|
|
267
|
-
s_0 = s_0.
|
|
273
|
+
s_0 = s_0.up_1;
|
|
268
274
|
offset_2 = nextOffset;
|
|
269
275
|
}
|
|
270
276
|
var tmp0_1 = s_0;
|
|
271
277
|
var offset_3 = offset_2;
|
|
272
|
-
return ensureNotNull(tmp0_1).
|
|
278
|
+
return ensureNotNull(tmp0_1).hq(convertToInt(subtract(position, offset_3)));
|
|
273
279
|
}
|
|
274
280
|
};
|
|
275
|
-
protoOf(Buffer).
|
|
276
|
-
return this.
|
|
281
|
+
protoOf(Buffer).b2 = function () {
|
|
282
|
+
return this.iq(this.u());
|
|
277
283
|
};
|
|
278
|
-
protoOf(Buffer).
|
|
284
|
+
protoOf(Buffer).iq = function (byteCount) {
|
|
279
285
|
// Inline function 'kotlinx.io.checkByteCount' call
|
|
280
286
|
// Inline function 'kotlin.require' call
|
|
281
|
-
if (!(byteCount
|
|
287
|
+
if (!(compare(byteCount, new Long(0, 0)) >= 0)) {
|
|
282
288
|
var message = 'byteCount (' + byteCount.toString() + ') < 0';
|
|
283
289
|
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
284
290
|
}
|
|
285
291
|
var remainingByteCount = byteCount;
|
|
286
|
-
while (remainingByteCount
|
|
287
|
-
var tmp0_elvis_lhs = this.
|
|
292
|
+
while (compare(remainingByteCount, new Long(0, 0)) > 0) {
|
|
293
|
+
var tmp0_elvis_lhs = this.hp_1;
|
|
288
294
|
var tmp;
|
|
289
295
|
if (tmp0_elvis_lhs == null) {
|
|
290
296
|
throw EOFException_init_$Create$_0('Buffer exhausted before skipping ' + byteCount.toString() + ' bytes.');
|
|
@@ -294,23 +300,24 @@
|
|
|
294
300
|
var head = tmp;
|
|
295
301
|
var tmp0 = remainingByteCount;
|
|
296
302
|
// Inline function 'kotlinx.io.minOf' call
|
|
297
|
-
var b = head.
|
|
303
|
+
var b = head.rp_1 - head.qp_1 | 0;
|
|
298
304
|
// Inline function 'kotlin.comparisons.minOf' call
|
|
299
|
-
var b_0 =
|
|
300
|
-
var
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
305
|
+
var b_0 = fromInt(b);
|
|
306
|
+
var tmp$ret$4 = compare(tmp0, b_0) <= 0 ? tmp0 : b_0;
|
|
307
|
+
var toSkip = convertToInt(tmp$ret$4);
|
|
308
|
+
this.jp_1 = subtract(this.jp_1, fromInt(toSkip));
|
|
309
|
+
remainingByteCount = subtract(remainingByteCount, fromInt(toSkip));
|
|
310
|
+
head.qp_1 = head.qp_1 + toSkip | 0;
|
|
311
|
+
if (head.qp_1 === head.rp_1) {
|
|
312
|
+
this.wp();
|
|
306
313
|
}
|
|
307
314
|
}
|
|
308
315
|
};
|
|
309
|
-
protoOf(Buffer).
|
|
316
|
+
protoOf(Buffer).jq = function (sink, startIndex, endIndex) {
|
|
310
317
|
// Inline function 'kotlinx.io.checkBounds' call
|
|
311
318
|
var size = sink.length;
|
|
312
|
-
checkBounds(
|
|
313
|
-
var tmp0_elvis_lhs = this.
|
|
319
|
+
checkBounds(fromInt(size), fromInt(startIndex), fromInt(endIndex));
|
|
320
|
+
var tmp0_elvis_lhs = this.hp_1;
|
|
314
321
|
var tmp;
|
|
315
322
|
if (tmp0_elvis_lhs == null) {
|
|
316
323
|
return -1;
|
|
@@ -320,572 +327,576 @@
|
|
|
320
327
|
var s = tmp;
|
|
321
328
|
var tmp0 = endIndex - startIndex | 0;
|
|
322
329
|
// Inline function 'kotlin.comparisons.minOf' call
|
|
323
|
-
var b = s.
|
|
330
|
+
var b = s.u();
|
|
324
331
|
var toCopy = Math.min(tmp0, b);
|
|
325
|
-
s.
|
|
326
|
-
this.
|
|
332
|
+
s.kq(sink, startIndex, startIndex + toCopy | 0);
|
|
333
|
+
this.jp_1 = subtract(this.jp_1, fromInt(toCopy));
|
|
327
334
|
if (isEmpty(s)) {
|
|
328
|
-
this.
|
|
335
|
+
this.wp();
|
|
329
336
|
}
|
|
330
337
|
return toCopy;
|
|
331
338
|
};
|
|
332
|
-
protoOf(Buffer).
|
|
339
|
+
protoOf(Buffer).lq = function (sink, byteCount) {
|
|
333
340
|
// Inline function 'kotlinx.io.checkByteCount' call
|
|
334
341
|
// Inline function 'kotlin.require' call
|
|
335
|
-
if (!(byteCount
|
|
342
|
+
if (!(compare(byteCount, new Long(0, 0)) >= 0)) {
|
|
336
343
|
var message = 'byteCount (' + byteCount.toString() + ') < 0';
|
|
337
344
|
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
338
345
|
}
|
|
339
|
-
if (this.
|
|
346
|
+
if (equalsLong(this.u(), new Long(0, 0)))
|
|
340
347
|
return new Long(-1, -1);
|
|
341
|
-
var bytesWritten = byteCount
|
|
342
|
-
sink.
|
|
348
|
+
var bytesWritten = compare(byteCount, this.u()) > 0 ? this.u() : byteCount;
|
|
349
|
+
sink.mq(this, bytesWritten);
|
|
343
350
|
return bytesWritten;
|
|
344
351
|
};
|
|
345
|
-
protoOf(Buffer).
|
|
352
|
+
protoOf(Buffer).nq = function (sink, byteCount) {
|
|
346
353
|
// Inline function 'kotlinx.io.checkByteCount' call
|
|
347
354
|
// Inline function 'kotlin.require' call
|
|
348
|
-
if (!(byteCount
|
|
355
|
+
if (!(compare(byteCount, new Long(0, 0)) >= 0)) {
|
|
349
356
|
var message = 'byteCount (' + byteCount.toString() + ') < 0';
|
|
350
357
|
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
351
358
|
}
|
|
352
|
-
if (this.
|
|
353
|
-
sink.
|
|
354
|
-
throw EOFException_init_$Create$_0('Buffer exhausted before writing ' + byteCount.toString() + ' bytes. Only ' + this.
|
|
359
|
+
if (compare(this.u(), byteCount) < 0) {
|
|
360
|
+
sink.mq(this, this.u());
|
|
361
|
+
throw EOFException_init_$Create$_0('Buffer exhausted before writing ' + byteCount.toString() + ' bytes. Only ' + this.u().toString() + ' bytes were written.');
|
|
355
362
|
}
|
|
356
|
-
sink.
|
|
363
|
+
sink.mq(this, byteCount);
|
|
357
364
|
};
|
|
358
|
-
protoOf(Buffer).
|
|
359
|
-
var byteCount = this.
|
|
360
|
-
if (byteCount
|
|
361
|
-
sink.
|
|
365
|
+
protoOf(Buffer).oq = function (sink) {
|
|
366
|
+
var byteCount = this.u();
|
|
367
|
+
if (compare(byteCount, new Long(0, 0)) > 0) {
|
|
368
|
+
sink.mq(this, byteCount);
|
|
362
369
|
}
|
|
363
370
|
return byteCount;
|
|
364
371
|
};
|
|
365
|
-
protoOf(Buffer).
|
|
372
|
+
protoOf(Buffer).pq = function () {
|
|
366
373
|
return buffered(new PeekSource(this));
|
|
367
374
|
};
|
|
368
|
-
protoOf(Buffer).
|
|
375
|
+
protoOf(Buffer).qq = function (minimumCapacity) {
|
|
369
376
|
// Inline function 'kotlin.require' call
|
|
370
377
|
if (!(minimumCapacity >= 1 && minimumCapacity <= 8192)) {
|
|
371
378
|
var message = 'unexpected capacity (' + minimumCapacity + '), should be in range [1, 8192]';
|
|
372
379
|
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
373
380
|
}
|
|
374
|
-
if (this.
|
|
375
|
-
var result = SegmentPool_instance.
|
|
376
|
-
this.
|
|
377
|
-
this.
|
|
381
|
+
if (this.ip_1 == null) {
|
|
382
|
+
var result = SegmentPool_instance.tq();
|
|
383
|
+
this.hp_1 = result;
|
|
384
|
+
this.ip_1 = result;
|
|
378
385
|
return result;
|
|
379
386
|
}
|
|
380
|
-
var t = ensureNotNull(this.
|
|
381
|
-
if ((t.
|
|
382
|
-
var newTail = t.
|
|
383
|
-
this.
|
|
387
|
+
var t = ensureNotNull(this.ip_1);
|
|
388
|
+
if ((t.rp_1 + minimumCapacity | 0) > 8192 || !t.tp_1) {
|
|
389
|
+
var newTail = t.dq(SegmentPool_instance.tq());
|
|
390
|
+
this.ip_1 = newTail;
|
|
384
391
|
return newTail;
|
|
385
392
|
}
|
|
386
393
|
return t;
|
|
387
394
|
};
|
|
388
|
-
protoOf(Buffer).
|
|
395
|
+
protoOf(Buffer).uq = function (source, startIndex, endIndex) {
|
|
389
396
|
// Inline function 'kotlinx.io.checkBounds' call
|
|
390
397
|
var size = source.length;
|
|
391
|
-
checkBounds(
|
|
398
|
+
checkBounds(fromInt(size), fromInt(startIndex), fromInt(endIndex));
|
|
392
399
|
var currentOffset = startIndex;
|
|
393
400
|
while (currentOffset < endIndex) {
|
|
394
|
-
var tail = this.
|
|
401
|
+
var tail = this.qq(1);
|
|
395
402
|
var tmp0 = endIndex - currentOffset | 0;
|
|
396
403
|
// Inline function 'kotlin.comparisons.minOf' call
|
|
397
|
-
var b = tail.
|
|
404
|
+
var b = tail.vq();
|
|
398
405
|
var toCopy = Math.min(tmp0, b);
|
|
399
|
-
tail.
|
|
406
|
+
tail.wq(source, currentOffset, currentOffset + toCopy | 0);
|
|
400
407
|
currentOffset = currentOffset + toCopy | 0;
|
|
401
408
|
}
|
|
402
409
|
var tmp = this;
|
|
403
|
-
var tmp0_0 = this.
|
|
410
|
+
var tmp0_0 = this.jp_1;
|
|
404
411
|
// Inline function 'kotlin.Long.plus' call
|
|
405
412
|
var other = endIndex - startIndex | 0;
|
|
406
|
-
tmp.
|
|
413
|
+
tmp.jp_1 = add(tmp0_0, fromInt(other));
|
|
407
414
|
};
|
|
408
|
-
protoOf(Buffer).
|
|
415
|
+
protoOf(Buffer).yq = function (source, byteCount) {
|
|
409
416
|
// Inline function 'kotlinx.io.checkByteCount' call
|
|
410
417
|
// Inline function 'kotlin.require' call
|
|
411
|
-
if (!(byteCount
|
|
418
|
+
if (!(compare(byteCount, new Long(0, 0)) >= 0)) {
|
|
412
419
|
var message = 'byteCount (' + byteCount.toString() + ') < 0';
|
|
413
420
|
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
414
421
|
}
|
|
415
422
|
var remainingByteCount = byteCount;
|
|
416
|
-
while (remainingByteCount
|
|
417
|
-
var read = source.
|
|
418
|
-
if (read
|
|
419
|
-
throw EOFException_init_$Create$_0('Source exhausted before reading ' + byteCount.toString() + ' bytes. ' + ('Only ' + byteCount
|
|
423
|
+
while (compare(remainingByteCount, new Long(0, 0)) > 0) {
|
|
424
|
+
var read = source.lq(this, remainingByteCount);
|
|
425
|
+
if (equalsLong(read, new Long(-1, -1))) {
|
|
426
|
+
throw EOFException_init_$Create$_0('Source exhausted before reading ' + byteCount.toString() + ' bytes. ' + ('Only ' + subtract(byteCount, remainingByteCount).toString() + ' were read.'));
|
|
420
427
|
}
|
|
421
|
-
remainingByteCount = remainingByteCount
|
|
428
|
+
remainingByteCount = subtract(remainingByteCount, read);
|
|
422
429
|
}
|
|
423
430
|
};
|
|
424
|
-
protoOf(Buffer).
|
|
431
|
+
protoOf(Buffer).mq = function (source, byteCount) {
|
|
425
432
|
// Inline function 'kotlin.require' call
|
|
426
433
|
if (!!(source === this)) {
|
|
427
434
|
var message = 'source == this';
|
|
428
435
|
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
429
436
|
}
|
|
430
|
-
checkOffsetAndCount(source.
|
|
437
|
+
checkOffsetAndCount(source.jp_1, new Long(0, 0), byteCount);
|
|
431
438
|
var remainingByteCount = byteCount;
|
|
432
|
-
while (remainingByteCount
|
|
433
|
-
if (remainingByteCount
|
|
434
|
-
var tail = this.
|
|
439
|
+
while (compare(remainingByteCount, new Long(0, 0)) > 0) {
|
|
440
|
+
if (compare(remainingByteCount, fromInt(ensureNotNull(source.hp_1).u())) < 0) {
|
|
441
|
+
var tail = this.ip_1;
|
|
435
442
|
var tmp;
|
|
436
|
-
if (!(tail == null) && tail.
|
|
443
|
+
if (!(tail == null) && tail.tp_1) {
|
|
437
444
|
var tmp0 = remainingByteCount;
|
|
438
445
|
// Inline function 'kotlin.Long.plus' call
|
|
439
|
-
var other = tail.
|
|
440
|
-
var tmp0_0 = tmp0
|
|
446
|
+
var other = tail.rp_1;
|
|
447
|
+
var tmp0_0 = add(tmp0, fromInt(other));
|
|
441
448
|
// Inline function 'kotlin.Long.minus' call
|
|
442
|
-
var other_0 = tail.
|
|
443
|
-
tmp = tmp0_0
|
|
449
|
+
var other_0 = tail.zq() ? 0 : tail.qp_1;
|
|
450
|
+
var tmp$ret$3 = subtract(tmp0_0, fromInt(other_0));
|
|
451
|
+
tmp = compare(tmp$ret$3, new Long(8192, 0)) <= 0;
|
|
444
452
|
} else {
|
|
445
453
|
tmp = false;
|
|
446
454
|
}
|
|
447
455
|
if (tmp) {
|
|
448
|
-
ensureNotNull(source.
|
|
449
|
-
source.
|
|
450
|
-
this.
|
|
456
|
+
ensureNotNull(source.hp_1).br(tail, convertToInt(remainingByteCount));
|
|
457
|
+
source.jp_1 = subtract(source.jp_1, remainingByteCount);
|
|
458
|
+
this.jp_1 = add(this.jp_1, remainingByteCount);
|
|
451
459
|
return Unit_instance;
|
|
452
460
|
} else {
|
|
453
|
-
source.
|
|
461
|
+
source.hp_1 = ensureNotNull(source.hp_1).ar(convertToInt(remainingByteCount));
|
|
454
462
|
}
|
|
455
463
|
}
|
|
456
|
-
var segmentToMove = ensureNotNull(source.
|
|
457
|
-
var movedByteCount =
|
|
458
|
-
source.
|
|
459
|
-
if (source.
|
|
460
|
-
source.
|
|
464
|
+
var segmentToMove = ensureNotNull(source.hp_1);
|
|
465
|
+
var movedByteCount = fromInt(segmentToMove.u());
|
|
466
|
+
source.hp_1 = segmentToMove.cr();
|
|
467
|
+
if (source.hp_1 == null) {
|
|
468
|
+
source.ip_1 = null;
|
|
461
469
|
}
|
|
462
470
|
// Inline function 'kotlinx.io.Buffer.pushSegment' call
|
|
463
|
-
if (this.
|
|
464
|
-
this.
|
|
465
|
-
this.
|
|
471
|
+
if (this.hp_1 == null) {
|
|
472
|
+
this.hp_1 = segmentToMove;
|
|
473
|
+
this.ip_1 = segmentToMove;
|
|
466
474
|
} else if (true) {
|
|
467
|
-
this.
|
|
468
|
-
if (ensureNotNull(this.
|
|
469
|
-
this.
|
|
475
|
+
this.ip_1 = ensureNotNull(this.ip_1).dq(segmentToMove).eq();
|
|
476
|
+
if (ensureNotNull(this.ip_1).vp_1 == null) {
|
|
477
|
+
this.hp_1 = this.ip_1;
|
|
470
478
|
}
|
|
471
479
|
} else {
|
|
472
|
-
this.
|
|
480
|
+
this.ip_1 = ensureNotNull(this.ip_1).dq(segmentToMove);
|
|
473
481
|
}
|
|
474
|
-
source.
|
|
475
|
-
this.
|
|
476
|
-
remainingByteCount = remainingByteCount
|
|
482
|
+
source.jp_1 = subtract(source.jp_1, movedByteCount);
|
|
483
|
+
this.jp_1 = add(this.jp_1, movedByteCount);
|
|
484
|
+
remainingByteCount = subtract(remainingByteCount, movedByteCount);
|
|
477
485
|
}
|
|
478
486
|
};
|
|
479
|
-
protoOf(Buffer).
|
|
487
|
+
protoOf(Buffer).dr = function (source) {
|
|
480
488
|
var totalBytesRead = new Long(0, 0);
|
|
481
489
|
$l$loop: while (true) {
|
|
482
|
-
var readCount = source.
|
|
483
|
-
if (readCount
|
|
490
|
+
var readCount = source.lq(this, new Long(8192, 0));
|
|
491
|
+
if (equalsLong(readCount, new Long(-1, -1)))
|
|
484
492
|
break $l$loop;
|
|
485
|
-
totalBytesRead = totalBytesRead
|
|
493
|
+
totalBytesRead = add(totalBytesRead, readCount);
|
|
486
494
|
}
|
|
487
495
|
return totalBytesRead;
|
|
488
496
|
};
|
|
489
|
-
protoOf(Buffer).
|
|
490
|
-
this.
|
|
491
|
-
this.
|
|
497
|
+
protoOf(Buffer).er = function (byte) {
|
|
498
|
+
this.qq(1).fr(byte);
|
|
499
|
+
this.jp_1 = add(this.jp_1, new Long(1, 0));
|
|
492
500
|
};
|
|
493
|
-
protoOf(Buffer).
|
|
494
|
-
this.
|
|
495
|
-
this.
|
|
501
|
+
protoOf(Buffer).gr = function (short) {
|
|
502
|
+
this.qq(2).hr(short);
|
|
503
|
+
this.jp_1 = add(this.jp_1, new Long(2, 0));
|
|
496
504
|
};
|
|
497
|
-
protoOf(Buffer).
|
|
505
|
+
protoOf(Buffer).b4 = function () {
|
|
498
506
|
return Unit_instance;
|
|
499
507
|
};
|
|
500
508
|
protoOf(Buffer).toString = function () {
|
|
501
|
-
if (this.
|
|
509
|
+
if (equalsLong(this.u(), new Long(0, 0)))
|
|
502
510
|
return 'Buffer(size=0)';
|
|
503
511
|
var maxPrintableBytes = 64;
|
|
504
512
|
// Inline function 'kotlinx.io.minOf' call
|
|
505
|
-
var b = this.
|
|
513
|
+
var b = this.u();
|
|
506
514
|
// Inline function 'kotlin.comparisons.minOf' call
|
|
507
|
-
var a =
|
|
508
|
-
var
|
|
509
|
-
var
|
|
515
|
+
var a = fromInt(maxPrintableBytes);
|
|
516
|
+
var tmp$ret$1 = compare(a, b) <= 0 ? a : b;
|
|
517
|
+
var len = convertToInt(tmp$ret$1);
|
|
518
|
+
var builder = StringBuilder_init_$Create$(imul(len, 2) + (compare(this.u(), fromInt(maxPrintableBytes)) > 0 ? 1 : 0) | 0);
|
|
510
519
|
var bytesWritten = 0;
|
|
511
520
|
// Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.forEachSegment' call
|
|
512
|
-
var curr = this.
|
|
521
|
+
var curr = this.hp_1;
|
|
513
522
|
while (!(curr == null)) {
|
|
514
523
|
var tmp0 = get_SegmentReadContextImpl();
|
|
515
524
|
var segment = curr;
|
|
516
525
|
var idx = 0;
|
|
517
|
-
while (bytesWritten < len && idx < segment.
|
|
526
|
+
while (bytesWritten < len && idx < segment.u()) {
|
|
518
527
|
var _unary__edvuaz = idx;
|
|
519
528
|
idx = _unary__edvuaz + 1 | 0;
|
|
520
|
-
var b_0 = tmp0.
|
|
529
|
+
var b_0 = tmp0.ir(segment, _unary__edvuaz);
|
|
521
530
|
bytesWritten = bytesWritten + 1 | 0;
|
|
522
531
|
var tmp = get_HEX_DIGIT_CHARS();
|
|
523
532
|
// Inline function 'kotlinx.io.shr' call
|
|
524
533
|
var tmp$ret$2 = b_0 >> 4;
|
|
525
|
-
var tmp_0 = builder.
|
|
534
|
+
var tmp_0 = builder.g8(tmp[tmp$ret$2 & 15]);
|
|
526
535
|
var tmp_1 = get_HEX_DIGIT_CHARS();
|
|
527
536
|
// Inline function 'kotlinx.io.and' call
|
|
528
537
|
var tmp$ret$3 = b_0 & 15;
|
|
529
|
-
tmp_0.
|
|
538
|
+
tmp_0.g8(tmp_1[tmp$ret$3]);
|
|
530
539
|
}
|
|
531
|
-
curr = curr.
|
|
540
|
+
curr = curr.up_1;
|
|
532
541
|
}
|
|
533
|
-
if (this.
|
|
534
|
-
builder.
|
|
542
|
+
if (compare(this.u(), fromInt(maxPrintableBytes)) > 0) {
|
|
543
|
+
builder.g8(_Char___init__impl__6a9atx(8230));
|
|
535
544
|
}
|
|
536
|
-
return 'Buffer(size=' + this.
|
|
545
|
+
return 'Buffer(size=' + this.u().toString() + ' hex=' + builder.toString() + ')';
|
|
537
546
|
};
|
|
538
|
-
protoOf(Buffer).
|
|
539
|
-
var oldHead = ensureNotNull(this.
|
|
540
|
-
var nextHead = oldHead.
|
|
541
|
-
this.
|
|
547
|
+
protoOf(Buffer).wp = function () {
|
|
548
|
+
var oldHead = ensureNotNull(this.hp_1);
|
|
549
|
+
var nextHead = oldHead.up_1;
|
|
550
|
+
this.hp_1 = nextHead;
|
|
542
551
|
if (nextHead == null) {
|
|
543
|
-
this.
|
|
552
|
+
this.ip_1 = null;
|
|
544
553
|
} else {
|
|
545
|
-
nextHead.
|
|
554
|
+
nextHead.vp_1 = null;
|
|
546
555
|
}
|
|
547
|
-
oldHead.
|
|
548
|
-
SegmentPool_instance.
|
|
556
|
+
oldHead.up_1 = null;
|
|
557
|
+
SegmentPool_instance.jr(oldHead);
|
|
549
558
|
};
|
|
550
|
-
protoOf(Buffer).
|
|
551
|
-
var oldTail = ensureNotNull(this.
|
|
552
|
-
var newTail = oldTail.
|
|
553
|
-
this.
|
|
559
|
+
protoOf(Buffer).kr = function () {
|
|
560
|
+
var oldTail = ensureNotNull(this.ip_1);
|
|
561
|
+
var newTail = oldTail.vp_1;
|
|
562
|
+
this.ip_1 = newTail;
|
|
554
563
|
if (newTail == null) {
|
|
555
|
-
this.
|
|
564
|
+
this.hp_1 = null;
|
|
556
565
|
} else {
|
|
557
|
-
newTail.
|
|
566
|
+
newTail.up_1 = null;
|
|
558
567
|
}
|
|
559
|
-
oldTail.
|
|
560
|
-
SegmentPool_instance.
|
|
568
|
+
oldTail.vp_1 = null;
|
|
569
|
+
SegmentPool_instance.jr(oldTail);
|
|
561
570
|
};
|
|
562
571
|
function indexOf(_this__u8e3s4, byte, startIndex, endIndex) {
|
|
563
572
|
startIndex = startIndex === VOID ? new Long(0, 0) : startIndex;
|
|
564
|
-
endIndex = endIndex === VOID ? _this__u8e3s4.
|
|
573
|
+
endIndex = endIndex === VOID ? _this__u8e3s4.u() : endIndex;
|
|
565
574
|
// Inline function 'kotlin.comparisons.minOf' call
|
|
566
|
-
var b = _this__u8e3s4.
|
|
567
|
-
var endOffset = endIndex
|
|
568
|
-
checkBounds(_this__u8e3s4.
|
|
569
|
-
if (startIndex
|
|
575
|
+
var b = _this__u8e3s4.u();
|
|
576
|
+
var endOffset = compare(endIndex, b) <= 0 ? endIndex : b;
|
|
577
|
+
checkBounds(_this__u8e3s4.u(), startIndex, endOffset);
|
|
578
|
+
if (equalsLong(startIndex, endOffset))
|
|
570
579
|
return new Long(-1, -1);
|
|
571
580
|
// Inline function 'kotlinx.io.seek' call
|
|
572
|
-
if (_this__u8e3s4.
|
|
581
|
+
if (_this__u8e3s4.hp_1 == null) {
|
|
573
582
|
var o = new Long(-1, -1);
|
|
574
|
-
if (o
|
|
583
|
+
if (equalsLong(o, new Long(-1, -1))) {
|
|
575
584
|
return new Long(-1, -1);
|
|
576
585
|
}
|
|
577
586
|
var segment = null;
|
|
578
587
|
var offset = o;
|
|
579
588
|
do {
|
|
580
589
|
// Inline function 'kotlin.check' call
|
|
581
|
-
if (!(endOffset
|
|
590
|
+
if (!(compare(endOffset, offset) > 0)) {
|
|
582
591
|
throw IllegalStateException_init_$Create$('Check failed.');
|
|
583
592
|
}
|
|
584
593
|
ensureNotNull(segment);
|
|
585
594
|
var tmp = segment;
|
|
586
595
|
// Inline function 'kotlin.comparisons.maxOf' call
|
|
587
|
-
var a = startIndex
|
|
596
|
+
var a = convertToInt(subtract(startIndex, offset));
|
|
588
597
|
var tmp_0 = Math.max(a, 0);
|
|
589
|
-
var tmp0 = segment.
|
|
598
|
+
var tmp0 = segment.u();
|
|
590
599
|
// Inline function 'kotlin.comparisons.minOf' call
|
|
591
|
-
var b_0 = endOffset
|
|
600
|
+
var b_0 = convertToInt(subtract(endOffset, offset));
|
|
592
601
|
var tmp$ret$3 = Math.min(tmp0, b_0);
|
|
593
602
|
var idx = indexOf_0(tmp, byte, tmp_0, tmp$ret$3);
|
|
594
603
|
if (!(idx === -1)) {
|
|
595
|
-
return offset
|
|
604
|
+
return add(offset, fromInt(idx));
|
|
596
605
|
}
|
|
597
606
|
var tmp0_0 = offset;
|
|
598
607
|
// Inline function 'kotlin.Long.plus' call
|
|
599
|
-
var other = segment.
|
|
600
|
-
offset = tmp0_0
|
|
601
|
-
segment = segment.
|
|
608
|
+
var other = segment.u();
|
|
609
|
+
offset = add(tmp0_0, fromInt(other));
|
|
610
|
+
segment = segment.up_1;
|
|
602
611
|
}
|
|
603
|
-
while (!(segment == null) && offset
|
|
612
|
+
while (!(segment == null) && compare(offset, endOffset) < 0);
|
|
604
613
|
return new Long(-1, -1);
|
|
605
614
|
}
|
|
606
|
-
if (_this__u8e3s4.
|
|
607
|
-
var s = _this__u8e3s4.
|
|
608
|
-
var offset_0 = _this__u8e3s4.
|
|
609
|
-
$l$loop: while (!(s == null) && offset_0
|
|
610
|
-
offset_0 = offset_0
|
|
611
|
-
if (offset_0
|
|
615
|
+
if (compare(subtract(_this__u8e3s4.u(), startIndex), startIndex) < 0) {
|
|
616
|
+
var s = _this__u8e3s4.ip_1;
|
|
617
|
+
var offset_0 = _this__u8e3s4.u();
|
|
618
|
+
$l$loop: while (!(s == null) && compare(offset_0, startIndex) > 0) {
|
|
619
|
+
offset_0 = subtract(offset_0, fromInt(s.rp_1 - s.qp_1 | 0));
|
|
620
|
+
if (compare(offset_0, startIndex) <= 0)
|
|
612
621
|
break $l$loop;
|
|
613
|
-
s = s.
|
|
622
|
+
s = s.vp_1;
|
|
614
623
|
}
|
|
615
624
|
var tmp0_1 = s;
|
|
616
625
|
var o_0 = offset_0;
|
|
617
|
-
if (o_0
|
|
626
|
+
if (equalsLong(o_0, new Long(-1, -1))) {
|
|
618
627
|
return new Long(-1, -1);
|
|
619
628
|
}
|
|
620
629
|
var segment_0 = tmp0_1;
|
|
621
630
|
var offset_1 = o_0;
|
|
622
631
|
do {
|
|
623
632
|
// Inline function 'kotlin.check' call
|
|
624
|
-
if (!(endOffset
|
|
633
|
+
if (!(compare(endOffset, offset_1) > 0)) {
|
|
625
634
|
throw IllegalStateException_init_$Create$('Check failed.');
|
|
626
635
|
}
|
|
627
636
|
ensureNotNull(segment_0);
|
|
628
637
|
var tmp_1 = segment_0;
|
|
629
638
|
// Inline function 'kotlin.comparisons.maxOf' call
|
|
630
|
-
var a_0 = startIndex
|
|
639
|
+
var a_0 = convertToInt(subtract(startIndex, offset_1));
|
|
631
640
|
var tmp_2 = Math.max(a_0, 0);
|
|
632
|
-
var tmp0_2 = segment_0.
|
|
641
|
+
var tmp0_2 = segment_0.u();
|
|
633
642
|
// Inline function 'kotlin.comparisons.minOf' call
|
|
634
|
-
var b_1 = endOffset
|
|
643
|
+
var b_1 = convertToInt(subtract(endOffset, offset_1));
|
|
635
644
|
var tmp$ret$8 = Math.min(tmp0_2, b_1);
|
|
636
645
|
var idx_0 = indexOf_0(tmp_1, byte, tmp_2, tmp$ret$8);
|
|
637
646
|
if (!(idx_0 === -1)) {
|
|
638
|
-
return offset_1
|
|
647
|
+
return add(offset_1, fromInt(idx_0));
|
|
639
648
|
}
|
|
640
649
|
var tmp0_3 = offset_1;
|
|
641
650
|
// Inline function 'kotlin.Long.plus' call
|
|
642
|
-
var other_0 = segment_0.
|
|
643
|
-
offset_1 = tmp0_3
|
|
644
|
-
segment_0 = segment_0.
|
|
651
|
+
var other_0 = segment_0.u();
|
|
652
|
+
offset_1 = add(tmp0_3, fromInt(other_0));
|
|
653
|
+
segment_0 = segment_0.up_1;
|
|
645
654
|
}
|
|
646
|
-
while (!(segment_0 == null) && offset_1
|
|
655
|
+
while (!(segment_0 == null) && compare(offset_1, endOffset) < 0);
|
|
647
656
|
return new Long(-1, -1);
|
|
648
657
|
} else {
|
|
649
|
-
var s_0 = _this__u8e3s4.
|
|
658
|
+
var s_0 = _this__u8e3s4.hp_1;
|
|
650
659
|
var offset_2 = new Long(0, 0);
|
|
651
660
|
$l$loop_0: while (!(s_0 == null)) {
|
|
652
661
|
var tmp0_4 = offset_2;
|
|
653
662
|
// Inline function 'kotlin.Long.plus' call
|
|
654
|
-
var other_1 = s_0.
|
|
655
|
-
var nextOffset = tmp0_4
|
|
656
|
-
if (nextOffset
|
|
663
|
+
var other_1 = s_0.rp_1 - s_0.qp_1 | 0;
|
|
664
|
+
var nextOffset = add(tmp0_4, fromInt(other_1));
|
|
665
|
+
if (compare(nextOffset, startIndex) > 0)
|
|
657
666
|
break $l$loop_0;
|
|
658
|
-
s_0 = s_0.
|
|
667
|
+
s_0 = s_0.up_1;
|
|
659
668
|
offset_2 = nextOffset;
|
|
660
669
|
}
|
|
661
670
|
var tmp0_5 = s_0;
|
|
662
671
|
var o_1 = offset_2;
|
|
663
|
-
if (o_1
|
|
672
|
+
if (equalsLong(o_1, new Long(-1, -1))) {
|
|
664
673
|
return new Long(-1, -1);
|
|
665
674
|
}
|
|
666
675
|
var segment_1 = tmp0_5;
|
|
667
676
|
var offset_3 = o_1;
|
|
668
677
|
do {
|
|
669
678
|
// Inline function 'kotlin.check' call
|
|
670
|
-
if (!(endOffset
|
|
679
|
+
if (!(compare(endOffset, offset_3) > 0)) {
|
|
671
680
|
throw IllegalStateException_init_$Create$('Check failed.');
|
|
672
681
|
}
|
|
673
682
|
ensureNotNull(segment_1);
|
|
674
683
|
var tmp_3 = segment_1;
|
|
675
684
|
// Inline function 'kotlin.comparisons.maxOf' call
|
|
676
|
-
var a_1 = startIndex
|
|
685
|
+
var a_1 = convertToInt(subtract(startIndex, offset_3));
|
|
677
686
|
var tmp_4 = Math.max(a_1, 0);
|
|
678
|
-
var tmp0_6 = segment_1.
|
|
687
|
+
var tmp0_6 = segment_1.u();
|
|
679
688
|
// Inline function 'kotlin.comparisons.minOf' call
|
|
680
|
-
var b_2 = endOffset
|
|
689
|
+
var b_2 = convertToInt(subtract(endOffset, offset_3));
|
|
681
690
|
var tmp$ret$13 = Math.min(tmp0_6, b_2);
|
|
682
691
|
var idx_1 = indexOf_0(tmp_3, byte, tmp_4, tmp$ret$13);
|
|
683
692
|
if (!(idx_1 === -1)) {
|
|
684
|
-
return offset_3
|
|
693
|
+
return add(offset_3, fromInt(idx_1));
|
|
685
694
|
}
|
|
686
695
|
var tmp0_7 = offset_3;
|
|
687
696
|
// Inline function 'kotlin.Long.plus' call
|
|
688
|
-
var other_2 = segment_1.
|
|
689
|
-
offset_3 = tmp0_7
|
|
690
|
-
segment_1 = segment_1.
|
|
697
|
+
var other_2 = segment_1.u();
|
|
698
|
+
offset_3 = add(tmp0_7, fromInt(other_2));
|
|
699
|
+
segment_1 = segment_1.up_1;
|
|
691
700
|
}
|
|
692
|
-
while (!(segment_1 == null) && offset_3
|
|
701
|
+
while (!(segment_1 == null) && compare(offset_3, endOffset) < 0);
|
|
693
702
|
return new Long(-1, -1);
|
|
694
703
|
}
|
|
695
704
|
}
|
|
696
705
|
function readByteString(_this__u8e3s4, byteCount) {
|
|
697
|
-
return UnsafeByteStringOperations_instance.
|
|
706
|
+
return UnsafeByteStringOperations_instance.gp(readByteArray_0(_this__u8e3s4, byteCount));
|
|
698
707
|
}
|
|
699
708
|
function buffered(_this__u8e3s4) {
|
|
700
709
|
return new RealSource(_this__u8e3s4);
|
|
701
710
|
}
|
|
702
711
|
function PeekSource(upstream) {
|
|
703
|
-
this.
|
|
704
|
-
this.
|
|
705
|
-
this.
|
|
712
|
+
this.lr_1 = upstream;
|
|
713
|
+
this.mr_1 = this.lr_1.kp();
|
|
714
|
+
this.nr_1 = this.mr_1.hp_1;
|
|
706
715
|
var tmp = this;
|
|
707
|
-
var tmp0_safe_receiver = this.
|
|
708
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
709
|
-
tmp.
|
|
710
|
-
this.
|
|
711
|
-
this.
|
|
716
|
+
var tmp0_safe_receiver = this.mr_1.hp_1;
|
|
717
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.qp_1;
|
|
718
|
+
tmp.or_1 = tmp1_elvis_lhs == null ? -1 : tmp1_elvis_lhs;
|
|
719
|
+
this.pr_1 = false;
|
|
720
|
+
this.qr_1 = new Long(0, 0);
|
|
712
721
|
}
|
|
713
|
-
protoOf(PeekSource).
|
|
722
|
+
protoOf(PeekSource).lq = function (sink, byteCount) {
|
|
714
723
|
// Inline function 'kotlin.check' call
|
|
715
|
-
if (!!this.
|
|
724
|
+
if (!!this.pr_1) {
|
|
716
725
|
var message = 'Source is closed.';
|
|
717
726
|
throw IllegalStateException_init_$Create$(toString(message));
|
|
718
727
|
}
|
|
719
728
|
// Inline function 'kotlinx.io.checkByteCount' call
|
|
720
729
|
// Inline function 'kotlin.require' call
|
|
721
|
-
if (!(byteCount
|
|
730
|
+
if (!(compare(byteCount, new Long(0, 0)) >= 0)) {
|
|
722
731
|
var message_0 = 'byteCount (' + byteCount.toString() + ') < 0';
|
|
723
732
|
throw IllegalArgumentException_init_$Create$(toString(message_0));
|
|
724
733
|
}
|
|
725
734
|
// Inline function 'kotlin.check' call
|
|
726
|
-
if (!(this.
|
|
735
|
+
if (!(this.nr_1 == null || (this.nr_1 === this.mr_1.hp_1 && this.or_1 === ensureNotNull(this.mr_1.hp_1).qp_1))) {
|
|
727
736
|
var message_1 = 'Peek source is invalid because upstream source was used';
|
|
728
737
|
throw IllegalStateException_init_$Create$(toString(message_1));
|
|
729
738
|
}
|
|
730
|
-
if (byteCount
|
|
739
|
+
if (equalsLong(byteCount, new Long(0, 0)))
|
|
731
740
|
return new Long(0, 0);
|
|
732
741
|
// Inline function 'kotlin.Long.plus' call
|
|
733
|
-
var
|
|
734
|
-
|
|
742
|
+
var this_0 = this.qr_1;
|
|
743
|
+
var tmp$ret$7 = add(this_0, fromInt(1));
|
|
744
|
+
if (!this.lr_1.np(tmp$ret$7))
|
|
735
745
|
return new Long(-1, -1);
|
|
736
|
-
if (this.
|
|
737
|
-
this.
|
|
738
|
-
this.
|
|
746
|
+
if (this.nr_1 == null && !(this.mr_1.hp_1 == null)) {
|
|
747
|
+
this.nr_1 = this.mr_1.hp_1;
|
|
748
|
+
this.or_1 = ensureNotNull(this.mr_1.hp_1).qp_1;
|
|
739
749
|
}
|
|
740
750
|
// Inline function 'kotlin.comparisons.minOf' call
|
|
741
|
-
var b = this.
|
|
742
|
-
var toCopy = byteCount
|
|
743
|
-
this.
|
|
744
|
-
this.
|
|
751
|
+
var b = subtract(this.mr_1.u(), this.qr_1);
|
|
752
|
+
var toCopy = compare(byteCount, b) <= 0 ? byteCount : b;
|
|
753
|
+
this.mr_1.bq(sink, this.qr_1, add(this.qr_1, toCopy));
|
|
754
|
+
this.qr_1 = add(this.qr_1, toCopy);
|
|
745
755
|
return toCopy;
|
|
746
756
|
};
|
|
747
|
-
protoOf(PeekSource).
|
|
748
|
-
this.
|
|
757
|
+
protoOf(PeekSource).b4 = function () {
|
|
758
|
+
this.pr_1 = true;
|
|
749
759
|
};
|
|
750
760
|
function RealSource(source) {
|
|
751
|
-
this.
|
|
752
|
-
this.
|
|
753
|
-
this.
|
|
761
|
+
this.rr_1 = source;
|
|
762
|
+
this.sr_1 = false;
|
|
763
|
+
this.tr_1 = new Buffer();
|
|
754
764
|
}
|
|
755
|
-
protoOf(RealSource).
|
|
756
|
-
return this.
|
|
765
|
+
protoOf(RealSource).kp = function () {
|
|
766
|
+
return this.tr_1;
|
|
757
767
|
};
|
|
758
|
-
protoOf(RealSource).
|
|
768
|
+
protoOf(RealSource).lq = function (sink, byteCount) {
|
|
759
769
|
// Inline function 'kotlinx.io.RealSource.checkNotClosed' call
|
|
760
770
|
// Inline function 'kotlin.check' call
|
|
761
|
-
if (!!this.
|
|
771
|
+
if (!!this.sr_1) {
|
|
762
772
|
var message = 'Source is closed.';
|
|
763
773
|
throw IllegalStateException_init_$Create$(toString(message));
|
|
764
774
|
}
|
|
765
775
|
// Inline function 'kotlin.require' call
|
|
766
|
-
if (!(byteCount
|
|
776
|
+
if (!(compare(byteCount, new Long(0, 0)) >= 0)) {
|
|
767
777
|
var message_0 = 'byteCount: ' + byteCount.toString();
|
|
768
778
|
throw IllegalArgumentException_init_$Create$(toString(message_0));
|
|
769
779
|
}
|
|
770
|
-
if (this.
|
|
771
|
-
var read = this.
|
|
772
|
-
if (read
|
|
780
|
+
if (equalsLong(this.tr_1.u(), new Long(0, 0))) {
|
|
781
|
+
var read = this.rr_1.lq(this.tr_1, new Long(8192, 0));
|
|
782
|
+
if (equalsLong(read, new Long(-1, -1)))
|
|
773
783
|
return new Long(-1, -1);
|
|
774
784
|
}
|
|
775
785
|
// Inline function 'kotlin.comparisons.minOf' call
|
|
776
|
-
var b = this.
|
|
777
|
-
var toRead = byteCount
|
|
778
|
-
return this.
|
|
786
|
+
var b = this.tr_1.u();
|
|
787
|
+
var toRead = compare(byteCount, b) <= 0 ? byteCount : b;
|
|
788
|
+
return this.tr_1.lq(sink, toRead);
|
|
779
789
|
};
|
|
780
|
-
protoOf(RealSource).
|
|
790
|
+
protoOf(RealSource).lp = function () {
|
|
781
791
|
// Inline function 'kotlinx.io.RealSource.checkNotClosed' call
|
|
782
792
|
// Inline function 'kotlin.check' call
|
|
783
|
-
if (!!this.
|
|
793
|
+
if (!!this.sr_1) {
|
|
784
794
|
var message = 'Source is closed.';
|
|
785
795
|
throw IllegalStateException_init_$Create$(toString(message));
|
|
786
796
|
}
|
|
787
|
-
return this.
|
|
797
|
+
return this.tr_1.lp() && equalsLong(this.rr_1.lq(this.tr_1, new Long(8192, 0)), new Long(-1, -1));
|
|
788
798
|
};
|
|
789
|
-
protoOf(RealSource).
|
|
790
|
-
if (!this.
|
|
799
|
+
protoOf(RealSource).mp = function (byteCount) {
|
|
800
|
+
if (!this.np(byteCount))
|
|
791
801
|
throw EOFException_init_$Create$_0("Source doesn't contain required number of bytes (" + byteCount.toString() + ').');
|
|
792
802
|
};
|
|
793
|
-
protoOf(RealSource).
|
|
803
|
+
protoOf(RealSource).np = function (byteCount) {
|
|
794
804
|
// Inline function 'kotlinx.io.RealSource.checkNotClosed' call
|
|
795
805
|
// Inline function 'kotlin.check' call
|
|
796
|
-
if (!!this.
|
|
806
|
+
if (!!this.sr_1) {
|
|
797
807
|
var message = 'Source is closed.';
|
|
798
808
|
throw IllegalStateException_init_$Create$(toString(message));
|
|
799
809
|
}
|
|
800
810
|
// Inline function 'kotlin.require' call
|
|
801
|
-
if (!(byteCount
|
|
811
|
+
if (!(compare(byteCount, new Long(0, 0)) >= 0)) {
|
|
802
812
|
var message_0 = 'byteCount: ' + byteCount.toString();
|
|
803
813
|
throw IllegalArgumentException_init_$Create$(toString(message_0));
|
|
804
814
|
}
|
|
805
|
-
while (this.
|
|
806
|
-
if (this.
|
|
815
|
+
while (compare(this.tr_1.u(), byteCount) < 0) {
|
|
816
|
+
if (equalsLong(this.rr_1.lq(this.tr_1, new Long(8192, 0)), new Long(-1, -1)))
|
|
807
817
|
return false;
|
|
808
818
|
}
|
|
809
819
|
return true;
|
|
810
820
|
};
|
|
811
|
-
protoOf(RealSource).
|
|
812
|
-
this.
|
|
813
|
-
return this.
|
|
821
|
+
protoOf(RealSource).op = function () {
|
|
822
|
+
this.mp(new Long(1, 0));
|
|
823
|
+
return this.tr_1.op();
|
|
814
824
|
};
|
|
815
|
-
protoOf(RealSource).
|
|
825
|
+
protoOf(RealSource).jq = function (sink, startIndex, endIndex) {
|
|
816
826
|
// Inline function 'kotlinx.io.checkBounds' call
|
|
817
827
|
var size = sink.length;
|
|
818
|
-
checkBounds(
|
|
819
|
-
if (this.
|
|
820
|
-
var read = this.
|
|
821
|
-
if (read
|
|
828
|
+
checkBounds(fromInt(size), fromInt(startIndex), fromInt(endIndex));
|
|
829
|
+
if (equalsLong(this.tr_1.u(), new Long(0, 0))) {
|
|
830
|
+
var read = this.rr_1.lq(this.tr_1, new Long(8192, 0));
|
|
831
|
+
if (equalsLong(read, new Long(-1, -1)))
|
|
822
832
|
return -1;
|
|
823
833
|
}
|
|
824
834
|
var tmp0 = endIndex - startIndex | 0;
|
|
825
835
|
// Inline function 'kotlinx.io.minOf' call
|
|
826
|
-
var b = this.
|
|
836
|
+
var b = this.tr_1.u();
|
|
827
837
|
// Inline function 'kotlin.comparisons.minOf' call
|
|
828
|
-
var a =
|
|
829
|
-
var
|
|
830
|
-
|
|
838
|
+
var a = fromInt(tmp0);
|
|
839
|
+
var tmp$ret$2 = compare(a, b) <= 0 ? a : b;
|
|
840
|
+
var toRead = convertToInt(tmp$ret$2);
|
|
841
|
+
return this.tr_1.jq(sink, startIndex, startIndex + toRead | 0);
|
|
831
842
|
};
|
|
832
|
-
protoOf(RealSource).
|
|
843
|
+
protoOf(RealSource).nq = function (sink, byteCount) {
|
|
833
844
|
try {
|
|
834
|
-
this.
|
|
845
|
+
this.mp(byteCount);
|
|
835
846
|
} catch ($p) {
|
|
836
847
|
if ($p instanceof EOFException) {
|
|
837
848
|
var e = $p;
|
|
838
|
-
sink.
|
|
849
|
+
sink.mq(this.tr_1, this.tr_1.u());
|
|
839
850
|
throw e;
|
|
840
851
|
} else {
|
|
841
852
|
throw $p;
|
|
842
853
|
}
|
|
843
854
|
}
|
|
844
|
-
this.
|
|
855
|
+
this.tr_1.nq(sink, byteCount);
|
|
845
856
|
};
|
|
846
|
-
protoOf(RealSource).
|
|
857
|
+
protoOf(RealSource).oq = function (sink) {
|
|
847
858
|
var totalBytesWritten = new Long(0, 0);
|
|
848
|
-
while (!this.
|
|
849
|
-
var emitByteCount = this.
|
|
850
|
-
if (emitByteCount
|
|
851
|
-
totalBytesWritten = totalBytesWritten
|
|
852
|
-
sink.
|
|
859
|
+
while (!equalsLong(this.rr_1.lq(this.tr_1, new Long(8192, 0)), new Long(-1, -1))) {
|
|
860
|
+
var emitByteCount = this.tr_1.fq();
|
|
861
|
+
if (compare(emitByteCount, new Long(0, 0)) > 0) {
|
|
862
|
+
totalBytesWritten = add(totalBytesWritten, emitByteCount);
|
|
863
|
+
sink.mq(this.tr_1, emitByteCount);
|
|
853
864
|
}
|
|
854
865
|
}
|
|
855
|
-
if (this.
|
|
856
|
-
totalBytesWritten = totalBytesWritten
|
|
857
|
-
sink.
|
|
866
|
+
if (compare(this.tr_1.u(), new Long(0, 0)) > 0) {
|
|
867
|
+
totalBytesWritten = add(totalBytesWritten, this.tr_1.u());
|
|
868
|
+
sink.mq(this.tr_1, this.tr_1.u());
|
|
858
869
|
}
|
|
859
870
|
return totalBytesWritten;
|
|
860
871
|
};
|
|
861
|
-
protoOf(RealSource).
|
|
862
|
-
this.
|
|
863
|
-
return this.
|
|
872
|
+
protoOf(RealSource).yp = function () {
|
|
873
|
+
this.mp(new Long(2, 0));
|
|
874
|
+
return this.tr_1.yp();
|
|
864
875
|
};
|
|
865
|
-
protoOf(RealSource).
|
|
876
|
+
protoOf(RealSource).pq = function () {
|
|
866
877
|
// Inline function 'kotlinx.io.RealSource.checkNotClosed' call
|
|
867
878
|
// Inline function 'kotlin.check' call
|
|
868
|
-
if (!!this.
|
|
879
|
+
if (!!this.sr_1) {
|
|
869
880
|
var message = 'Source is closed.';
|
|
870
881
|
throw IllegalStateException_init_$Create$(toString(message));
|
|
871
882
|
}
|
|
872
883
|
return buffered(new PeekSource(this));
|
|
873
884
|
};
|
|
874
|
-
protoOf(RealSource).
|
|
875
|
-
if (this.
|
|
885
|
+
protoOf(RealSource).b4 = function () {
|
|
886
|
+
if (this.sr_1)
|
|
876
887
|
return Unit_instance;
|
|
877
|
-
this.
|
|
878
|
-
this.
|
|
879
|
-
this.
|
|
888
|
+
this.sr_1 = true;
|
|
889
|
+
this.rr_1.b4();
|
|
890
|
+
this.tr_1.b2();
|
|
880
891
|
};
|
|
881
892
|
protoOf(RealSource).toString = function () {
|
|
882
|
-
return 'buffered(' + toString(this.
|
|
893
|
+
return 'buffered(' + toString(this.rr_1) + ')';
|
|
883
894
|
};
|
|
884
895
|
function Segment_init_$Init$($this) {
|
|
885
896
|
Segment.call($this);
|
|
886
|
-
$this.
|
|
887
|
-
$this.
|
|
888
|
-
$this.
|
|
897
|
+
$this.pp_1 = new Int8Array(8192);
|
|
898
|
+
$this.tp_1 = true;
|
|
899
|
+
$this.sp_1 = null;
|
|
889
900
|
return $this;
|
|
890
901
|
}
|
|
891
902
|
function Segment_init_$Create$() {
|
|
@@ -893,87 +904,87 @@
|
|
|
893
904
|
}
|
|
894
905
|
function Segment_init_$Init$_0(data, pos, limit, shareToken, owner, $this) {
|
|
895
906
|
Segment.call($this);
|
|
896
|
-
$this.
|
|
897
|
-
$this.
|
|
898
|
-
$this.
|
|
899
|
-
$this.
|
|
900
|
-
$this.
|
|
907
|
+
$this.pp_1 = data;
|
|
908
|
+
$this.qp_1 = pos;
|
|
909
|
+
$this.rp_1 = limit;
|
|
910
|
+
$this.sp_1 = shareToken;
|
|
911
|
+
$this.tp_1 = owner;
|
|
901
912
|
return $this;
|
|
902
913
|
}
|
|
903
914
|
function Segment_init_$Create$_0(data, pos, limit, shareToken, owner) {
|
|
904
915
|
return Segment_init_$Init$_0(data, pos, limit, shareToken, owner, objectCreate(protoOf(Segment)));
|
|
905
916
|
}
|
|
906
917
|
function Companion() {
|
|
907
|
-
this.
|
|
908
|
-
this.
|
|
918
|
+
this.ur_1 = 8192;
|
|
919
|
+
this.vr_1 = 1024;
|
|
909
920
|
}
|
|
910
|
-
protoOf(Companion).
|
|
921
|
+
protoOf(Companion).wr = function () {
|
|
911
922
|
return Segment_init_$Create$();
|
|
912
923
|
};
|
|
913
924
|
var Companion_instance;
|
|
914
925
|
function Companion_getInstance() {
|
|
915
926
|
return Companion_instance;
|
|
916
927
|
}
|
|
917
|
-
protoOf(Segment).
|
|
918
|
-
var tmp0_safe_receiver = this.
|
|
919
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
928
|
+
protoOf(Segment).zq = function () {
|
|
929
|
+
var tmp0_safe_receiver = this.sp_1;
|
|
930
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.xr();
|
|
920
931
|
return tmp1_elvis_lhs == null ? false : tmp1_elvis_lhs;
|
|
921
932
|
};
|
|
922
|
-
protoOf(Segment).
|
|
923
|
-
var tmp0_elvis_lhs = this.
|
|
933
|
+
protoOf(Segment).cq = function () {
|
|
934
|
+
var tmp0_elvis_lhs = this.sp_1;
|
|
924
935
|
var tmp;
|
|
925
936
|
if (tmp0_elvis_lhs == null) {
|
|
926
937
|
// Inline function 'kotlin.also' call
|
|
927
|
-
var this_0 = SegmentPool_instance.
|
|
928
|
-
this.
|
|
938
|
+
var this_0 = SegmentPool_instance.yr();
|
|
939
|
+
this.sp_1 = this_0;
|
|
929
940
|
tmp = this_0;
|
|
930
941
|
} else {
|
|
931
942
|
tmp = tmp0_elvis_lhs;
|
|
932
943
|
}
|
|
933
944
|
var t = tmp;
|
|
934
|
-
var tmp_0 = this.
|
|
935
|
-
var tmp_1 = this.
|
|
945
|
+
var tmp_0 = this.qp_1;
|
|
946
|
+
var tmp_1 = this.rp_1;
|
|
936
947
|
// Inline function 'kotlin.also' call
|
|
937
|
-
t.
|
|
938
|
-
return Segment_init_$Create$_0(this.
|
|
948
|
+
t.zr();
|
|
949
|
+
return Segment_init_$Create$_0(this.pp_1, tmp_0, tmp_1, t, false);
|
|
939
950
|
};
|
|
940
|
-
protoOf(Segment).
|
|
941
|
-
var result = this.
|
|
942
|
-
if (!(this.
|
|
943
|
-
ensureNotNull(this.
|
|
951
|
+
protoOf(Segment).cr = function () {
|
|
952
|
+
var result = this.up_1;
|
|
953
|
+
if (!(this.vp_1 == null)) {
|
|
954
|
+
ensureNotNull(this.vp_1).up_1 = this.up_1;
|
|
944
955
|
}
|
|
945
|
-
if (!(this.
|
|
946
|
-
ensureNotNull(this.
|
|
956
|
+
if (!(this.up_1 == null)) {
|
|
957
|
+
ensureNotNull(this.up_1).vp_1 = this.vp_1;
|
|
947
958
|
}
|
|
948
|
-
this.
|
|
949
|
-
this.
|
|
959
|
+
this.up_1 = null;
|
|
960
|
+
this.vp_1 = null;
|
|
950
961
|
return result;
|
|
951
962
|
};
|
|
952
|
-
protoOf(Segment).
|
|
953
|
-
segment.
|
|
954
|
-
segment.
|
|
955
|
-
if (!(this.
|
|
956
|
-
ensureNotNull(this.
|
|
963
|
+
protoOf(Segment).dq = function (segment) {
|
|
964
|
+
segment.vp_1 = this;
|
|
965
|
+
segment.up_1 = this.up_1;
|
|
966
|
+
if (!(this.up_1 == null)) {
|
|
967
|
+
ensureNotNull(this.up_1).vp_1 = segment;
|
|
957
968
|
}
|
|
958
|
-
this.
|
|
969
|
+
this.up_1 = segment;
|
|
959
970
|
return segment;
|
|
960
971
|
};
|
|
961
|
-
protoOf(Segment).
|
|
972
|
+
protoOf(Segment).ar = function (byteCount) {
|
|
962
973
|
// Inline function 'kotlin.require' call
|
|
963
|
-
if (!(byteCount > 0 && byteCount <= (this.
|
|
974
|
+
if (!(byteCount > 0 && byteCount <= (this.rp_1 - this.qp_1 | 0))) {
|
|
964
975
|
var message = 'byteCount out of range';
|
|
965
976
|
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
966
977
|
}
|
|
967
978
|
var prefix;
|
|
968
979
|
if (byteCount >= 1024) {
|
|
969
|
-
prefix = this.
|
|
980
|
+
prefix = this.cq();
|
|
970
981
|
} else {
|
|
971
|
-
prefix = SegmentPool_instance.
|
|
972
|
-
var tmp0 = this.
|
|
973
|
-
var tmp2 = prefix.
|
|
974
|
-
var tmp4 = this.
|
|
982
|
+
prefix = SegmentPool_instance.tq();
|
|
983
|
+
var tmp0 = this.pp_1;
|
|
984
|
+
var tmp2 = prefix.pp_1;
|
|
985
|
+
var tmp4 = this.qp_1;
|
|
975
986
|
// Inline function 'kotlin.collections.copyInto' call
|
|
976
|
-
var endIndex = this.
|
|
987
|
+
var endIndex = this.qp_1 + byteCount | 0;
|
|
977
988
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
978
989
|
// Inline function 'kotlin.js.asDynamic' call
|
|
979
990
|
var tmp = tmp0;
|
|
@@ -981,62 +992,62 @@
|
|
|
981
992
|
// Inline function 'kotlin.js.asDynamic' call
|
|
982
993
|
arrayCopy(tmp, tmp2, 0, tmp4, endIndex);
|
|
983
994
|
}
|
|
984
|
-
prefix.
|
|
985
|
-
this.
|
|
986
|
-
if (!(this.
|
|
987
|
-
ensureNotNull(this.
|
|
995
|
+
prefix.rp_1 = prefix.qp_1 + byteCount | 0;
|
|
996
|
+
this.qp_1 = this.qp_1 + byteCount | 0;
|
|
997
|
+
if (!(this.vp_1 == null)) {
|
|
998
|
+
ensureNotNull(this.vp_1).dq(prefix);
|
|
988
999
|
} else {
|
|
989
|
-
prefix.
|
|
990
|
-
this.
|
|
1000
|
+
prefix.up_1 = this;
|
|
1001
|
+
this.vp_1 = prefix;
|
|
991
1002
|
}
|
|
992
1003
|
return prefix;
|
|
993
1004
|
};
|
|
994
|
-
protoOf(Segment).
|
|
1005
|
+
protoOf(Segment).eq = function () {
|
|
995
1006
|
// Inline function 'kotlin.check' call
|
|
996
|
-
if (!!(this.
|
|
1007
|
+
if (!!(this.vp_1 == null)) {
|
|
997
1008
|
var message = 'cannot compact';
|
|
998
1009
|
throw IllegalStateException_init_$Create$(toString(message));
|
|
999
1010
|
}
|
|
1000
|
-
if (!ensureNotNull(this.
|
|
1011
|
+
if (!ensureNotNull(this.vp_1).tp_1)
|
|
1001
1012
|
return this;
|
|
1002
|
-
var byteCount = this.
|
|
1003
|
-
var availableByteCount = (8192 - ensureNotNull(this.
|
|
1013
|
+
var byteCount = this.rp_1 - this.qp_1 | 0;
|
|
1014
|
+
var availableByteCount = (8192 - ensureNotNull(this.vp_1).rp_1 | 0) + (ensureNotNull(this.vp_1).zq() ? 0 : ensureNotNull(this.vp_1).qp_1) | 0;
|
|
1004
1015
|
if (byteCount > availableByteCount)
|
|
1005
1016
|
return this;
|
|
1006
|
-
var predecessor = this.
|
|
1007
|
-
this.
|
|
1008
|
-
var successor = this.
|
|
1017
|
+
var predecessor = this.vp_1;
|
|
1018
|
+
this.br(ensureNotNull(predecessor), byteCount);
|
|
1019
|
+
var successor = this.cr();
|
|
1009
1020
|
// Inline function 'kotlin.check' call
|
|
1010
1021
|
if (!(successor == null)) {
|
|
1011
1022
|
throw IllegalStateException_init_$Create$('Check failed.');
|
|
1012
1023
|
}
|
|
1013
|
-
SegmentPool_instance.
|
|
1024
|
+
SegmentPool_instance.jr(this);
|
|
1014
1025
|
return predecessor;
|
|
1015
1026
|
};
|
|
1016
|
-
protoOf(Segment).
|
|
1017
|
-
var _unary__edvuaz = this.
|
|
1018
|
-
this.
|
|
1019
|
-
this.
|
|
1027
|
+
protoOf(Segment).fr = function (byte) {
|
|
1028
|
+
var _unary__edvuaz = this.rp_1;
|
|
1029
|
+
this.rp_1 = _unary__edvuaz + 1 | 0;
|
|
1030
|
+
this.pp_1[_unary__edvuaz] = byte;
|
|
1020
1031
|
};
|
|
1021
|
-
protoOf(Segment).
|
|
1022
|
-
var data = this.
|
|
1023
|
-
var limit = this.
|
|
1032
|
+
protoOf(Segment).hr = function (short) {
|
|
1033
|
+
var data = this.pp_1;
|
|
1034
|
+
var limit = this.rp_1;
|
|
1024
1035
|
var _unary__edvuaz = limit;
|
|
1025
1036
|
limit = _unary__edvuaz + 1 | 0;
|
|
1026
1037
|
data[_unary__edvuaz] = toByte((short >>> 8 | 0) & 255);
|
|
1027
1038
|
var _unary__edvuaz_0 = limit;
|
|
1028
1039
|
limit = _unary__edvuaz_0 + 1 | 0;
|
|
1029
1040
|
data[_unary__edvuaz_0] = toByte(short & 255);
|
|
1030
|
-
this.
|
|
1041
|
+
this.rp_1 = limit;
|
|
1031
1042
|
};
|
|
1032
|
-
protoOf(Segment).
|
|
1033
|
-
var _unary__edvuaz = this.
|
|
1034
|
-
this.
|
|
1035
|
-
return this.
|
|
1043
|
+
protoOf(Segment).xp = function () {
|
|
1044
|
+
var _unary__edvuaz = this.qp_1;
|
|
1045
|
+
this.qp_1 = _unary__edvuaz + 1 | 0;
|
|
1046
|
+
return this.pp_1[_unary__edvuaz];
|
|
1036
1047
|
};
|
|
1037
|
-
protoOf(Segment).
|
|
1038
|
-
var data = this.
|
|
1039
|
-
var pos = this.
|
|
1048
|
+
protoOf(Segment).zp = function () {
|
|
1049
|
+
var data = this.pp_1;
|
|
1050
|
+
var pos = this.qp_1;
|
|
1040
1051
|
var _unary__edvuaz = pos;
|
|
1041
1052
|
pos = _unary__edvuaz + 1 | 0;
|
|
1042
1053
|
// Inline function 'kotlinx.io.and' call
|
|
@@ -1046,132 +1057,132 @@
|
|
|
1046
1057
|
// Inline function 'kotlinx.io.and' call
|
|
1047
1058
|
var tmp$ret$1 = data[_unary__edvuaz_0] & 255;
|
|
1048
1059
|
var s = toShort(tmp | tmp$ret$1);
|
|
1049
|
-
this.
|
|
1060
|
+
this.qp_1 = pos;
|
|
1050
1061
|
return s;
|
|
1051
1062
|
};
|
|
1052
|
-
protoOf(Segment).
|
|
1063
|
+
protoOf(Segment).br = function (sink, byteCount) {
|
|
1053
1064
|
// Inline function 'kotlin.check' call
|
|
1054
|
-
if (!sink.
|
|
1065
|
+
if (!sink.tp_1) {
|
|
1055
1066
|
var message = 'only owner can write';
|
|
1056
1067
|
throw IllegalStateException_init_$Create$(toString(message));
|
|
1057
1068
|
}
|
|
1058
|
-
if ((sink.
|
|
1059
|
-
if (sink.
|
|
1069
|
+
if ((sink.rp_1 + byteCount | 0) > 8192) {
|
|
1070
|
+
if (sink.zq())
|
|
1060
1071
|
throw IllegalArgumentException_init_$Create$_0();
|
|
1061
|
-
if (((sink.
|
|
1072
|
+
if (((sink.rp_1 + byteCount | 0) - sink.qp_1 | 0) > 8192)
|
|
1062
1073
|
throw IllegalArgumentException_init_$Create$_0();
|
|
1063
|
-
var tmp0 = sink.
|
|
1064
|
-
var tmp2 = sink.
|
|
1065
|
-
var tmp4 = sink.
|
|
1074
|
+
var tmp0 = sink.pp_1;
|
|
1075
|
+
var tmp2 = sink.pp_1;
|
|
1076
|
+
var tmp4 = sink.qp_1;
|
|
1066
1077
|
// Inline function 'kotlin.collections.copyInto' call
|
|
1067
|
-
var endIndex = sink.
|
|
1078
|
+
var endIndex = sink.rp_1;
|
|
1068
1079
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
1069
1080
|
// Inline function 'kotlin.js.asDynamic' call
|
|
1070
1081
|
var tmp = tmp0;
|
|
1071
1082
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
1072
1083
|
// Inline function 'kotlin.js.asDynamic' call
|
|
1073
1084
|
arrayCopy(tmp, tmp2, 0, tmp4, endIndex);
|
|
1074
|
-
sink.
|
|
1075
|
-
sink.
|
|
1085
|
+
sink.rp_1 = sink.rp_1 - sink.qp_1 | 0;
|
|
1086
|
+
sink.qp_1 = 0;
|
|
1076
1087
|
}
|
|
1077
|
-
var tmp0_0 = this.
|
|
1078
|
-
var tmp2_0 = sink.
|
|
1079
|
-
var tmp4_0 = sink.
|
|
1080
|
-
var tmp6 = this.
|
|
1088
|
+
var tmp0_0 = this.pp_1;
|
|
1089
|
+
var tmp2_0 = sink.pp_1;
|
|
1090
|
+
var tmp4_0 = sink.rp_1;
|
|
1091
|
+
var tmp6 = this.qp_1;
|
|
1081
1092
|
// Inline function 'kotlin.collections.copyInto' call
|
|
1082
|
-
var endIndex_0 = this.
|
|
1093
|
+
var endIndex_0 = this.qp_1 + byteCount | 0;
|
|
1083
1094
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
1084
1095
|
// Inline function 'kotlin.js.asDynamic' call
|
|
1085
1096
|
var tmp_0 = tmp0_0;
|
|
1086
1097
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
1087
1098
|
// Inline function 'kotlin.js.asDynamic' call
|
|
1088
1099
|
arrayCopy(tmp_0, tmp2_0, tmp4_0, tmp6, endIndex_0);
|
|
1089
|
-
sink.
|
|
1090
|
-
this.
|
|
1100
|
+
sink.rp_1 = sink.rp_1 + byteCount | 0;
|
|
1101
|
+
this.qp_1 = this.qp_1 + byteCount | 0;
|
|
1091
1102
|
};
|
|
1092
|
-
protoOf(Segment).
|
|
1103
|
+
protoOf(Segment).kq = function (dst, dstStartOffset, dstEndOffset) {
|
|
1093
1104
|
var len = dstEndOffset - dstStartOffset | 0;
|
|
1094
|
-
var tmp0 = this.
|
|
1095
|
-
var tmp6 = this.
|
|
1105
|
+
var tmp0 = this.pp_1;
|
|
1106
|
+
var tmp6 = this.qp_1;
|
|
1096
1107
|
// Inline function 'kotlin.collections.copyInto' call
|
|
1097
|
-
var endIndex = this.
|
|
1108
|
+
var endIndex = this.qp_1 + len | 0;
|
|
1098
1109
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
1099
1110
|
// Inline function 'kotlin.js.asDynamic' call
|
|
1100
1111
|
var tmp = tmp0;
|
|
1101
1112
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
1102
1113
|
// Inline function 'kotlin.js.asDynamic' call
|
|
1103
1114
|
arrayCopy(tmp, dst, dstStartOffset, tmp6, endIndex);
|
|
1104
|
-
this.
|
|
1115
|
+
this.qp_1 = this.qp_1 + len | 0;
|
|
1105
1116
|
};
|
|
1106
|
-
protoOf(Segment).
|
|
1107
|
-
var tmp2 = this.
|
|
1117
|
+
protoOf(Segment).wq = function (src, srcStartOffset, srcEndOffset) {
|
|
1118
|
+
var tmp2 = this.pp_1;
|
|
1108
1119
|
// Inline function 'kotlin.collections.copyInto' call
|
|
1109
|
-
var destinationOffset = this.
|
|
1120
|
+
var destinationOffset = this.rp_1;
|
|
1110
1121
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
1111
1122
|
// Inline function 'kotlin.js.asDynamic' call
|
|
1112
1123
|
var tmp = src;
|
|
1113
1124
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
1114
1125
|
// Inline function 'kotlin.js.asDynamic' call
|
|
1115
1126
|
arrayCopy(tmp, tmp2, destinationOffset, srcStartOffset, srcEndOffset);
|
|
1116
|
-
this.
|
|
1127
|
+
this.rp_1 = this.rp_1 + (srcEndOffset - srcStartOffset | 0) | 0;
|
|
1117
1128
|
};
|
|
1118
|
-
protoOf(Segment).
|
|
1119
|
-
return this.
|
|
1129
|
+
protoOf(Segment).u = function () {
|
|
1130
|
+
return this.rp_1 - this.qp_1 | 0;
|
|
1120
1131
|
};
|
|
1121
|
-
protoOf(Segment).
|
|
1122
|
-
return this.
|
|
1132
|
+
protoOf(Segment).vq = function () {
|
|
1133
|
+
return this.pp_1.length - this.rp_1 | 0;
|
|
1123
1134
|
};
|
|
1124
|
-
protoOf(Segment).
|
|
1125
|
-
return this.
|
|
1135
|
+
protoOf(Segment).as = function (readOnly) {
|
|
1136
|
+
return this.pp_1;
|
|
1126
1137
|
};
|
|
1127
|
-
protoOf(Segment).
|
|
1128
|
-
return this.
|
|
1138
|
+
protoOf(Segment).hq = function (index) {
|
|
1139
|
+
return this.pp_1[this.qp_1 + index | 0];
|
|
1129
1140
|
};
|
|
1130
|
-
protoOf(Segment).
|
|
1131
|
-
this.
|
|
1141
|
+
protoOf(Segment).bs = function (index, value) {
|
|
1142
|
+
this.pp_1[this.rp_1 + index | 0] = value;
|
|
1132
1143
|
};
|
|
1133
|
-
protoOf(Segment).
|
|
1134
|
-
var d = this.
|
|
1135
|
-
var l = this.
|
|
1144
|
+
protoOf(Segment).cs = function (index, b0, b1) {
|
|
1145
|
+
var d = this.pp_1;
|
|
1146
|
+
var l = this.rp_1;
|
|
1136
1147
|
d[l + index | 0] = b0;
|
|
1137
1148
|
d[(l + index | 0) + 1 | 0] = b1;
|
|
1138
1149
|
};
|
|
1139
|
-
protoOf(Segment).
|
|
1140
|
-
var d = this.
|
|
1141
|
-
var l = this.
|
|
1150
|
+
protoOf(Segment).ds = function (index, b0, b1, b2) {
|
|
1151
|
+
var d = this.pp_1;
|
|
1152
|
+
var l = this.rp_1;
|
|
1142
1153
|
d[l + index | 0] = b0;
|
|
1143
1154
|
d[(l + index | 0) + 1 | 0] = b1;
|
|
1144
1155
|
d[(l + index | 0) + 2 | 0] = b2;
|
|
1145
1156
|
};
|
|
1146
|
-
protoOf(Segment).
|
|
1147
|
-
var d = this.
|
|
1148
|
-
var l = this.
|
|
1157
|
+
protoOf(Segment).es = function (index, b0, b1, b2, b3) {
|
|
1158
|
+
var d = this.pp_1;
|
|
1159
|
+
var l = this.rp_1;
|
|
1149
1160
|
d[l + index | 0] = b0;
|
|
1150
1161
|
d[(l + index | 0) + 1 | 0] = b1;
|
|
1151
1162
|
d[(l + index | 0) + 2 | 0] = b2;
|
|
1152
1163
|
d[(l + index | 0) + 3 | 0] = b3;
|
|
1153
1164
|
};
|
|
1154
1165
|
function Segment() {
|
|
1155
|
-
this.
|
|
1156
|
-
this.
|
|
1157
|
-
this.
|
|
1158
|
-
this.
|
|
1159
|
-
this.
|
|
1160
|
-
this.
|
|
1161
|
-
}
|
|
1162
|
-
function SegmentCopyTracker() {
|
|
1166
|
+
this.qp_1 = 0;
|
|
1167
|
+
this.rp_1 = 0;
|
|
1168
|
+
this.sp_1 = null;
|
|
1169
|
+
this.tp_1 = false;
|
|
1170
|
+
this.up_1 = null;
|
|
1171
|
+
this.vp_1 = null;
|
|
1163
1172
|
}
|
|
1164
1173
|
function isEmpty(_this__u8e3s4) {
|
|
1165
|
-
return _this__u8e3s4.
|
|
1174
|
+
return _this__u8e3s4.u() === 0;
|
|
1175
|
+
}
|
|
1176
|
+
function SegmentCopyTracker() {
|
|
1166
1177
|
}
|
|
1167
1178
|
function AlwaysSharedCopyTracker() {
|
|
1168
1179
|
AlwaysSharedCopyTracker_instance = this;
|
|
1169
1180
|
SegmentCopyTracker.call(this);
|
|
1170
1181
|
}
|
|
1171
|
-
protoOf(AlwaysSharedCopyTracker).
|
|
1182
|
+
protoOf(AlwaysSharedCopyTracker).xr = function () {
|
|
1172
1183
|
return true;
|
|
1173
1184
|
};
|
|
1174
|
-
protoOf(AlwaysSharedCopyTracker).
|
|
1185
|
+
protoOf(AlwaysSharedCopyTracker).zr = function () {
|
|
1175
1186
|
return Unit_instance;
|
|
1176
1187
|
};
|
|
1177
1188
|
var AlwaysSharedCopyTracker_instance;
|
|
@@ -1182,17 +1193,17 @@
|
|
|
1182
1193
|
}
|
|
1183
1194
|
function indexOf_0(_this__u8e3s4, byte, startOffset, endOffset) {
|
|
1184
1195
|
// Inline function 'kotlin.require' call
|
|
1185
|
-
if (!(0 <= startOffset ? startOffset < _this__u8e3s4.
|
|
1196
|
+
if (!(0 <= startOffset ? startOffset < _this__u8e3s4.u() : false)) {
|
|
1186
1197
|
var message = '' + startOffset;
|
|
1187
1198
|
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
1188
1199
|
}
|
|
1189
1200
|
// Inline function 'kotlin.require' call
|
|
1190
|
-
if (!(startOffset <= endOffset ? endOffset <= _this__u8e3s4.
|
|
1201
|
+
if (!(startOffset <= endOffset ? endOffset <= _this__u8e3s4.u() : false)) {
|
|
1191
1202
|
var message_0 = '' + endOffset;
|
|
1192
1203
|
throw IllegalArgumentException_init_$Create$(toString(message_0));
|
|
1193
1204
|
}
|
|
1194
|
-
var p = _this__u8e3s4.
|
|
1195
|
-
var data = _this__u8e3s4.
|
|
1205
|
+
var p = _this__u8e3s4.qp_1;
|
|
1206
|
+
var data = _this__u8e3s4.as(true);
|
|
1196
1207
|
var inductionVariable = startOffset;
|
|
1197
1208
|
if (inductionVariable < endOffset)
|
|
1198
1209
|
do {
|
|
@@ -1214,57 +1225,21 @@
|
|
|
1214
1225
|
}
|
|
1215
1226
|
function readByteArray_0(_this__u8e3s4, byteCount) {
|
|
1216
1227
|
// Inline function 'kotlinx.io.checkByteCount' call
|
|
1217
|
-
var byteCount_0 =
|
|
1228
|
+
var byteCount_0 = fromInt(byteCount);
|
|
1218
1229
|
// Inline function 'kotlin.require' call
|
|
1219
|
-
if (!(byteCount_0
|
|
1230
|
+
if (!(compare(byteCount_0, new Long(0, 0)) >= 0)) {
|
|
1220
1231
|
var message = 'byteCount (' + byteCount_0.toString() + ') < 0';
|
|
1221
1232
|
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
1222
1233
|
}
|
|
1223
1234
|
return readByteArrayImpl(_this__u8e3s4, byteCount);
|
|
1224
1235
|
}
|
|
1225
|
-
function readByteArrayImpl(_this__u8e3s4, size) {
|
|
1226
|
-
var arraySize = size;
|
|
1227
|
-
if (size === -1) {
|
|
1228
|
-
var fetchSize = new Long(2147483647, 0);
|
|
1229
|
-
while (_this__u8e3s4.d1j().s().d1(new Long(2147483647, 0)) < 0 && _this__u8e3s4.g1j(fetchSize)) {
|
|
1230
|
-
// Inline function 'kotlin.Long.times' call
|
|
1231
|
-
fetchSize = fetchSize.e3(toLong(2));
|
|
1232
|
-
}
|
|
1233
|
-
// Inline function 'kotlin.check' call
|
|
1234
|
-
if (!(_this__u8e3s4.d1j().s().d1(new Long(2147483647, 0)) < 0)) {
|
|
1235
|
-
var message = "Can't create an array of size " + _this__u8e3s4.d1j().s().toString();
|
|
1236
|
-
throw IllegalStateException_init_$Create$(toString(message));
|
|
1237
|
-
}
|
|
1238
|
-
arraySize = _this__u8e3s4.d1j().s().i1();
|
|
1239
|
-
} else {
|
|
1240
|
-
_this__u8e3s4.f1j(toLong(size));
|
|
1241
|
-
}
|
|
1242
|
-
var array = new Int8Array(arraySize);
|
|
1243
|
-
readTo(_this__u8e3s4.d1j(), array);
|
|
1244
|
-
return array;
|
|
1245
|
-
}
|
|
1246
|
-
function readTo(_this__u8e3s4, sink, startIndex, endIndex) {
|
|
1247
|
-
startIndex = startIndex === VOID ? 0 : startIndex;
|
|
1248
|
-
endIndex = endIndex === VOID ? sink.length : endIndex;
|
|
1249
|
-
// Inline function 'kotlinx.io.checkBounds' call
|
|
1250
|
-
var size = sink.length;
|
|
1251
|
-
checkBounds(toLong(size), toLong(startIndex), toLong(endIndex));
|
|
1252
|
-
var offset = startIndex;
|
|
1253
|
-
while (offset < endIndex) {
|
|
1254
|
-
var bytesRead = _this__u8e3s4.c1k(sink, offset, endIndex);
|
|
1255
|
-
if (bytesRead === -1) {
|
|
1256
|
-
throw EOFException_init_$Create$_0('Source exhausted before reading ' + (endIndex - startIndex | 0) + ' bytes. ' + ('Only ' + bytesRead + ' bytes were read.'));
|
|
1257
|
-
}
|
|
1258
|
-
offset = offset + bytesRead | 0;
|
|
1259
|
-
}
|
|
1260
|
-
}
|
|
1261
1236
|
function indexOf_1(_this__u8e3s4, byte, startIndex, endIndex) {
|
|
1262
1237
|
startIndex = startIndex === VOID ? new Long(0, 0) : startIndex;
|
|
1263
1238
|
endIndex = endIndex === VOID ? new Long(-1, 2147483647) : endIndex;
|
|
1264
1239
|
// Inline function 'kotlin.require' call
|
|
1265
|
-
if (!((new Long(0, 0)
|
|
1240
|
+
if (!(compare(new Long(0, 0), startIndex) <= 0 ? compare(startIndex, endIndex) <= 0 : false)) {
|
|
1266
1241
|
var tmp;
|
|
1267
|
-
if (endIndex
|
|
1242
|
+
if (compare(endIndex, new Long(0, 0)) < 0) {
|
|
1268
1243
|
tmp = 'startIndex (' + startIndex.toString() + ') and endIndex (' + endIndex.toString() + ') should be non negative';
|
|
1269
1244
|
} else {
|
|
1270
1245
|
tmp = 'startIndex (' + startIndex.toString() + ') is not within the range [0..endIndex(' + endIndex.toString() + '))';
|
|
@@ -1272,80 +1247,92 @@
|
|
|
1272
1247
|
var message = tmp;
|
|
1273
1248
|
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
1274
1249
|
}
|
|
1275
|
-
if (startIndex
|
|
1250
|
+
if (equalsLong(startIndex, endIndex))
|
|
1276
1251
|
return new Long(-1, -1);
|
|
1277
1252
|
var offset = startIndex;
|
|
1278
1253
|
$l$loop: while (true) {
|
|
1279
1254
|
var tmp_0;
|
|
1280
|
-
if (offset
|
|
1255
|
+
if (compare(offset, endIndex) < 0) {
|
|
1281
1256
|
// Inline function 'kotlin.Long.plus' call
|
|
1282
|
-
var
|
|
1283
|
-
|
|
1257
|
+
var this_0 = offset;
|
|
1258
|
+
var tmp$ret$2 = add(this_0, fromInt(1));
|
|
1259
|
+
tmp_0 = _this__u8e3s4.np(tmp$ret$2);
|
|
1284
1260
|
} else {
|
|
1285
1261
|
tmp_0 = false;
|
|
1286
1262
|
}
|
|
1287
1263
|
if (!tmp_0) {
|
|
1288
1264
|
break $l$loop;
|
|
1289
1265
|
}
|
|
1290
|
-
var tmp_1 = _this__u8e3s4.
|
|
1266
|
+
var tmp_1 = _this__u8e3s4.kp();
|
|
1291
1267
|
var tmp_2 = offset;
|
|
1292
1268
|
// Inline function 'kotlin.comparisons.minOf' call
|
|
1293
|
-
var b = _this__u8e3s4.
|
|
1294
|
-
var tmp$ret$3 = endIndex
|
|
1269
|
+
var b = _this__u8e3s4.kp().u();
|
|
1270
|
+
var tmp$ret$3 = compare(endIndex, b) <= 0 ? endIndex : b;
|
|
1295
1271
|
var idx = indexOf(tmp_1, byte, tmp_2, tmp$ret$3);
|
|
1296
|
-
if (!idx
|
|
1272
|
+
if (!equalsLong(idx, new Long(-1, -1))) {
|
|
1297
1273
|
return idx;
|
|
1298
1274
|
}
|
|
1299
|
-
offset = _this__u8e3s4.
|
|
1275
|
+
offset = _this__u8e3s4.kp().u();
|
|
1300
1276
|
}
|
|
1301
1277
|
return new Long(-1, -1);
|
|
1302
1278
|
}
|
|
1303
|
-
function
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1279
|
+
function readByteArrayImpl(_this__u8e3s4, size) {
|
|
1280
|
+
var arraySize = size;
|
|
1281
|
+
if (size === -1) {
|
|
1282
|
+
var fetchSize = new Long(2147483647, 0);
|
|
1283
|
+
while (compare(_this__u8e3s4.kp().u(), new Long(2147483647, 0)) < 0 && _this__u8e3s4.np(fetchSize)) {
|
|
1284
|
+
// Inline function 'kotlin.Long.times' call
|
|
1285
|
+
var this_0 = fetchSize;
|
|
1286
|
+
fetchSize = multiply(this_0, fromInt(2));
|
|
1287
|
+
}
|
|
1288
|
+
// Inline function 'kotlin.check' call
|
|
1289
|
+
if (!(compare(_this__u8e3s4.kp().u(), new Long(2147483647, 0)) < 0)) {
|
|
1290
|
+
var message = "Can't create an array of size " + _this__u8e3s4.kp().u().toString();
|
|
1291
|
+
throw IllegalStateException_init_$Create$(toString(message));
|
|
1292
|
+
}
|
|
1293
|
+
arraySize = convertToInt(_this__u8e3s4.kp().u());
|
|
1294
|
+
} else {
|
|
1295
|
+
_this__u8e3s4.mp(fromInt(size));
|
|
1296
|
+
}
|
|
1297
|
+
var array = new Int8Array(arraySize);
|
|
1298
|
+
readTo(_this__u8e3s4.kp(), array);
|
|
1299
|
+
return array;
|
|
1313
1300
|
}
|
|
1314
|
-
function
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
// Inline function 'kotlinx.io.
|
|
1318
|
-
var
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
var tmp2 = curr.j1j_1;
|
|
1326
|
-
var tmp0_0 = curr.k1j_1;
|
|
1327
|
-
// Inline function 'kotlin.math.min' call
|
|
1328
|
-
var b = tmp2 + byteCount.i1() | 0;
|
|
1329
|
-
var tmp$ret$0 = Math.min(tmp0_0, b);
|
|
1330
|
-
result = commonToUtf8String(tmp0, tmp2, tmp$ret$0);
|
|
1331
|
-
_this__u8e3s4.b1k(byteCount);
|
|
1332
|
-
return result;
|
|
1301
|
+
function readTo(_this__u8e3s4, sink, startIndex, endIndex) {
|
|
1302
|
+
startIndex = startIndex === VOID ? 0 : startIndex;
|
|
1303
|
+
endIndex = endIndex === VOID ? sink.length : endIndex;
|
|
1304
|
+
// Inline function 'kotlinx.io.checkBounds' call
|
|
1305
|
+
var size = sink.length;
|
|
1306
|
+
checkBounds(fromInt(size), fromInt(startIndex), fromInt(endIndex));
|
|
1307
|
+
var offset = startIndex;
|
|
1308
|
+
while (offset < endIndex) {
|
|
1309
|
+
var bytesRead = _this__u8e3s4.jq(sink, offset, endIndex);
|
|
1310
|
+
if (bytesRead === -1) {
|
|
1311
|
+
throw EOFException_init_$Create$_0('Source exhausted before reading ' + (endIndex - startIndex | 0) + ' bytes. ' + ('Only ' + bytesRead + ' bytes were read.'));
|
|
1333
1312
|
}
|
|
1334
|
-
|
|
1313
|
+
offset = offset + bytesRead | 0;
|
|
1335
1314
|
}
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1315
|
+
}
|
|
1316
|
+
function readString(_this__u8e3s4) {
|
|
1317
|
+
return commonReadUtf8(_this__u8e3s4, _this__u8e3s4.u());
|
|
1318
|
+
}
|
|
1319
|
+
function readString_0(_this__u8e3s4) {
|
|
1320
|
+
_this__u8e3s4.np(new Long(-1, 2147483647));
|
|
1321
|
+
return commonReadUtf8(_this__u8e3s4.kp(), _this__u8e3s4.kp().u());
|
|
1322
|
+
}
|
|
1323
|
+
function readString_1(_this__u8e3s4, byteCount) {
|
|
1324
|
+
_this__u8e3s4.mp(byteCount);
|
|
1325
|
+
return commonReadUtf8(_this__u8e3s4.kp(), byteCount);
|
|
1339
1326
|
}
|
|
1340
1327
|
function writeString(_this__u8e3s4, string, startIndex, endIndex) {
|
|
1341
1328
|
startIndex = startIndex === VOID ? 0 : startIndex;
|
|
1342
1329
|
endIndex = endIndex === VOID ? string.length : endIndex;
|
|
1343
1330
|
// Inline function 'kotlinx.io.checkBounds' call
|
|
1344
1331
|
var size = string.length;
|
|
1345
|
-
checkBounds(
|
|
1332
|
+
checkBounds(fromInt(size), fromInt(startIndex), fromInt(endIndex));
|
|
1346
1333
|
// Inline function 'kotlinx.io.writeToInternalBuffer' call
|
|
1347
1334
|
// Inline function 'kotlinx.io.commonWriteUtf8' call
|
|
1348
|
-
var this_0 = _this__u8e3s4.
|
|
1335
|
+
var this_0 = _this__u8e3s4.kp();
|
|
1349
1336
|
var i = startIndex;
|
|
1350
1337
|
while (i < endIndex) {
|
|
1351
1338
|
var p0 = i;
|
|
@@ -1355,15 +1342,15 @@
|
|
|
1355
1342
|
if (c < 128) {
|
|
1356
1343
|
$l$block_0: {
|
|
1357
1344
|
// Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.writeToTail' call
|
|
1358
|
-
var tail = this_0.
|
|
1345
|
+
var tail = this_0.qq(1);
|
|
1359
1346
|
var ctx = get_SegmentWriteContextImpl();
|
|
1360
1347
|
var segmentOffset = -i | 0;
|
|
1361
1348
|
// Inline function 'kotlin.comparisons.minOf' call
|
|
1362
|
-
var b = i + tail.
|
|
1349
|
+
var b = i + tail.vq() | 0;
|
|
1363
1350
|
var runLimit = Math.min(endIndex, b);
|
|
1364
1351
|
var _unary__edvuaz = i;
|
|
1365
1352
|
i = _unary__edvuaz + 1 | 0;
|
|
1366
|
-
ctx.
|
|
1353
|
+
ctx.is(tail, segmentOffset + _unary__edvuaz | 0, toByte(c));
|
|
1367
1354
|
$l$loop: while (i < runLimit) {
|
|
1368
1355
|
var p0_0 = i;
|
|
1369
1356
|
// Inline function 'kotlin.code' call
|
|
@@ -1373,89 +1360,95 @@
|
|
|
1373
1360
|
break $l$loop;
|
|
1374
1361
|
var _unary__edvuaz_0 = i;
|
|
1375
1362
|
i = _unary__edvuaz_0 + 1 | 0;
|
|
1376
|
-
ctx.
|
|
1363
|
+
ctx.is(tail, segmentOffset + _unary__edvuaz_0 | 0, toByte(c));
|
|
1377
1364
|
}
|
|
1378
1365
|
var bytesWritten = i + segmentOffset | 0;
|
|
1379
1366
|
if (bytesWritten === 1) {
|
|
1380
|
-
tail.
|
|
1367
|
+
tail.rp_1 = tail.rp_1 + bytesWritten | 0;
|
|
1381
1368
|
var tmp = this_0;
|
|
1382
1369
|
// Inline function 'kotlin.Long.plus' call
|
|
1383
|
-
|
|
1370
|
+
var this_3 = this_0.jp_1;
|
|
1371
|
+
tmp.jp_1 = add(this_3, fromInt(bytesWritten));
|
|
1384
1372
|
break $l$block_0;
|
|
1385
1373
|
}
|
|
1386
1374
|
// Inline function 'kotlin.check' call
|
|
1387
|
-
if (!(0 <= bytesWritten ? bytesWritten <= tail.
|
|
1388
|
-
var message = 'Invalid number of bytes written: ' + bytesWritten + '. Should be in 0..' + tail.
|
|
1375
|
+
if (!(0 <= bytesWritten ? bytesWritten <= tail.vq() : false)) {
|
|
1376
|
+
var message = 'Invalid number of bytes written: ' + bytesWritten + '. Should be in 0..' + tail.vq();
|
|
1389
1377
|
throw IllegalStateException_init_$Create$(toString(message));
|
|
1390
1378
|
}
|
|
1391
1379
|
if (!(bytesWritten === 0)) {
|
|
1392
|
-
tail.
|
|
1380
|
+
tail.rp_1 = tail.rp_1 + bytesWritten | 0;
|
|
1393
1381
|
var tmp_0 = this_0;
|
|
1394
1382
|
// Inline function 'kotlin.Long.plus' call
|
|
1395
|
-
|
|
1383
|
+
var this_4 = this_0.jp_1;
|
|
1384
|
+
tmp_0.jp_1 = add(this_4, fromInt(bytesWritten));
|
|
1396
1385
|
break $l$block_0;
|
|
1397
1386
|
}
|
|
1398
1387
|
if (isEmpty(tail)) {
|
|
1399
|
-
this_0.
|
|
1388
|
+
this_0.kr();
|
|
1400
1389
|
}
|
|
1401
1390
|
}
|
|
1402
1391
|
} else if (c < 2048) {
|
|
1403
1392
|
$l$block_2: {
|
|
1404
1393
|
// Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.writeToTail' call
|
|
1405
|
-
var tail_0 = this_0.
|
|
1406
|
-
get_SegmentWriteContextImpl().
|
|
1394
|
+
var tail_0 = this_0.qq(2);
|
|
1395
|
+
get_SegmentWriteContextImpl().hs(tail_0, 0, toByte(c >> 6 | 192), toByte(c & 63 | 128));
|
|
1407
1396
|
var bytesWritten_0 = 2;
|
|
1408
1397
|
if (bytesWritten_0 === 2) {
|
|
1409
|
-
tail_0.
|
|
1398
|
+
tail_0.rp_1 = tail_0.rp_1 + bytesWritten_0 | 0;
|
|
1410
1399
|
var tmp_1 = this_0;
|
|
1411
1400
|
// Inline function 'kotlin.Long.plus' call
|
|
1412
|
-
|
|
1401
|
+
var this_5 = this_0.jp_1;
|
|
1402
|
+
tmp_1.jp_1 = add(this_5, fromInt(bytesWritten_0));
|
|
1413
1403
|
break $l$block_2;
|
|
1414
1404
|
}
|
|
1415
1405
|
// Inline function 'kotlin.check' call
|
|
1416
|
-
if (!(0 <= bytesWritten_0 ? bytesWritten_0 <= tail_0.
|
|
1417
|
-
var message_0 = 'Invalid number of bytes written: ' + bytesWritten_0 + '. Should be in 0..' + tail_0.
|
|
1406
|
+
if (!(0 <= bytesWritten_0 ? bytesWritten_0 <= tail_0.vq() : false)) {
|
|
1407
|
+
var message_0 = 'Invalid number of bytes written: ' + bytesWritten_0 + '. Should be in 0..' + tail_0.vq();
|
|
1418
1408
|
throw IllegalStateException_init_$Create$(toString(message_0));
|
|
1419
1409
|
}
|
|
1420
1410
|
if (!(bytesWritten_0 === 0)) {
|
|
1421
|
-
tail_0.
|
|
1411
|
+
tail_0.rp_1 = tail_0.rp_1 + bytesWritten_0 | 0;
|
|
1422
1412
|
var tmp_2 = this_0;
|
|
1423
1413
|
// Inline function 'kotlin.Long.plus' call
|
|
1424
|
-
|
|
1414
|
+
var this_6 = this_0.jp_1;
|
|
1415
|
+
tmp_2.jp_1 = add(this_6, fromInt(bytesWritten_0));
|
|
1425
1416
|
break $l$block_2;
|
|
1426
1417
|
}
|
|
1427
1418
|
if (isEmpty(tail_0)) {
|
|
1428
|
-
this_0.
|
|
1419
|
+
this_0.kr();
|
|
1429
1420
|
}
|
|
1430
1421
|
}
|
|
1431
1422
|
i = i + 1 | 0;
|
|
1432
1423
|
} else if (c < 55296 || c > 57343) {
|
|
1433
1424
|
$l$block_4: {
|
|
1434
1425
|
// Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.writeToTail' call
|
|
1435
|
-
var tail_1 = this_0.
|
|
1436
|
-
get_SegmentWriteContextImpl().
|
|
1426
|
+
var tail_1 = this_0.qq(3);
|
|
1427
|
+
get_SegmentWriteContextImpl().gs(tail_1, 0, toByte(c >> 12 | 224), toByte(c >> 6 & 63 | 128), toByte(c & 63 | 128));
|
|
1437
1428
|
var bytesWritten_1 = 3;
|
|
1438
1429
|
if (bytesWritten_1 === 3) {
|
|
1439
|
-
tail_1.
|
|
1430
|
+
tail_1.rp_1 = tail_1.rp_1 + bytesWritten_1 | 0;
|
|
1440
1431
|
var tmp_3 = this_0;
|
|
1441
1432
|
// Inline function 'kotlin.Long.plus' call
|
|
1442
|
-
|
|
1433
|
+
var this_7 = this_0.jp_1;
|
|
1434
|
+
tmp_3.jp_1 = add(this_7, fromInt(bytesWritten_1));
|
|
1443
1435
|
break $l$block_4;
|
|
1444
1436
|
}
|
|
1445
1437
|
// Inline function 'kotlin.check' call
|
|
1446
|
-
if (!(0 <= bytesWritten_1 ? bytesWritten_1 <= tail_1.
|
|
1447
|
-
var message_1 = 'Invalid number of bytes written: ' + bytesWritten_1 + '. Should be in 0..' + tail_1.
|
|
1438
|
+
if (!(0 <= bytesWritten_1 ? bytesWritten_1 <= tail_1.vq() : false)) {
|
|
1439
|
+
var message_1 = 'Invalid number of bytes written: ' + bytesWritten_1 + '. Should be in 0..' + tail_1.vq();
|
|
1448
1440
|
throw IllegalStateException_init_$Create$(toString(message_1));
|
|
1449
1441
|
}
|
|
1450
1442
|
if (!(bytesWritten_1 === 0)) {
|
|
1451
|
-
tail_1.
|
|
1443
|
+
tail_1.rp_1 = tail_1.rp_1 + bytesWritten_1 | 0;
|
|
1452
1444
|
var tmp_4 = this_0;
|
|
1453
1445
|
// Inline function 'kotlin.Long.plus' call
|
|
1454
|
-
|
|
1446
|
+
var this_8 = this_0.jp_1;
|
|
1447
|
+
tmp_4.jp_1 = add(this_8, fromInt(bytesWritten_1));
|
|
1455
1448
|
break $l$block_4;
|
|
1456
1449
|
}
|
|
1457
1450
|
if (isEmpty(tail_1)) {
|
|
1458
|
-
this_0.
|
|
1451
|
+
this_0.kr();
|
|
1459
1452
|
}
|
|
1460
1453
|
}
|
|
1461
1454
|
i = i + 1 | 0;
|
|
@@ -1464,53 +1457,81 @@
|
|
|
1464
1457
|
if ((i + 1 | 0) < endIndex) {
|
|
1465
1458
|
var p0_1 = i + 1 | 0;
|
|
1466
1459
|
// Inline function 'kotlin.code' call
|
|
1467
|
-
var
|
|
1468
|
-
tmp_5 = Char__toInt_impl_vasixd(
|
|
1460
|
+
var this_9 = charCodeAt(string, p0_1);
|
|
1461
|
+
tmp_5 = Char__toInt_impl_vasixd(this_9);
|
|
1469
1462
|
} else {
|
|
1470
1463
|
tmp_5 = 0;
|
|
1471
1464
|
}
|
|
1472
1465
|
var low = tmp_5;
|
|
1473
1466
|
if (c > 56319 || !(56320 <= low ? low <= 57343 : false)) {
|
|
1474
1467
|
// Inline function 'kotlin.code' call
|
|
1475
|
-
var
|
|
1476
|
-
var tmp$ret$26 = Char__toInt_impl_vasixd(
|
|
1477
|
-
this_0.
|
|
1468
|
+
var this_10 = _Char___init__impl__6a9atx(63);
|
|
1469
|
+
var tmp$ret$26 = Char__toInt_impl_vasixd(this_10);
|
|
1470
|
+
this_0.er(toByte(tmp$ret$26));
|
|
1478
1471
|
i = i + 1 | 0;
|
|
1479
1472
|
} else {
|
|
1480
1473
|
var codePoint = 65536 + ((c & 1023) << 10 | low & 1023) | 0;
|
|
1481
1474
|
$l$block_6: {
|
|
1482
1475
|
// Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.writeToTail' call
|
|
1483
|
-
var tail_2 = this_0.
|
|
1484
|
-
get_SegmentWriteContextImpl().
|
|
1476
|
+
var tail_2 = this_0.qq(4);
|
|
1477
|
+
get_SegmentWriteContextImpl().fs(tail_2, 0, toByte(codePoint >> 18 | 240), toByte(codePoint >> 12 & 63 | 128), toByte(codePoint >> 6 & 63 | 128), toByte(codePoint & 63 | 128));
|
|
1485
1478
|
var bytesWritten_2 = 4;
|
|
1486
1479
|
if (bytesWritten_2 === 4) {
|
|
1487
|
-
tail_2.
|
|
1480
|
+
tail_2.rp_1 = tail_2.rp_1 + bytesWritten_2 | 0;
|
|
1488
1481
|
var tmp_6 = this_0;
|
|
1489
1482
|
// Inline function 'kotlin.Long.plus' call
|
|
1490
|
-
|
|
1483
|
+
var this_11 = this_0.jp_1;
|
|
1484
|
+
tmp_6.jp_1 = add(this_11, fromInt(bytesWritten_2));
|
|
1491
1485
|
break $l$block_6;
|
|
1492
1486
|
}
|
|
1493
1487
|
// Inline function 'kotlin.check' call
|
|
1494
|
-
if (!(0 <= bytesWritten_2 ? bytesWritten_2 <= tail_2.
|
|
1495
|
-
var message_2 = 'Invalid number of bytes written: ' + bytesWritten_2 + '. Should be in 0..' + tail_2.
|
|
1488
|
+
if (!(0 <= bytesWritten_2 ? bytesWritten_2 <= tail_2.vq() : false)) {
|
|
1489
|
+
var message_2 = 'Invalid number of bytes written: ' + bytesWritten_2 + '. Should be in 0..' + tail_2.vq();
|
|
1496
1490
|
throw IllegalStateException_init_$Create$(toString(message_2));
|
|
1497
1491
|
}
|
|
1498
1492
|
if (!(bytesWritten_2 === 0)) {
|
|
1499
|
-
tail_2.
|
|
1493
|
+
tail_2.rp_1 = tail_2.rp_1 + bytesWritten_2 | 0;
|
|
1500
1494
|
var tmp_7 = this_0;
|
|
1501
1495
|
// Inline function 'kotlin.Long.plus' call
|
|
1502
|
-
|
|
1496
|
+
var this_12 = this_0.jp_1;
|
|
1497
|
+
tmp_7.jp_1 = add(this_12, fromInt(bytesWritten_2));
|
|
1503
1498
|
break $l$block_6;
|
|
1504
1499
|
}
|
|
1505
1500
|
if (isEmpty(tail_2)) {
|
|
1506
|
-
this_0.
|
|
1501
|
+
this_0.kr();
|
|
1507
1502
|
}
|
|
1508
1503
|
}
|
|
1509
1504
|
i = i + 2 | 0;
|
|
1510
1505
|
}
|
|
1511
1506
|
}
|
|
1512
1507
|
}
|
|
1513
|
-
_this__u8e3s4.
|
|
1508
|
+
_this__u8e3s4.aq();
|
|
1509
|
+
}
|
|
1510
|
+
function commonReadUtf8(_this__u8e3s4, byteCount) {
|
|
1511
|
+
if (equalsLong(byteCount, new Long(0, 0)))
|
|
1512
|
+
return '';
|
|
1513
|
+
// Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.forEachSegment' call
|
|
1514
|
+
var curr = _this__u8e3s4.hp_1;
|
|
1515
|
+
while (!(curr == null)) {
|
|
1516
|
+
get_SegmentReadContextImpl();
|
|
1517
|
+
if (compare(fromInt(curr.u()), byteCount) >= 0) {
|
|
1518
|
+
var result = '';
|
|
1519
|
+
// Inline function 'kotlinx.io.unsafe.withData' call
|
|
1520
|
+
var tmp0 = curr.as(true);
|
|
1521
|
+
var tmp2 = curr.qp_1;
|
|
1522
|
+
var tmp0_0 = curr.rp_1;
|
|
1523
|
+
// Inline function 'kotlin.math.min' call
|
|
1524
|
+
var b = tmp2 + convertToInt(byteCount) | 0;
|
|
1525
|
+
var tmp$ret$0 = Math.min(tmp0_0, b);
|
|
1526
|
+
result = commonToUtf8String(tmp0, tmp2, tmp$ret$0);
|
|
1527
|
+
_this__u8e3s4.iq(byteCount);
|
|
1528
|
+
return result;
|
|
1529
|
+
}
|
|
1530
|
+
return commonToUtf8String(readByteArray_0(_this__u8e3s4, convertToInt(byteCount)));
|
|
1531
|
+
}
|
|
1532
|
+
// Inline function 'kotlin.error' call
|
|
1533
|
+
var message = 'Unreacheable';
|
|
1534
|
+
throw IllegalStateException_init_$Create$(toString(message));
|
|
1514
1535
|
}
|
|
1515
1536
|
function commonToUtf8String(_this__u8e3s4, beginIndex, endIndex) {
|
|
1516
1537
|
beginIndex = beginIndex === VOID ? 0 : beginIndex;
|
|
@@ -1874,27 +1895,27 @@
|
|
|
1874
1895
|
}
|
|
1875
1896
|
function SegmentReadContextImpl$1() {
|
|
1876
1897
|
}
|
|
1877
|
-
protoOf(SegmentReadContextImpl$1).
|
|
1878
|
-
return segment.
|
|
1898
|
+
protoOf(SegmentReadContextImpl$1).ir = function (segment, offset) {
|
|
1899
|
+
return segment.hq(offset);
|
|
1879
1900
|
};
|
|
1880
1901
|
function SegmentWriteContextImpl$1() {
|
|
1881
1902
|
}
|
|
1882
|
-
protoOf(SegmentWriteContextImpl$1).
|
|
1883
|
-
segment.
|
|
1903
|
+
protoOf(SegmentWriteContextImpl$1).is = function (segment, offset, value) {
|
|
1904
|
+
segment.bs(offset, value);
|
|
1884
1905
|
};
|
|
1885
|
-
protoOf(SegmentWriteContextImpl$1).
|
|
1886
|
-
segment.
|
|
1906
|
+
protoOf(SegmentWriteContextImpl$1).hs = function (segment, offset, b0, b1) {
|
|
1907
|
+
segment.cs(offset, b0, b1);
|
|
1887
1908
|
};
|
|
1888
|
-
protoOf(SegmentWriteContextImpl$1).
|
|
1889
|
-
segment.
|
|
1909
|
+
protoOf(SegmentWriteContextImpl$1).gs = function (segment, offset, b0, b1, b2) {
|
|
1910
|
+
segment.ds(offset, b0, b1, b2);
|
|
1890
1911
|
};
|
|
1891
|
-
protoOf(SegmentWriteContextImpl$1).
|
|
1892
|
-
segment.
|
|
1912
|
+
protoOf(SegmentWriteContextImpl$1).fs = function (segment, offset, b0, b1, b2, b3) {
|
|
1913
|
+
segment.es(offset, b0, b1, b2, b3);
|
|
1893
1914
|
};
|
|
1894
1915
|
function BufferIterationContextImpl$1() {
|
|
1895
1916
|
}
|
|
1896
|
-
protoOf(BufferIterationContextImpl$1).
|
|
1897
|
-
return get_SegmentReadContextImpl().
|
|
1917
|
+
protoOf(BufferIterationContextImpl$1).ir = function (segment, offset) {
|
|
1918
|
+
return get_SegmentReadContextImpl().ir(segment, offset);
|
|
1898
1919
|
};
|
|
1899
1920
|
var properties_initialized_UnsafeBufferOperations_kt_2xfgoc;
|
|
1900
1921
|
function _init_properties_UnsafeBufferOperations_kt__xw75gy() {
|
|
@@ -1962,15 +1983,15 @@
|
|
|
1962
1983
|
captureStack(this, EOFException);
|
|
1963
1984
|
}
|
|
1964
1985
|
function SegmentPool() {
|
|
1965
|
-
this.
|
|
1966
|
-
this.
|
|
1986
|
+
this.rq_1 = 0;
|
|
1987
|
+
this.sq_1 = 0;
|
|
1967
1988
|
}
|
|
1968
|
-
protoOf(SegmentPool).
|
|
1969
|
-
return Companion_instance.
|
|
1989
|
+
protoOf(SegmentPool).tq = function () {
|
|
1990
|
+
return Companion_instance.wr();
|
|
1970
1991
|
};
|
|
1971
|
-
protoOf(SegmentPool).
|
|
1992
|
+
protoOf(SegmentPool).jr = function (segment) {
|
|
1972
1993
|
};
|
|
1973
|
-
protoOf(SegmentPool).
|
|
1994
|
+
protoOf(SegmentPool).yr = function () {
|
|
1974
1995
|
return AlwaysSharedCopyTracker_getInstance();
|
|
1975
1996
|
};
|
|
1976
1997
|
var SegmentPool_instance;
|
|
@@ -1978,7 +1999,7 @@
|
|
|
1978
1999
|
return SegmentPool_instance;
|
|
1979
2000
|
}
|
|
1980
2001
|
//region block: post-declaration
|
|
1981
|
-
protoOf(Buffer).
|
|
2002
|
+
protoOf(Buffer).xq = write$default;
|
|
1982
2003
|
//endregion
|
|
1983
2004
|
//region block: init
|
|
1984
2005
|
Companion_instance = new Companion();
|
|
@@ -1999,9 +2020,9 @@
|
|
|
1999
2020
|
_.$_$.j = readByteArray_0;
|
|
2000
2021
|
_.$_$.k = readByteArray;
|
|
2001
2022
|
_.$_$.l = readByteString;
|
|
2002
|
-
_.$_$.m =
|
|
2003
|
-
_.$_$.n =
|
|
2004
|
-
_.$_$.o =
|
|
2023
|
+
_.$_$.m = readString_0;
|
|
2024
|
+
_.$_$.n = readString_1;
|
|
2025
|
+
_.$_$.o = readString;
|
|
2005
2026
|
_.$_$.p = writeString;
|
|
2006
2027
|
//endregion
|
|
2007
2028
|
return _;
|