@attocash/cli 0.2.3 → 0.3.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/README.md +148 -7
- package/dist/application/app.d.ts +34 -3
- package/dist/application/app.js +138 -126
- package/dist/application/operations.d.ts +3 -0
- package/dist/application/operations.js +30 -8
- package/dist/cli/cli.d.ts +1 -0
- package/dist/cli/cli.js +101 -13
- package/dist/cli/onboarding.d.ts +13 -0
- package/dist/cli/onboarding.js +99 -2
- package/dist/cli/output.js +18 -2
- package/dist/doctor/profile.js +2 -1
- package/dist/internal-marketplace.d.ts +25 -0
- package/dist/internal-marketplace.js +50 -0
- package/dist/marketplace/approval-files.d.ts +3 -0
- package/dist/marketplace/approval-files.js +97 -0
- package/dist/marketplace/approval-preview.d.ts +2 -0
- package/dist/marketplace/approval-preview.js +86 -0
- package/dist/marketplace/proof-approval.d.ts +82 -0
- package/dist/marketplace/proof-approval.js +671 -0
- package/dist/marketplace/topups.d.ts +82 -0
- package/dist/marketplace/topups.js +485 -0
- package/dist/network/batching.d.ts +2 -0
- package/dist/network/batching.js +23 -0
- package/dist/network/entry.d.ts +2 -0
- package/dist/network/entry.js +35 -0
- package/dist/network/reader.d.ts +2 -0
- package/dist/network/reader.js +125 -37
- package/dist/spending/approval.d.ts +5 -0
- package/dist/spending/approval.js +2 -0
- package/dist/spending/atto-x402.d.ts +31 -0
- package/dist/spending/atto-x402.js +174 -0
- package/dist/spending/ledger.d.ts +74 -2
- package/dist/spending/ledger.js +298 -7
- package/dist/spending/payments.d.ts +105 -5
- package/dist/spending/payments.js +795 -11
- package/dist/storage/recovery-seed.d.ts +13 -0
- package/dist/storage/recovery-seed.js +93 -0
- package/dist/storage/state.d.ts +4 -0
- package/dist/storage/state.js +32 -2
- package/dist/wallet/receive.d.ts +39 -0
- package/dist/wallet/receive.js +264 -0
- package/dist/wallet/signing.d.ts +1 -0
- package/dist/wallet/signing.js +37 -21
- package/dist/wallet/types.d.ts +1 -0
- package/node_modules/@attocash/commons-core/Kotlin-DateTime-library-kotlinx-datetime.mjs +1922 -1918
- package/node_modules/@attocash/commons-core/Kotlin-DateTime-library-kotlinx-datetime.mjs.map +1 -1
- package/node_modules/@attocash/commons-core/README.md +9 -0
- package/node_modules/@attocash/commons-core/commons-commons-core.d.mts +10 -0
- package/node_modules/@attocash/commons-core/commons-commons-core.mjs +2543 -2434
- package/node_modules/@attocash/commons-core/commons-commons-core.mjs.map +1 -1
- package/node_modules/@attocash/commons-core/kotlin-kotlin-stdlib.mjs +4695 -4227
- package/node_modules/@attocash/commons-core/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/node_modules/@attocash/commons-core/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.mjs.map +1 -1
- package/node_modules/@attocash/commons-core/kotlinx-io-kotlinx-io-bytestring.mjs +60 -60
- package/node_modules/@attocash/commons-core/kotlinx-io-kotlinx-io-bytestring.mjs.map +1 -1
- package/node_modules/@attocash/commons-core/kotlinx-io-kotlinx-io-core.mjs +651 -631
- package/node_modules/@attocash/commons-core/kotlinx-io-kotlinx-io-core.mjs.map +1 -1
- package/node_modules/@attocash/commons-core/kotlinx-serialization-kotlinx-serialization-core.mjs +2294 -2295
- package/node_modules/@attocash/commons-core/kotlinx-serialization-kotlinx-serialization-core.mjs.map +1 -1
- package/node_modules/@attocash/commons-core/kotlinx-serialization-kotlinx-serialization-json.mjs +1732 -1701
- package/node_modules/@attocash/commons-core/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
- package/node_modules/@attocash/commons-core/package.json +1 -1
- package/node_modules/@attocash/commons-node/commons-commons-node.d.mts +1 -0
- package/node_modules/@attocash/commons-node/commons-commons-node.mjs +873 -847
- package/node_modules/@attocash/commons-node/commons-commons-node.mjs.map +1 -1
- package/node_modules/@attocash/commons-node/kotlin-logging.mjs +109 -109
- package/node_modules/@attocash/commons-node/kotlin-logging.mjs.map +1 -1
- package/node_modules/@attocash/commons-node/kotlinx-serialization-kotlinx-serialization-json.mjs +1732 -1701
- package/node_modules/@attocash/commons-node/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
- package/node_modules/@attocash/commons-node/package.json +3 -3
- package/node_modules/@attocash/commons-node-remote/commons-commons-node-remote.d.mts +1 -0
- package/node_modules/@attocash/commons-node-remote/commons-commons-node-remote.mjs +674 -640
- package/node_modules/@attocash/commons-node-remote/commons-commons-node-remote.mjs.map +1 -1
- package/node_modules/@attocash/commons-node-remote/kotlin-logging.mjs +109 -109
- package/node_modules/@attocash/commons-node-remote/kotlin-logging.mjs.map +1 -1
- package/node_modules/@attocash/commons-node-remote/kotlinx-browser.mjs.map +1 -1
- package/node_modules/@attocash/commons-node-remote/kotlinx-serialization-kotlinx-serialization-json-io.mjs.map +1 -1
- package/node_modules/@attocash/commons-node-remote/kotlinx-serialization-kotlinx-serialization-json.mjs +1732 -1701
- package/node_modules/@attocash/commons-node-remote/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
- package/node_modules/@attocash/commons-node-remote/package.json +4 -4
- package/node_modules/@attocash/commons-transport/commons-commons-transport.d.mts +1 -0
- package/node_modules/@attocash/commons-transport/commons-commons-transport.mjs +52 -51
- package/node_modules/@attocash/commons-transport/commons-commons-transport.mjs.map +1 -1
- package/node_modules/@attocash/commons-transport/kotlinx-atomicfu.mjs +13 -13
- package/node_modules/@attocash/commons-transport/kotlinx-atomicfu.mjs.map +1 -1
- package/node_modules/@attocash/commons-transport/kotlinx-browser.mjs.map +1 -1
- package/node_modules/@attocash/commons-transport/kotlinx-coroutines-core.mjs +2639 -2608
- package/node_modules/@attocash/commons-transport/kotlinx-coroutines-core.mjs.map +1 -1
- package/node_modules/@attocash/commons-transport/kotlinx-serialization-kotlinx-serialization-json-io.mjs.map +1 -1
- package/node_modules/@attocash/commons-transport/kotlinx-serialization-kotlinx-serialization-json.mjs +1732 -1701
- package/node_modules/@attocash/commons-transport/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
- package/node_modules/@attocash/commons-transport/ktor-ktor-client-content-negotiation.mjs +411 -196
- package/node_modules/@attocash/commons-transport/ktor-ktor-client-content-negotiation.mjs.map +1 -1
- package/node_modules/@attocash/commons-transport/ktor-ktor-client-core.mjs +2115 -1976
- package/node_modules/@attocash/commons-transport/ktor-ktor-client-core.mjs.map +1 -1
- package/node_modules/@attocash/commons-transport/ktor-ktor-events.mjs +7 -7
- package/node_modules/@attocash/commons-transport/ktor-ktor-events.mjs.map +1 -1
- package/node_modules/@attocash/commons-transport/ktor-ktor-http-cio.mjs +385 -384
- package/node_modules/@attocash/commons-transport/ktor-ktor-http-cio.mjs.map +1 -1
- package/node_modules/@attocash/commons-transport/ktor-ktor-http.mjs +1261 -1185
- package/node_modules/@attocash/commons-transport/ktor-ktor-http.mjs.map +1 -1
- package/node_modules/@attocash/commons-transport/ktor-ktor-io.mjs +668 -656
- package/node_modules/@attocash/commons-transport/ktor-ktor-io.mjs.map +1 -1
- package/node_modules/@attocash/commons-transport/ktor-ktor-openapi-schema.mjs +89 -0
- package/node_modules/@attocash/commons-transport/ktor-ktor-openapi-schema.mjs.map +1 -0
- package/node_modules/@attocash/commons-transport/ktor-ktor-serialization-kotlinx-json.mjs +9 -9
- package/node_modules/@attocash/commons-transport/ktor-ktor-serialization-kotlinx-json.mjs.map +1 -1
- package/node_modules/@attocash/commons-transport/ktor-ktor-serialization-kotlinx.mjs +120 -128
- package/node_modules/@attocash/commons-transport/ktor-ktor-serialization-kotlinx.mjs.map +1 -1
- package/node_modules/@attocash/commons-transport/ktor-ktor-serialization.mjs +46 -49
- package/node_modules/@attocash/commons-transport/ktor-ktor-serialization.mjs.map +1 -1
- package/node_modules/@attocash/commons-transport/ktor-ktor-sse.mjs.map +1 -1
- package/node_modules/@attocash/commons-transport/ktor-ktor-utils.mjs +1041 -985
- package/node_modules/@attocash/commons-transport/ktor-ktor-utils.mjs.map +1 -1
- package/node_modules/@attocash/commons-transport/ktor-ktor-websocket-serialization.mjs.map +1 -1
- package/node_modules/@attocash/commons-transport/ktor-ktor-websockets.mjs +530 -455
- package/node_modules/@attocash/commons-transport/ktor-ktor-websockets.mjs.map +1 -1
- package/node_modules/@attocash/commons-transport/package.json +4 -4
- package/node_modules/@attocash/commons-worker/commons-commons-worker.d.mts +1 -0
- package/node_modules/@attocash/commons-worker/commons-commons-worker.mjs +230 -226
- package/node_modules/@attocash/commons-worker/commons-commons-worker.mjs.map +1 -1
- package/node_modules/@attocash/commons-worker/kotlin-logging.mjs +109 -109
- package/node_modules/@attocash/commons-worker/kotlin-logging.mjs.map +1 -1
- package/node_modules/@attocash/commons-worker/kotlinx-serialization-kotlinx-serialization-json.mjs +1732 -1701
- package/node_modules/@attocash/commons-worker/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
- package/node_modules/@attocash/commons-worker/package.json +3 -3
- package/node_modules/@attocash/commons-worker-remote/commons-commons-worker-remote.d.mts +1 -0
- package/node_modules/@attocash/commons-worker-remote/commons-commons-worker-remote.mjs +91 -86
- package/node_modules/@attocash/commons-worker-remote/commons-commons-worker-remote.mjs.map +1 -1
- package/node_modules/@attocash/commons-worker-remote/kotlin-logging.mjs +109 -109
- package/node_modules/@attocash/commons-worker-remote/kotlin-logging.mjs.map +1 -1
- package/node_modules/@attocash/commons-worker-remote/kotlinx-browser.mjs.map +1 -1
- package/node_modules/@attocash/commons-worker-remote/kotlinx-serialization-kotlinx-serialization-json-io.mjs.map +1 -1
- package/node_modules/@attocash/commons-worker-remote/kotlinx-serialization-kotlinx-serialization-json.mjs +1732 -1701
- package/node_modules/@attocash/commons-worker-remote/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
- package/node_modules/@attocash/commons-worker-remote/package.json +4 -4
- package/package.json +9 -5
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
IndexOutOfBoundsException1qfr429iumro0 as IndexOutOfBoundsException,
|
|
3
3
|
IllegalArgumentException2asla15b5jaob as IllegalArgumentException,
|
|
4
4
|
subtract2orl8z9upxd9l as subtract,
|
|
5
|
-
|
|
5
|
+
_Char___init__impl__6a9atxrzocepzq3zgi as _Char___init__impl__6a9atx,
|
|
6
6
|
charArrayOf27f4r3dozbrk1 as charArrayOf,
|
|
7
7
|
toString1pkumu07cwy4m as toString,
|
|
8
|
-
|
|
8
|
+
Unit_instance3kz1zqli6gr1r as Unit_instance,
|
|
9
9
|
toShort36kaw0zjdq3ex as toShort,
|
|
10
10
|
fromInt2ii0rejb1w62w as fromInt,
|
|
11
11
|
shiftLeft3tsh2sstjchzn as shiftLeft,
|
|
@@ -26,13 +26,13 @@ import {
|
|
|
26
26
|
convertToByte2t4hntblnhq2k as convertToByte,
|
|
27
27
|
initMetadataForObject1cxne3s9w65el as initMetadataForObject,
|
|
28
28
|
initMetadataForInterface1egvbzx539z91 as initMetadataForInterface,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
_UByte___get_data__impl__jof9qr100nrznmlnqj as _UByte___get_data__impl__jof9qr,
|
|
30
|
+
_UShort___get_data__impl__g02451raj6q6epxg1b as _UShort___get_data__impl__g0245,
|
|
31
|
+
_ULong___get_data__impl__fggpzbbo8lz7f8fnfy as _ULong___get_data__impl__fggpzb,
|
|
32
|
+
Char__toInt_impl_vasixd28v1p2u6jau5g as Char__toInt_impl_vasixd,
|
|
33
|
+
_UByte___init__impl__g9hnc49zztd2brjj2m as _UByte___init__impl__g9hnc4,
|
|
34
|
+
_UShort___init__impl__jigrne1e3nphhrejdd8 as _UShort___init__impl__jigrne,
|
|
35
|
+
_ULong___init__impl__c78o9k1vasxel72m2l4 as _ULong___init__impl__c78o9k,
|
|
36
36
|
multiply2k9eolhnz1bjv as multiply,
|
|
37
37
|
charCodeAt1yspne1d8erbm as charCodeAt,
|
|
38
38
|
charArray2ujmm1qusno00 as charArray,
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
captureStack1fzi4aczwc4hg as captureStack,
|
|
42
42
|
Exceptiondt2hlxn7j7vw as Exception,
|
|
43
43
|
} from './kotlin-kotlin-stdlib.mjs';
|
|
44
|
-
import {
|
|
44
|
+
import { UnsafeByteStringOperations_instance2qzwn5iz9dqfo as UnsafeByteStringOperations_instance } from './kotlinx-io-kotlinx-io-bytestring.mjs';
|
|
45
45
|
//region block: imports
|
|
46
46
|
var imul = Math.imul;
|
|
47
47
|
//endregion
|
|
@@ -53,48 +53,48 @@ function write$default(source, startIndex, endIndex, $super) {
|
|
|
53
53
|
endIndex = endIndex === VOID ? source.length : endIndex;
|
|
54
54
|
var tmp;
|
|
55
55
|
if ($super === VOID) {
|
|
56
|
-
this.
|
|
56
|
+
this.write_ti570x_k$(source, startIndex, endIndex);
|
|
57
57
|
tmp = Unit_instance;
|
|
58
58
|
} else {
|
|
59
|
-
tmp = $super.
|
|
59
|
+
tmp = $super.write_ti570x_k$.call(this, source, startIndex, endIndex);
|
|
60
60
|
}
|
|
61
61
|
return tmp;
|
|
62
62
|
}
|
|
63
63
|
class Buffer {
|
|
64
64
|
constructor() {
|
|
65
|
-
this.
|
|
66
|
-
this.
|
|
67
|
-
this.
|
|
65
|
+
this.head_1 = null;
|
|
66
|
+
this.tail_1 = null;
|
|
67
|
+
this.sizeMut_1 = 0n;
|
|
68
68
|
}
|
|
69
|
-
|
|
70
|
-
return this.
|
|
69
|
+
get_size_woubt6_k$() {
|
|
70
|
+
return this.sizeMut_1;
|
|
71
71
|
}
|
|
72
|
-
|
|
72
|
+
get_buffer_bmaafd_k$() {
|
|
73
73
|
return this;
|
|
74
74
|
}
|
|
75
|
-
|
|
76
|
-
return this.
|
|
75
|
+
exhausted_p1jt55_k$() {
|
|
76
|
+
return this.get_size_woubt6_k$() === 0n;
|
|
77
77
|
}
|
|
78
|
-
|
|
78
|
+
require_37jki9_k$(byteCount) {
|
|
79
79
|
// Inline function 'kotlin.require' call
|
|
80
80
|
if (!(byteCount >= 0n)) {
|
|
81
81
|
var message = 'byteCount: ' + byteCount.toString();
|
|
82
|
-
throw IllegalArgumentException.
|
|
82
|
+
throw IllegalArgumentException.new_kotlin_IllegalArgumentException_sfqr8_k$(toString(message));
|
|
83
83
|
}
|
|
84
|
-
if (this.
|
|
85
|
-
throw EOFException.
|
|
84
|
+
if (this.get_size_woubt6_k$() < byteCount) {
|
|
85
|
+
throw EOFException.new_kotlinx_io_EOFException_1f8u0y_k$("Buffer doesn't contain required number of bytes (size: " + this.get_size_woubt6_k$().toString() + ', required: ' + byteCount.toString() + ')');
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
|
|
88
|
+
request_hj5jqj_k$(byteCount) {
|
|
89
89
|
// Inline function 'kotlin.require' call
|
|
90
90
|
if (!(byteCount >= 0n)) {
|
|
91
91
|
var message = 'byteCount: ' + byteCount.toString() + ' < 0';
|
|
92
|
-
throw IllegalArgumentException.
|
|
92
|
+
throw IllegalArgumentException.new_kotlin_IllegalArgumentException_sfqr8_k$(toString(message));
|
|
93
93
|
}
|
|
94
|
-
return this.
|
|
94
|
+
return this.get_size_woubt6_k$() >= byteCount;
|
|
95
95
|
}
|
|
96
|
-
|
|
97
|
-
var tmp0_elvis_lhs = this.
|
|
96
|
+
readByte_ectjk2_k$() {
|
|
97
|
+
var tmp0_elvis_lhs = this.head_1;
|
|
98
98
|
var tmp;
|
|
99
99
|
if (tmp0_elvis_lhs == null) {
|
|
100
100
|
throwEof(this, 1n);
|
|
@@ -102,20 +102,20 @@ class Buffer {
|
|
|
102
102
|
tmp = tmp0_elvis_lhs;
|
|
103
103
|
}
|
|
104
104
|
var segment = tmp;
|
|
105
|
-
var segmentSize = segment.
|
|
105
|
+
var segmentSize = segment.get_size_woubt6_k$();
|
|
106
106
|
if (segmentSize === 0) {
|
|
107
|
-
this.
|
|
108
|
-
return this.
|
|
107
|
+
this.recycleHead_e8xkbv_k$();
|
|
108
|
+
return this.readByte_ectjk2_k$();
|
|
109
109
|
}
|
|
110
|
-
var v = segment.
|
|
111
|
-
this.
|
|
110
|
+
var v = segment.readByte_newmca_k$();
|
|
111
|
+
this.sizeMut_1 = subtract(this.sizeMut_1, 1n);
|
|
112
112
|
if (segmentSize === 1) {
|
|
113
|
-
this.
|
|
113
|
+
this.recycleHead_e8xkbv_k$();
|
|
114
114
|
}
|
|
115
115
|
return v;
|
|
116
116
|
}
|
|
117
|
-
|
|
118
|
-
var tmp0_elvis_lhs = this.
|
|
117
|
+
readShort_ilpyey_k$() {
|
|
118
|
+
var tmp0_elvis_lhs = this.head_1;
|
|
119
119
|
var tmp;
|
|
120
120
|
if (tmp0_elvis_lhs == null) {
|
|
121
121
|
throwEof(this, 2n);
|
|
@@ -123,28 +123,28 @@ class Buffer {
|
|
|
123
123
|
tmp = tmp0_elvis_lhs;
|
|
124
124
|
}
|
|
125
125
|
var segment = tmp;
|
|
126
|
-
var segmentSize = segment.
|
|
126
|
+
var segmentSize = segment.get_size_woubt6_k$();
|
|
127
127
|
if (segmentSize < 2) {
|
|
128
|
-
this.
|
|
128
|
+
this.require_37jki9_k$(2n);
|
|
129
129
|
if (segmentSize === 0) {
|
|
130
|
-
this.
|
|
131
|
-
return this.
|
|
130
|
+
this.recycleHead_e8xkbv_k$();
|
|
131
|
+
return this.readShort_ilpyey_k$();
|
|
132
132
|
}
|
|
133
133
|
// Inline function 'kotlinx.io.and' call
|
|
134
|
-
var tmp_0 = (this.
|
|
134
|
+
var tmp_0 = (this.readByte_ectjk2_k$() & 255) << 8;
|
|
135
135
|
// Inline function 'kotlinx.io.and' call
|
|
136
|
-
var tmp$ret$1 = this.
|
|
136
|
+
var tmp$ret$1 = this.readByte_ectjk2_k$() & 255;
|
|
137
137
|
return toShort(tmp_0 | tmp$ret$1);
|
|
138
138
|
}
|
|
139
|
-
var v = segment.
|
|
140
|
-
this.
|
|
139
|
+
var v = segment.readShort_7b409e_k$();
|
|
140
|
+
this.sizeMut_1 = subtract(this.sizeMut_1, 2n);
|
|
141
141
|
if (segmentSize === 2) {
|
|
142
|
-
this.
|
|
142
|
+
this.recycleHead_e8xkbv_k$();
|
|
143
143
|
}
|
|
144
144
|
return v;
|
|
145
145
|
}
|
|
146
|
-
|
|
147
|
-
var tmp0_elvis_lhs = this.
|
|
146
|
+
readInt_hv8cxl_k$() {
|
|
147
|
+
var tmp0_elvis_lhs = this.head_1;
|
|
148
148
|
var tmp;
|
|
149
149
|
if (tmp0_elvis_lhs == null) {
|
|
150
150
|
throwEof(this, 4n);
|
|
@@ -152,24 +152,24 @@ class Buffer {
|
|
|
152
152
|
tmp = tmp0_elvis_lhs;
|
|
153
153
|
}
|
|
154
154
|
var segment = tmp;
|
|
155
|
-
var segmentSize = segment.
|
|
155
|
+
var segmentSize = segment.get_size_woubt6_k$();
|
|
156
156
|
if (segmentSize < 4) {
|
|
157
|
-
this.
|
|
157
|
+
this.require_37jki9_k$(4n);
|
|
158
158
|
if (segmentSize === 0) {
|
|
159
|
-
this.
|
|
160
|
-
return this.
|
|
159
|
+
this.recycleHead_e8xkbv_k$();
|
|
160
|
+
return this.readInt_hv8cxl_k$();
|
|
161
161
|
}
|
|
162
|
-
return this.
|
|
162
|
+
return this.readShort_ilpyey_k$() << 16 | this.readShort_ilpyey_k$() & 65535;
|
|
163
163
|
}
|
|
164
|
-
var v = segment.
|
|
165
|
-
this.
|
|
164
|
+
var v = segment.readInt_wxtzen_k$();
|
|
165
|
+
this.sizeMut_1 = subtract(this.sizeMut_1, 4n);
|
|
166
166
|
if (segmentSize === 4) {
|
|
167
|
-
this.
|
|
167
|
+
this.recycleHead_e8xkbv_k$();
|
|
168
168
|
}
|
|
169
169
|
return v;
|
|
170
170
|
}
|
|
171
|
-
|
|
172
|
-
var tmp0_elvis_lhs = this.
|
|
171
|
+
readLong_ecnd8u_k$() {
|
|
172
|
+
var tmp0_elvis_lhs = this.head_1;
|
|
173
173
|
var tmp;
|
|
174
174
|
if (tmp0_elvis_lhs == null) {
|
|
175
175
|
throwEof(this, 8n);
|
|
@@ -177,155 +177,155 @@ class Buffer {
|
|
|
177
177
|
tmp = tmp0_elvis_lhs;
|
|
178
178
|
}
|
|
179
179
|
var segment = tmp;
|
|
180
|
-
var segmentSize = segment.
|
|
180
|
+
var segmentSize = segment.get_size_woubt6_k$();
|
|
181
181
|
if (segmentSize < 8) {
|
|
182
|
-
this.
|
|
182
|
+
this.require_37jki9_k$(8n);
|
|
183
183
|
if (segmentSize === 0) {
|
|
184
|
-
this.
|
|
185
|
-
return this.
|
|
184
|
+
this.recycleHead_e8xkbv_k$();
|
|
185
|
+
return this.readLong_ecnd8u_k$();
|
|
186
186
|
}
|
|
187
|
-
return shiftLeft(fromInt(this.
|
|
187
|
+
return shiftLeft(fromInt(this.readInt_hv8cxl_k$()), 32) | fromInt(this.readInt_hv8cxl_k$()) & 4294967295n;
|
|
188
188
|
}
|
|
189
|
-
var v = segment.
|
|
190
|
-
this.
|
|
189
|
+
var v = segment.readLong_ud3obe_k$();
|
|
190
|
+
this.sizeMut_1 = subtract(this.sizeMut_1, 8n);
|
|
191
191
|
if (segmentSize === 8) {
|
|
192
|
-
this.
|
|
192
|
+
this.recycleHead_e8xkbv_k$();
|
|
193
193
|
}
|
|
194
194
|
return v;
|
|
195
195
|
}
|
|
196
|
-
|
|
196
|
+
hintEmit_6b2e5m_k$() {
|
|
197
197
|
return Unit_instance;
|
|
198
198
|
}
|
|
199
|
-
|
|
200
|
-
checkBounds(this.
|
|
199
|
+
copyTo_xutsee_k$(out, startIndex, endIndex) {
|
|
200
|
+
checkBounds(this.get_size_woubt6_k$(), startIndex, endIndex);
|
|
201
201
|
if (startIndex === endIndex)
|
|
202
202
|
return Unit_instance;
|
|
203
203
|
var currentOffset = startIndex;
|
|
204
204
|
var remainingByteCount = subtract(endIndex, startIndex);
|
|
205
|
-
out.
|
|
206
|
-
var s = this.
|
|
207
|
-
while (currentOffset >= fromInt(ensureNotNull(s).
|
|
208
|
-
currentOffset = subtract(currentOffset, fromInt(s.
|
|
209
|
-
s = s.
|
|
205
|
+
out.sizeMut_1 = add(out.sizeMut_1, remainingByteCount);
|
|
206
|
+
var s = this.head_1;
|
|
207
|
+
while (currentOffset >= fromInt(ensureNotNull(s).limit_1 - s.pos_1 | 0)) {
|
|
208
|
+
currentOffset = subtract(currentOffset, fromInt(s.limit_1 - s.pos_1 | 0));
|
|
209
|
+
s = s.next_1;
|
|
210
210
|
}
|
|
211
211
|
while (remainingByteCount > 0n) {
|
|
212
|
-
var copy = ensureNotNull(s).
|
|
213
|
-
copy.
|
|
212
|
+
var copy = ensureNotNull(s).sharedCopy_efss0u_k$();
|
|
213
|
+
copy.pos_1 = copy.pos_1 + convertToInt(currentOffset) | 0;
|
|
214
214
|
var tmp = copy;
|
|
215
|
-
var tmp0 = copy.
|
|
215
|
+
var tmp0 = copy.pos_1 + convertToInt(remainingByteCount) | 0;
|
|
216
216
|
// Inline function 'kotlin.comparisons.minOf' call
|
|
217
|
-
var b = copy.
|
|
218
|
-
tmp.
|
|
217
|
+
var b = copy.limit_1;
|
|
218
|
+
tmp.limit_1 = Math.min(tmp0, b);
|
|
219
219
|
// Inline function 'kotlinx.io.Buffer.pushSegment' call
|
|
220
|
-
if (out.
|
|
221
|
-
out.
|
|
222
|
-
out.
|
|
220
|
+
if (out.head_1 == null) {
|
|
221
|
+
out.head_1 = copy;
|
|
222
|
+
out.tail_1 = copy;
|
|
223
223
|
} else if (false) {
|
|
224
|
-
out.
|
|
225
|
-
if (ensureNotNull(out.
|
|
226
|
-
out.
|
|
224
|
+
out.tail_1 = ensureNotNull(out.tail_1).push_h69db4_k$(copy).compact_he236d_k$();
|
|
225
|
+
if (ensureNotNull(out.tail_1).prev_1 == null) {
|
|
226
|
+
out.head_1 = out.tail_1;
|
|
227
227
|
}
|
|
228
228
|
} else {
|
|
229
|
-
out.
|
|
229
|
+
out.tail_1 = ensureNotNull(out.tail_1).push_h69db4_k$(copy);
|
|
230
230
|
}
|
|
231
|
-
remainingByteCount = subtract(remainingByteCount, fromInt(copy.
|
|
231
|
+
remainingByteCount = subtract(remainingByteCount, fromInt(copy.limit_1 - copy.pos_1 | 0));
|
|
232
232
|
currentOffset = 0n;
|
|
233
|
-
s = s.
|
|
233
|
+
s = s.next_1;
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
|
-
|
|
237
|
-
var result = this.
|
|
236
|
+
completeSegmentByteCount_46ltjp_k$() {
|
|
237
|
+
var result = this.get_size_woubt6_k$();
|
|
238
238
|
if (result === 0n)
|
|
239
239
|
return 0n;
|
|
240
|
-
var tail = ensureNotNull(this.
|
|
241
|
-
if (tail.
|
|
242
|
-
result = subtract(result, fromInt(tail.
|
|
240
|
+
var tail = ensureNotNull(this.tail_1);
|
|
241
|
+
if (tail.limit_1 < 8192 && tail.owner_1) {
|
|
242
|
+
result = subtract(result, fromInt(tail.limit_1 - tail.pos_1 | 0));
|
|
243
243
|
}
|
|
244
244
|
return result;
|
|
245
245
|
}
|
|
246
|
-
|
|
247
|
-
if (position < 0n || position >= this.
|
|
248
|
-
throw IndexOutOfBoundsException.
|
|
246
|
+
get_f9lzxq_k$(position) {
|
|
247
|
+
if (position < 0n || position >= this.get_size_woubt6_k$()) {
|
|
248
|
+
throw IndexOutOfBoundsException.new_kotlin_IndexOutOfBoundsException_ddr8db_k$('position (' + position.toString() + ') is not within the range [0..size(' + this.get_size_woubt6_k$().toString() + '))');
|
|
249
249
|
}
|
|
250
250
|
if (position === 0n) {
|
|
251
|
-
return ensureNotNull(this.
|
|
251
|
+
return ensureNotNull(this.head_1).getUnchecked_g7gmig_k$(0);
|
|
252
252
|
}
|
|
253
253
|
$l$block_1: {
|
|
254
254
|
// Inline function 'kotlinx.io.seek' call
|
|
255
|
-
if (this.
|
|
256
|
-
return ensureNotNull(null).
|
|
255
|
+
if (this.head_1 == null) {
|
|
256
|
+
return ensureNotNull(null).getUnchecked_g7gmig_k$(convertToInt(subtract(position, -1n)));
|
|
257
257
|
}
|
|
258
|
-
if (subtract(this.
|
|
259
|
-
var s = this.
|
|
260
|
-
var offset = this.
|
|
258
|
+
if (subtract(this.get_size_woubt6_k$(), position) < position) {
|
|
259
|
+
var s = this.tail_1;
|
|
260
|
+
var offset = this.get_size_woubt6_k$();
|
|
261
261
|
$l$loop: while (!(s == null) && offset > position) {
|
|
262
|
-
offset = subtract(offset, fromInt(s.
|
|
262
|
+
offset = subtract(offset, fromInt(s.limit_1 - s.pos_1 | 0));
|
|
263
263
|
if (offset <= position)
|
|
264
264
|
break $l$loop;
|
|
265
|
-
s = s.
|
|
265
|
+
s = s.prev_1;
|
|
266
266
|
}
|
|
267
267
|
var tmp0 = s;
|
|
268
268
|
var offset_0 = offset;
|
|
269
|
-
return ensureNotNull(tmp0).
|
|
269
|
+
return ensureNotNull(tmp0).getUnchecked_g7gmig_k$(convertToInt(subtract(position, offset_0)));
|
|
270
270
|
} else {
|
|
271
|
-
var s_0 = this.
|
|
271
|
+
var s_0 = this.head_1;
|
|
272
272
|
var offset_1 = 0n;
|
|
273
273
|
$l$loop_0: while (!(s_0 == null)) {
|
|
274
274
|
var tmp0_0 = offset_1;
|
|
275
275
|
// Inline function 'kotlin.Long.plus' call
|
|
276
|
-
var other = s_0.
|
|
276
|
+
var other = s_0.limit_1 - s_0.pos_1 | 0;
|
|
277
277
|
var nextOffset = add(tmp0_0, fromInt(other));
|
|
278
278
|
if (nextOffset > position)
|
|
279
279
|
break $l$loop_0;
|
|
280
|
-
s_0 = s_0.
|
|
280
|
+
s_0 = s_0.next_1;
|
|
281
281
|
offset_1 = nextOffset;
|
|
282
282
|
}
|
|
283
283
|
var tmp0_1 = s_0;
|
|
284
284
|
var offset_2 = offset_1;
|
|
285
|
-
return ensureNotNull(tmp0_1).
|
|
285
|
+
return ensureNotNull(tmp0_1).getUnchecked_g7gmig_k$(convertToInt(subtract(position, offset_2)));
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
288
|
}
|
|
289
|
-
|
|
290
|
-
return this.
|
|
289
|
+
clear_j9egeb_k$() {
|
|
290
|
+
return this.skip_csbv9x_k$(this.get_size_woubt6_k$());
|
|
291
291
|
}
|
|
292
|
-
|
|
292
|
+
skip_csbv9x_k$(byteCount) {
|
|
293
293
|
// Inline function 'kotlinx.io.checkByteCount' call
|
|
294
294
|
// Inline function 'kotlin.require' call
|
|
295
295
|
if (!(byteCount >= 0n)) {
|
|
296
296
|
var message = 'byteCount (' + byteCount.toString() + ') < 0';
|
|
297
|
-
throw IllegalArgumentException.
|
|
297
|
+
throw IllegalArgumentException.new_kotlin_IllegalArgumentException_sfqr8_k$(toString(message));
|
|
298
298
|
}
|
|
299
299
|
var remainingByteCount = byteCount;
|
|
300
300
|
while (remainingByteCount > 0n) {
|
|
301
|
-
var tmp0_elvis_lhs = this.
|
|
301
|
+
var tmp0_elvis_lhs = this.head_1;
|
|
302
302
|
var tmp;
|
|
303
303
|
if (tmp0_elvis_lhs == null) {
|
|
304
|
-
throw EOFException.
|
|
304
|
+
throw EOFException.new_kotlinx_io_EOFException_1f8u0y_k$('Buffer exhausted before skipping ' + byteCount.toString() + ' bytes.');
|
|
305
305
|
} else {
|
|
306
306
|
tmp = tmp0_elvis_lhs;
|
|
307
307
|
}
|
|
308
308
|
var head = tmp;
|
|
309
309
|
var tmp0 = remainingByteCount;
|
|
310
310
|
// Inline function 'kotlinx.io.minOf' call
|
|
311
|
-
var b = head.
|
|
311
|
+
var b = head.limit_1 - head.pos_1 | 0;
|
|
312
312
|
// Inline function 'kotlin.comparisons.minOf' call
|
|
313
313
|
var b_0 = fromInt(b);
|
|
314
314
|
var tmp$ret$3 = tmp0 <= b_0 ? tmp0 : b_0;
|
|
315
315
|
var toSkip = convertToInt(tmp$ret$3);
|
|
316
|
-
this.
|
|
316
|
+
this.sizeMut_1 = subtract(this.sizeMut_1, fromInt(toSkip));
|
|
317
317
|
remainingByteCount = subtract(remainingByteCount, fromInt(toSkip));
|
|
318
|
-
head.
|
|
319
|
-
if (head.
|
|
320
|
-
this.
|
|
318
|
+
head.pos_1 = head.pos_1 + toSkip | 0;
|
|
319
|
+
if (head.pos_1 === head.limit_1) {
|
|
320
|
+
this.recycleHead_e8xkbv_k$();
|
|
321
321
|
}
|
|
322
322
|
}
|
|
323
323
|
}
|
|
324
|
-
|
|
324
|
+
readAtMostTo_kub29z_k$(sink, startIndex, endIndex) {
|
|
325
325
|
// Inline function 'kotlinx.io.checkBounds' call
|
|
326
326
|
var size = sink.length;
|
|
327
327
|
checkBounds(fromInt(size), fromInt(startIndex), fromInt(endIndex));
|
|
328
|
-
var tmp0_elvis_lhs = this.
|
|
328
|
+
var tmp0_elvis_lhs = this.head_1;
|
|
329
329
|
var tmp;
|
|
330
330
|
if (tmp0_elvis_lhs == null) {
|
|
331
331
|
return -1;
|
|
@@ -335,535 +335,551 @@ class Buffer {
|
|
|
335
335
|
var s = tmp;
|
|
336
336
|
var tmp0 = endIndex - startIndex | 0;
|
|
337
337
|
// Inline function 'kotlin.comparisons.minOf' call
|
|
338
|
-
var b = s.
|
|
338
|
+
var b = s.get_size_woubt6_k$();
|
|
339
339
|
var toCopy = Math.min(tmp0, b);
|
|
340
|
-
s.
|
|
341
|
-
this.
|
|
340
|
+
s.readTo_7avxxz_k$(sink, startIndex, startIndex + toCopy | 0);
|
|
341
|
+
this.sizeMut_1 = subtract(this.sizeMut_1, fromInt(toCopy));
|
|
342
342
|
if (isEmpty(s)) {
|
|
343
|
-
this.
|
|
343
|
+
this.recycleHead_e8xkbv_k$();
|
|
344
344
|
}
|
|
345
345
|
return toCopy;
|
|
346
346
|
}
|
|
347
|
-
|
|
347
|
+
readAtMostTo_4oop6l_k$(sink, byteCount) {
|
|
348
348
|
// Inline function 'kotlinx.io.checkByteCount' call
|
|
349
349
|
// Inline function 'kotlin.require' call
|
|
350
350
|
if (!(byteCount >= 0n)) {
|
|
351
351
|
var message = 'byteCount (' + byteCount.toString() + ') < 0';
|
|
352
|
-
throw IllegalArgumentException.
|
|
352
|
+
throw IllegalArgumentException.new_kotlin_IllegalArgumentException_sfqr8_k$(toString(message));
|
|
353
353
|
}
|
|
354
|
-
if (this.
|
|
354
|
+
if (this.get_size_woubt6_k$() === 0n)
|
|
355
355
|
return -1n;
|
|
356
|
-
var bytesWritten = byteCount > this.
|
|
357
|
-
sink.
|
|
356
|
+
var bytesWritten = byteCount > this.get_size_woubt6_k$() ? this.get_size_woubt6_k$() : byteCount;
|
|
357
|
+
sink.write_ob3ym3_k$(this, bytesWritten);
|
|
358
358
|
return bytesWritten;
|
|
359
359
|
}
|
|
360
|
-
|
|
360
|
+
readTo_3vtbf7_k$(sink, byteCount) {
|
|
361
361
|
// Inline function 'kotlinx.io.checkByteCount' call
|
|
362
362
|
// Inline function 'kotlin.require' call
|
|
363
363
|
if (!(byteCount >= 0n)) {
|
|
364
364
|
var message = 'byteCount (' + byteCount.toString() + ') < 0';
|
|
365
|
-
throw IllegalArgumentException.
|
|
365
|
+
throw IllegalArgumentException.new_kotlin_IllegalArgumentException_sfqr8_k$(toString(message));
|
|
366
366
|
}
|
|
367
|
-
if (this.
|
|
368
|
-
sink.
|
|
369
|
-
throw EOFException.
|
|
367
|
+
if (this.get_size_woubt6_k$() < byteCount) {
|
|
368
|
+
sink.write_ob3ym3_k$(this, this.get_size_woubt6_k$());
|
|
369
|
+
throw EOFException.new_kotlinx_io_EOFException_1f8u0y_k$('Buffer exhausted before writing ' + byteCount.toString() + ' bytes. Only ' + this.get_size_woubt6_k$().toString() + ' bytes were written.');
|
|
370
370
|
}
|
|
371
|
-
sink.
|
|
371
|
+
sink.write_ob3ym3_k$(this, byteCount);
|
|
372
372
|
}
|
|
373
|
-
|
|
374
|
-
var byteCount = this.
|
|
373
|
+
transferTo_lu4ka2_k$(sink) {
|
|
374
|
+
var byteCount = this.get_size_woubt6_k$();
|
|
375
375
|
if (byteCount > 0n) {
|
|
376
|
-
sink.
|
|
376
|
+
sink.write_ob3ym3_k$(this, byteCount);
|
|
377
377
|
}
|
|
378
378
|
return byteCount;
|
|
379
379
|
}
|
|
380
|
-
|
|
380
|
+
peek_21nx7_k$() {
|
|
381
381
|
return buffered(new PeekSource(this));
|
|
382
382
|
}
|
|
383
|
-
|
|
383
|
+
writableSegment_voqx71_k$(minimumCapacity) {
|
|
384
384
|
// Inline function 'kotlin.require' call
|
|
385
385
|
if (!(minimumCapacity >= 1 && minimumCapacity <= 8192)) {
|
|
386
386
|
var message = 'unexpected capacity (' + minimumCapacity + '), should be in range [1, 8192]';
|
|
387
|
-
throw IllegalArgumentException.
|
|
387
|
+
throw IllegalArgumentException.new_kotlin_IllegalArgumentException_sfqr8_k$(toString(message));
|
|
388
388
|
}
|
|
389
|
-
if (this.
|
|
390
|
-
var result = SegmentPool_instance.
|
|
391
|
-
this.
|
|
392
|
-
this.
|
|
389
|
+
if (this.tail_1 == null) {
|
|
390
|
+
var result = SegmentPool_instance.take_2451j_k$();
|
|
391
|
+
this.head_1 = result;
|
|
392
|
+
this.tail_1 = result;
|
|
393
393
|
return result;
|
|
394
394
|
}
|
|
395
|
-
var t = ensureNotNull(this.
|
|
396
|
-
if ((t.
|
|
397
|
-
var newTail = t.
|
|
398
|
-
this.
|
|
395
|
+
var t = ensureNotNull(this.tail_1);
|
|
396
|
+
if ((t.limit_1 + minimumCapacity | 0) > 8192 || !t.owner_1) {
|
|
397
|
+
var newTail = t.push_h69db4_k$(SegmentPool_instance.take_2451j_k$());
|
|
398
|
+
this.tail_1 = newTail;
|
|
399
399
|
return newTail;
|
|
400
400
|
}
|
|
401
401
|
return t;
|
|
402
402
|
}
|
|
403
|
-
|
|
403
|
+
write_ti570x_k$(source, startIndex, endIndex) {
|
|
404
404
|
// Inline function 'kotlinx.io.checkBounds' call
|
|
405
405
|
var size = source.length;
|
|
406
406
|
checkBounds(fromInt(size), fromInt(startIndex), fromInt(endIndex));
|
|
407
407
|
var currentOffset = startIndex;
|
|
408
408
|
while (currentOffset < endIndex) {
|
|
409
|
-
var tail = this.
|
|
409
|
+
var tail = this.writableSegment_voqx71_k$(1);
|
|
410
410
|
var tmp0 = endIndex - currentOffset | 0;
|
|
411
411
|
// Inline function 'kotlin.comparisons.minOf' call
|
|
412
|
-
var b = tail.
|
|
412
|
+
var b = tail.get_remainingCapacity_c94947_k$();
|
|
413
413
|
var toCopy = Math.min(tmp0, b);
|
|
414
|
-
tail.
|
|
414
|
+
tail.write_j6nfmf_k$(source, currentOffset, currentOffset + toCopy | 0);
|
|
415
415
|
currentOffset = currentOffset + toCopy | 0;
|
|
416
416
|
}
|
|
417
417
|
var tmp = this;
|
|
418
|
-
var tmp0_0 = this.
|
|
418
|
+
var tmp0_0 = this.sizeMut_1;
|
|
419
419
|
// Inline function 'kotlin.Long.plus' call
|
|
420
420
|
var other = endIndex - startIndex | 0;
|
|
421
|
-
tmp.
|
|
421
|
+
tmp.sizeMut_1 = add(tmp0_0, fromInt(other));
|
|
422
422
|
}
|
|
423
|
-
|
|
423
|
+
write_9ocf0z_k$(source, byteCount) {
|
|
424
|
+
// Inline function 'kotlinx.io.checkByteCount' call
|
|
425
|
+
// Inline function 'kotlin.require' call
|
|
426
|
+
if (!(byteCount >= 0n)) {
|
|
427
|
+
var message = 'byteCount (' + byteCount.toString() + ') < 0';
|
|
428
|
+
throw IllegalArgumentException.new_kotlin_IllegalArgumentException_sfqr8_k$(toString(message));
|
|
429
|
+
}
|
|
430
|
+
var remainingByteCount = byteCount;
|
|
431
|
+
while (remainingByteCount > 0n) {
|
|
432
|
+
var read = source.readAtMostTo_4oop6l_k$(this, remainingByteCount);
|
|
433
|
+
if (read === -1n) {
|
|
434
|
+
throw EOFException.new_kotlinx_io_EOFException_1f8u0y_k$('Source exhausted before reading ' + byteCount.toString() + ' bytes. ' + ('Only ' + subtract(byteCount, remainingByteCount).toString() + ' were read.'));
|
|
435
|
+
}
|
|
436
|
+
remainingByteCount = subtract(remainingByteCount, read);
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
write_ob3ym3_k$(source, byteCount) {
|
|
424
440
|
// Inline function 'kotlin.require' call
|
|
425
441
|
if (!!(source === this)) {
|
|
426
442
|
var message = 'source == this';
|
|
427
|
-
throw IllegalArgumentException.
|
|
443
|
+
throw IllegalArgumentException.new_kotlin_IllegalArgumentException_sfqr8_k$(toString(message));
|
|
428
444
|
}
|
|
429
|
-
checkOffsetAndCount(source.
|
|
445
|
+
checkOffsetAndCount(source.sizeMut_1, 0n, byteCount);
|
|
430
446
|
var remainingByteCount = byteCount;
|
|
431
447
|
while (remainingByteCount > 0n) {
|
|
432
|
-
if (remainingByteCount < fromInt(ensureNotNull(source.
|
|
433
|
-
var tail = this.
|
|
448
|
+
if (remainingByteCount < fromInt(ensureNotNull(source.head_1).get_size_woubt6_k$())) {
|
|
449
|
+
var tail = this.tail_1;
|
|
434
450
|
var tmp;
|
|
435
|
-
if (!(tail == null) && tail.
|
|
451
|
+
if (!(tail == null) && tail.owner_1) {
|
|
436
452
|
var tmp0 = remainingByteCount;
|
|
437
453
|
// Inline function 'kotlin.Long.plus' call
|
|
438
|
-
var other = tail.
|
|
454
|
+
var other = tail.limit_1;
|
|
439
455
|
var tmp0_0 = add(tmp0, fromInt(other));
|
|
440
456
|
// Inline function 'kotlin.Long.minus' call
|
|
441
|
-
var other_0 = tail.
|
|
457
|
+
var other_0 = tail.get_shared_lt0222_k$() ? 0 : tail.pos_1;
|
|
442
458
|
tmp = subtract(tmp0_0, fromInt(other_0)) <= 8192n;
|
|
443
459
|
} else {
|
|
444
460
|
tmp = false;
|
|
445
461
|
}
|
|
446
462
|
if (tmp) {
|
|
447
|
-
ensureNotNull(source.
|
|
448
|
-
source.
|
|
449
|
-
this.
|
|
463
|
+
ensureNotNull(source.head_1).writeTo_vgyea0_k$(tail, convertToInt(remainingByteCount));
|
|
464
|
+
source.sizeMut_1 = subtract(source.sizeMut_1, remainingByteCount);
|
|
465
|
+
this.sizeMut_1 = add(this.sizeMut_1, remainingByteCount);
|
|
450
466
|
return Unit_instance;
|
|
451
467
|
} else {
|
|
452
|
-
source.
|
|
468
|
+
source.head_1 = ensureNotNull(source.head_1).split_p6jwdi_k$(convertToInt(remainingByteCount));
|
|
453
469
|
}
|
|
454
470
|
}
|
|
455
|
-
var segmentToMove = ensureNotNull(source.
|
|
456
|
-
var movedByteCount = fromInt(segmentToMove.
|
|
457
|
-
source.
|
|
458
|
-
if (source.
|
|
459
|
-
source.
|
|
471
|
+
var segmentToMove = ensureNotNull(source.head_1);
|
|
472
|
+
var movedByteCount = fromInt(segmentToMove.get_size_woubt6_k$());
|
|
473
|
+
source.head_1 = segmentToMove.pop_417547_k$();
|
|
474
|
+
if (source.head_1 == null) {
|
|
475
|
+
source.tail_1 = null;
|
|
460
476
|
}
|
|
461
477
|
// Inline function 'kotlinx.io.Buffer.pushSegment' call
|
|
462
|
-
if (this.
|
|
463
|
-
this.
|
|
464
|
-
this.
|
|
478
|
+
if (this.head_1 == null) {
|
|
479
|
+
this.head_1 = segmentToMove;
|
|
480
|
+
this.tail_1 = segmentToMove;
|
|
465
481
|
} else if (true) {
|
|
466
|
-
this.
|
|
467
|
-
if (ensureNotNull(this.
|
|
468
|
-
this.
|
|
482
|
+
this.tail_1 = ensureNotNull(this.tail_1).push_h69db4_k$(segmentToMove).compact_he236d_k$();
|
|
483
|
+
if (ensureNotNull(this.tail_1).prev_1 == null) {
|
|
484
|
+
this.head_1 = this.tail_1;
|
|
469
485
|
}
|
|
470
486
|
} else {
|
|
471
|
-
this.
|
|
487
|
+
this.tail_1 = ensureNotNull(this.tail_1).push_h69db4_k$(segmentToMove);
|
|
472
488
|
}
|
|
473
|
-
source.
|
|
474
|
-
this.
|
|
489
|
+
source.sizeMut_1 = subtract(source.sizeMut_1, movedByteCount);
|
|
490
|
+
this.sizeMut_1 = add(this.sizeMut_1, movedByteCount);
|
|
475
491
|
remainingByteCount = subtract(remainingByteCount, movedByteCount);
|
|
476
492
|
}
|
|
477
493
|
}
|
|
478
|
-
|
|
494
|
+
transferFrom_v29myr_k$(source) {
|
|
479
495
|
var totalBytesRead = 0n;
|
|
480
496
|
$l$loop: while (true) {
|
|
481
|
-
var readCount = source.
|
|
497
|
+
var readCount = source.readAtMostTo_4oop6l_k$(this, 8192n);
|
|
482
498
|
if (readCount === -1n)
|
|
483
499
|
break $l$loop;
|
|
484
500
|
totalBytesRead = add(totalBytesRead, readCount);
|
|
485
501
|
}
|
|
486
502
|
return totalBytesRead;
|
|
487
503
|
}
|
|
488
|
-
|
|
489
|
-
this.
|
|
490
|
-
this.
|
|
504
|
+
writeByte_9ih3z3_k$(byte) {
|
|
505
|
+
this.writableSegment_voqx71_k$(1).writeByte_naaedl_k$(byte);
|
|
506
|
+
this.sizeMut_1 = add(this.sizeMut_1, 1n);
|
|
491
507
|
}
|
|
492
|
-
|
|
493
|
-
this.
|
|
494
|
-
this.
|
|
508
|
+
writeShort_vn2jsb_k$(short) {
|
|
509
|
+
this.writableSegment_voqx71_k$(2).writeShort_n1l1d9_k$(short);
|
|
510
|
+
this.sizeMut_1 = add(this.sizeMut_1, 2n);
|
|
495
511
|
}
|
|
496
|
-
|
|
497
|
-
this.
|
|
498
|
-
this.
|
|
512
|
+
writeInt_i8xgjs_k$(int) {
|
|
513
|
+
this.writableSegment_voqx71_k$(4).writeInt_6bnyio_k$(int);
|
|
514
|
+
this.sizeMut_1 = add(this.sizeMut_1, 4n);
|
|
499
515
|
}
|
|
500
|
-
|
|
501
|
-
this.
|
|
502
|
-
this.
|
|
516
|
+
writeLong_vk8q1z_k$(long) {
|
|
517
|
+
this.writableSegment_voqx71_k$(8).writeLong_g7btux_k$(long);
|
|
518
|
+
this.sizeMut_1 = add(this.sizeMut_1, 8n);
|
|
503
519
|
}
|
|
504
|
-
|
|
520
|
+
copy_1tks5_k$() {
|
|
505
521
|
var result = new Buffer();
|
|
506
|
-
if (this.
|
|
522
|
+
if (this.get_size_woubt6_k$() === 0n)
|
|
507
523
|
return result;
|
|
508
|
-
var head = ensureNotNull(this.
|
|
509
|
-
var headCopy = head.
|
|
510
|
-
result.
|
|
511
|
-
result.
|
|
512
|
-
var s = head.
|
|
524
|
+
var head = ensureNotNull(this.head_1);
|
|
525
|
+
var headCopy = head.sharedCopy_efss0u_k$();
|
|
526
|
+
result.head_1 = headCopy;
|
|
527
|
+
result.tail_1 = headCopy;
|
|
528
|
+
var s = head.next_1;
|
|
513
529
|
while (!(s == null)) {
|
|
514
|
-
result.
|
|
515
|
-
s = s.
|
|
530
|
+
result.tail_1 = ensureNotNull(result.tail_1).push_h69db4_k$(s.sharedCopy_efss0u_k$());
|
|
531
|
+
s = s.next_1;
|
|
516
532
|
}
|
|
517
|
-
result.
|
|
533
|
+
result.sizeMut_1 = this.get_size_woubt6_k$();
|
|
518
534
|
return result;
|
|
519
535
|
}
|
|
520
|
-
|
|
536
|
+
close_yn9xrc_k$() {
|
|
521
537
|
return Unit_instance;
|
|
522
538
|
}
|
|
523
539
|
toString() {
|
|
524
|
-
if (this.
|
|
540
|
+
if (this.get_size_woubt6_k$() === 0n)
|
|
525
541
|
return 'Buffer(size=0)';
|
|
526
542
|
var maxPrintableBytes = 64;
|
|
527
543
|
// Inline function 'kotlinx.io.minOf' call
|
|
528
|
-
var b = this.
|
|
544
|
+
var b = this.get_size_woubt6_k$();
|
|
529
545
|
// Inline function 'kotlin.comparisons.minOf' call
|
|
530
546
|
var a = fromInt(maxPrintableBytes);
|
|
531
547
|
var tmp$ret$0 = a <= b ? a : b;
|
|
532
548
|
var len = convertToInt(tmp$ret$0);
|
|
533
|
-
var builder = StringBuilder.
|
|
549
|
+
var builder = StringBuilder.new_kotlin_text_StringBuilder_wcb3z_k$(imul(len, 2) + (this.get_size_woubt6_k$() > fromInt(maxPrintableBytes) ? 1 : 0) | 0);
|
|
534
550
|
var bytesWritten = 0;
|
|
535
551
|
// Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.forEachSegment' call
|
|
536
|
-
var curr = this.
|
|
552
|
+
var curr = this.head_1;
|
|
537
553
|
while (!(curr == null)) {
|
|
538
554
|
var tmp0 = get_SegmentReadContextImpl();
|
|
539
555
|
var segment = curr;
|
|
540
556
|
var idx = 0;
|
|
541
|
-
while (bytesWritten < len && idx < segment.
|
|
557
|
+
while (bytesWritten < len && idx < segment.get_size_woubt6_k$()) {
|
|
542
558
|
var _unary__edvuaz = idx;
|
|
543
559
|
idx = _unary__edvuaz + 1 | 0;
|
|
544
|
-
var b_0 = tmp0.
|
|
560
|
+
var b_0 = tmp0.getUnchecked_akrbjy_k$(segment, _unary__edvuaz);
|
|
545
561
|
bytesWritten = bytesWritten + 1 | 0;
|
|
546
562
|
var tmp = get_HEX_DIGIT_CHARS();
|
|
547
563
|
// Inline function 'kotlinx.io.shr' call
|
|
548
564
|
var tmp$ret$4 = b_0 >> 4;
|
|
549
|
-
var tmp_0 = builder.
|
|
565
|
+
var tmp_0 = builder.append_58al37_k$(tmp[tmp$ret$4 & 15]);
|
|
550
566
|
var tmp_1 = get_HEX_DIGIT_CHARS();
|
|
551
567
|
// Inline function 'kotlinx.io.and' call
|
|
552
568
|
var tmp$ret$5 = b_0 & 15;
|
|
553
|
-
tmp_0.
|
|
569
|
+
tmp_0.append_58al37_k$(tmp_1[tmp$ret$5]);
|
|
554
570
|
}
|
|
555
|
-
curr = curr.
|
|
571
|
+
curr = curr.next_1;
|
|
556
572
|
}
|
|
557
|
-
if (this.
|
|
558
|
-
builder.
|
|
573
|
+
if (this.get_size_woubt6_k$() > fromInt(maxPrintableBytes)) {
|
|
574
|
+
builder.append_58al37_k$(_Char___init__impl__6a9atx(8230));
|
|
559
575
|
}
|
|
560
|
-
return 'Buffer(size=' + this.
|
|
576
|
+
return 'Buffer(size=' + this.get_size_woubt6_k$().toString() + ' hex=' + builder.toString() + ')';
|
|
561
577
|
}
|
|
562
|
-
|
|
563
|
-
var oldHead = ensureNotNull(this.
|
|
564
|
-
var nextHead = oldHead.
|
|
565
|
-
this.
|
|
578
|
+
recycleHead_e8xkbv_k$() {
|
|
579
|
+
var oldHead = ensureNotNull(this.head_1);
|
|
580
|
+
var nextHead = oldHead.next_1;
|
|
581
|
+
this.head_1 = nextHead;
|
|
566
582
|
if (nextHead == null) {
|
|
567
|
-
this.
|
|
583
|
+
this.tail_1 = null;
|
|
568
584
|
} else {
|
|
569
|
-
nextHead.
|
|
585
|
+
nextHead.prev_1 = null;
|
|
570
586
|
}
|
|
571
|
-
oldHead.
|
|
572
|
-
SegmentPool_instance.
|
|
587
|
+
oldHead.next_1 = null;
|
|
588
|
+
SegmentPool_instance.recycle_3mobff_k$(oldHead);
|
|
573
589
|
}
|
|
574
|
-
|
|
575
|
-
var oldTail = ensureNotNull(this.
|
|
576
|
-
var newTail = oldTail.
|
|
577
|
-
this.
|
|
590
|
+
recycleTail_61sxi3_k$() {
|
|
591
|
+
var oldTail = ensureNotNull(this.tail_1);
|
|
592
|
+
var newTail = oldTail.prev_1;
|
|
593
|
+
this.tail_1 = newTail;
|
|
578
594
|
if (newTail == null) {
|
|
579
|
-
this.
|
|
595
|
+
this.head_1 = null;
|
|
580
596
|
} else {
|
|
581
|
-
newTail.
|
|
597
|
+
newTail.next_1 = null;
|
|
582
598
|
}
|
|
583
|
-
oldTail.
|
|
584
|
-
SegmentPool_instance.
|
|
599
|
+
oldTail.prev_1 = null;
|
|
600
|
+
SegmentPool_instance.recycle_3mobff_k$(oldTail);
|
|
585
601
|
}
|
|
586
602
|
}
|
|
587
603
|
class PeekSource {
|
|
588
604
|
constructor(upstream) {
|
|
589
|
-
this.
|
|
590
|
-
this.
|
|
591
|
-
this.
|
|
605
|
+
this.upstream_1 = upstream;
|
|
606
|
+
this.buffer_1 = this.upstream_1.get_buffer_bmaafd_k$();
|
|
607
|
+
this.expectedSegment_1 = this.buffer_1.head_1;
|
|
592
608
|
var tmp = this;
|
|
593
|
-
var tmp0_safe_receiver = this.
|
|
594
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
595
|
-
tmp.
|
|
596
|
-
this.
|
|
597
|
-
this.
|
|
609
|
+
var tmp0_safe_receiver = this.buffer_1.head_1;
|
|
610
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.pos_1;
|
|
611
|
+
tmp.expectedPos_1 = tmp1_elvis_lhs == null ? -1 : tmp1_elvis_lhs;
|
|
612
|
+
this.closed_1 = false;
|
|
613
|
+
this.pos_1 = 0n;
|
|
598
614
|
}
|
|
599
|
-
|
|
615
|
+
readAtMostTo_4oop6l_k$(sink, byteCount) {
|
|
600
616
|
// Inline function 'kotlin.check' call
|
|
601
|
-
if (!!this.
|
|
617
|
+
if (!!this.closed_1) {
|
|
602
618
|
var message = 'Source is closed.';
|
|
603
|
-
throw IllegalStateException.
|
|
619
|
+
throw IllegalStateException.new_kotlin_IllegalStateException_w47ei6_k$(toString(message));
|
|
604
620
|
}
|
|
605
621
|
// Inline function 'kotlinx.io.checkByteCount' call
|
|
606
622
|
// Inline function 'kotlin.require' call
|
|
607
623
|
if (!(byteCount >= 0n)) {
|
|
608
624
|
var message_0 = 'byteCount (' + byteCount.toString() + ') < 0';
|
|
609
|
-
throw IllegalArgumentException.
|
|
625
|
+
throw IllegalArgumentException.new_kotlin_IllegalArgumentException_sfqr8_k$(toString(message_0));
|
|
610
626
|
}
|
|
611
627
|
// Inline function 'kotlin.check' call
|
|
612
|
-
if (!(this.
|
|
628
|
+
if (!(this.expectedSegment_1 == null || (this.expectedSegment_1 === this.buffer_1.head_1 && this.expectedPos_1 === ensureNotNull(this.buffer_1.head_1).pos_1))) {
|
|
613
629
|
var message_1 = 'Peek source is invalid because upstream source was used';
|
|
614
|
-
throw IllegalStateException.
|
|
630
|
+
throw IllegalStateException.new_kotlin_IllegalStateException_w47ei6_k$(toString(message_1));
|
|
615
631
|
}
|
|
616
632
|
if (byteCount === 0n)
|
|
617
633
|
return 0n;
|
|
618
634
|
// Inline function 'kotlin.Long.plus' call
|
|
619
|
-
var this_0 = this.
|
|
635
|
+
var this_0 = this.pos_1;
|
|
620
636
|
var tmp$ret$7 = add(this_0, fromInt(1));
|
|
621
|
-
if (!this.
|
|
637
|
+
if (!this.upstream_1.request_hj5jqj_k$(tmp$ret$7))
|
|
622
638
|
return -1n;
|
|
623
|
-
if (this.
|
|
624
|
-
this.
|
|
625
|
-
this.
|
|
639
|
+
if (this.expectedSegment_1 == null && !(this.buffer_1.head_1 == null)) {
|
|
640
|
+
this.expectedSegment_1 = this.buffer_1.head_1;
|
|
641
|
+
this.expectedPos_1 = ensureNotNull(this.buffer_1.head_1).pos_1;
|
|
626
642
|
}
|
|
627
643
|
// Inline function 'kotlin.comparisons.minOf' call
|
|
628
|
-
var b = subtract(this.
|
|
644
|
+
var b = subtract(this.buffer_1.get_size_woubt6_k$(), this.pos_1);
|
|
629
645
|
var toCopy = byteCount <= b ? byteCount : b;
|
|
630
|
-
this.
|
|
631
|
-
this.
|
|
646
|
+
this.buffer_1.copyTo_xutsee_k$(sink, this.pos_1, add(this.pos_1, toCopy));
|
|
647
|
+
this.pos_1 = add(this.pos_1, toCopy);
|
|
632
648
|
return toCopy;
|
|
633
649
|
}
|
|
634
|
-
|
|
635
|
-
this.
|
|
650
|
+
close_yn9xrc_k$() {
|
|
651
|
+
this.closed_1 = true;
|
|
636
652
|
}
|
|
637
653
|
}
|
|
638
654
|
class RealSource {
|
|
639
655
|
constructor(source) {
|
|
640
|
-
this.
|
|
641
|
-
this.
|
|
642
|
-
this.
|
|
656
|
+
this.source_1 = source;
|
|
657
|
+
this.closed_1 = false;
|
|
658
|
+
this.bufferField_1 = new Buffer();
|
|
643
659
|
}
|
|
644
|
-
|
|
645
|
-
return this.
|
|
660
|
+
get_buffer_bmaafd_k$() {
|
|
661
|
+
return this.bufferField_1;
|
|
646
662
|
}
|
|
647
|
-
|
|
663
|
+
readAtMostTo_4oop6l_k$(sink, byteCount) {
|
|
648
664
|
// Inline function 'kotlinx.io.RealSource.checkNotClosed' call
|
|
649
665
|
// Inline function 'kotlin.check' call
|
|
650
|
-
if (!!this.
|
|
666
|
+
if (!!this.closed_1) {
|
|
651
667
|
var message = 'Source is closed.';
|
|
652
|
-
throw IllegalStateException.
|
|
668
|
+
throw IllegalStateException.new_kotlin_IllegalStateException_w47ei6_k$(toString(message));
|
|
653
669
|
}
|
|
654
670
|
// Inline function 'kotlin.require' call
|
|
655
671
|
if (!(byteCount >= 0n)) {
|
|
656
672
|
var message_0 = 'byteCount: ' + byteCount.toString();
|
|
657
|
-
throw IllegalArgumentException.
|
|
673
|
+
throw IllegalArgumentException.new_kotlin_IllegalArgumentException_sfqr8_k$(toString(message_0));
|
|
658
674
|
}
|
|
659
|
-
if (this.
|
|
660
|
-
var read = this.
|
|
675
|
+
if (this.bufferField_1.get_size_woubt6_k$() === 0n) {
|
|
676
|
+
var read = this.source_1.readAtMostTo_4oop6l_k$(this.bufferField_1, 8192n);
|
|
661
677
|
if (read === -1n)
|
|
662
678
|
return -1n;
|
|
663
679
|
}
|
|
664
680
|
// Inline function 'kotlin.comparisons.minOf' call
|
|
665
|
-
var b = this.
|
|
681
|
+
var b = this.bufferField_1.get_size_woubt6_k$();
|
|
666
682
|
var toRead = byteCount <= b ? byteCount : b;
|
|
667
|
-
return this.
|
|
683
|
+
return this.bufferField_1.readAtMostTo_4oop6l_k$(sink, toRead);
|
|
668
684
|
}
|
|
669
|
-
|
|
685
|
+
exhausted_p1jt55_k$() {
|
|
670
686
|
// Inline function 'kotlinx.io.RealSource.checkNotClosed' call
|
|
671
687
|
// Inline function 'kotlin.check' call
|
|
672
|
-
if (!!this.
|
|
688
|
+
if (!!this.closed_1) {
|
|
673
689
|
var message = 'Source is closed.';
|
|
674
|
-
throw IllegalStateException.
|
|
690
|
+
throw IllegalStateException.new_kotlin_IllegalStateException_w47ei6_k$(toString(message));
|
|
675
691
|
}
|
|
676
|
-
return this.
|
|
692
|
+
return this.bufferField_1.exhausted_p1jt55_k$() && this.source_1.readAtMostTo_4oop6l_k$(this.bufferField_1, 8192n) === -1n;
|
|
677
693
|
}
|
|
678
|
-
|
|
679
|
-
if (!this.
|
|
680
|
-
throw EOFException.
|
|
694
|
+
require_37jki9_k$(byteCount) {
|
|
695
|
+
if (!this.request_hj5jqj_k$(byteCount))
|
|
696
|
+
throw EOFException.new_kotlinx_io_EOFException_1f8u0y_k$("Source doesn't contain required number of bytes (" + byteCount.toString() + ').');
|
|
681
697
|
}
|
|
682
|
-
|
|
698
|
+
request_hj5jqj_k$(byteCount) {
|
|
683
699
|
// Inline function 'kotlinx.io.RealSource.checkNotClosed' call
|
|
684
700
|
// Inline function 'kotlin.check' call
|
|
685
|
-
if (!!this.
|
|
701
|
+
if (!!this.closed_1) {
|
|
686
702
|
var message = 'Source is closed.';
|
|
687
|
-
throw IllegalStateException.
|
|
703
|
+
throw IllegalStateException.new_kotlin_IllegalStateException_w47ei6_k$(toString(message));
|
|
688
704
|
}
|
|
689
705
|
// Inline function 'kotlin.require' call
|
|
690
706
|
if (!(byteCount >= 0n)) {
|
|
691
707
|
var message_0 = 'byteCount: ' + byteCount.toString();
|
|
692
|
-
throw IllegalArgumentException.
|
|
708
|
+
throw IllegalArgumentException.new_kotlin_IllegalArgumentException_sfqr8_k$(toString(message_0));
|
|
693
709
|
}
|
|
694
|
-
while (this.
|
|
695
|
-
if (this.
|
|
710
|
+
while (this.bufferField_1.get_size_woubt6_k$() < byteCount) {
|
|
711
|
+
if (this.source_1.readAtMostTo_4oop6l_k$(this.bufferField_1, 8192n) === -1n)
|
|
696
712
|
return false;
|
|
697
713
|
}
|
|
698
714
|
return true;
|
|
699
715
|
}
|
|
700
|
-
|
|
701
|
-
this.
|
|
702
|
-
return this.
|
|
716
|
+
readByte_ectjk2_k$() {
|
|
717
|
+
this.require_37jki9_k$(1n);
|
|
718
|
+
return this.bufferField_1.readByte_ectjk2_k$();
|
|
703
719
|
}
|
|
704
|
-
|
|
720
|
+
readAtMostTo_kub29z_k$(sink, startIndex, endIndex) {
|
|
705
721
|
// Inline function 'kotlinx.io.checkBounds' call
|
|
706
722
|
var size = sink.length;
|
|
707
723
|
checkBounds(fromInt(size), fromInt(startIndex), fromInt(endIndex));
|
|
708
|
-
if (this.
|
|
709
|
-
var read = this.
|
|
724
|
+
if (this.bufferField_1.get_size_woubt6_k$() === 0n) {
|
|
725
|
+
var read = this.source_1.readAtMostTo_4oop6l_k$(this.bufferField_1, 8192n);
|
|
710
726
|
if (read === -1n)
|
|
711
727
|
return -1;
|
|
712
728
|
}
|
|
713
729
|
var tmp0 = endIndex - startIndex | 0;
|
|
714
730
|
// Inline function 'kotlinx.io.minOf' call
|
|
715
|
-
var b = this.
|
|
731
|
+
var b = this.bufferField_1.get_size_woubt6_k$();
|
|
716
732
|
// Inline function 'kotlin.comparisons.minOf' call
|
|
717
733
|
var a = fromInt(tmp0);
|
|
718
734
|
var tmp$ret$1 = a <= b ? a : b;
|
|
719
735
|
var toRead = convertToInt(tmp$ret$1);
|
|
720
|
-
return this.
|
|
736
|
+
return this.bufferField_1.readAtMostTo_kub29z_k$(sink, startIndex, startIndex + toRead | 0);
|
|
721
737
|
}
|
|
722
|
-
|
|
738
|
+
readTo_3vtbf7_k$(sink, byteCount) {
|
|
723
739
|
try {
|
|
724
|
-
this.
|
|
740
|
+
this.require_37jki9_k$(byteCount);
|
|
725
741
|
} catch ($p) {
|
|
726
742
|
if ($p instanceof EOFException) {
|
|
727
743
|
var e = $p;
|
|
728
|
-
sink.
|
|
744
|
+
sink.write_ob3ym3_k$(this.bufferField_1, this.bufferField_1.get_size_woubt6_k$());
|
|
729
745
|
throw e;
|
|
730
746
|
} else {
|
|
731
747
|
throw $p;
|
|
732
748
|
}
|
|
733
749
|
}
|
|
734
|
-
this.
|
|
750
|
+
this.bufferField_1.readTo_3vtbf7_k$(sink, byteCount);
|
|
735
751
|
}
|
|
736
|
-
|
|
752
|
+
transferTo_lu4ka2_k$(sink) {
|
|
737
753
|
var totalBytesWritten = 0n;
|
|
738
|
-
while (!(this.
|
|
739
|
-
var emitByteCount = this.
|
|
754
|
+
while (!(this.source_1.readAtMostTo_4oop6l_k$(this.bufferField_1, 8192n) === -1n)) {
|
|
755
|
+
var emitByteCount = this.bufferField_1.completeSegmentByteCount_46ltjp_k$();
|
|
740
756
|
if (emitByteCount > 0n) {
|
|
741
757
|
totalBytesWritten = add(totalBytesWritten, emitByteCount);
|
|
742
|
-
sink.
|
|
758
|
+
sink.write_ob3ym3_k$(this.bufferField_1, emitByteCount);
|
|
743
759
|
}
|
|
744
760
|
}
|
|
745
|
-
if (this.
|
|
746
|
-
totalBytesWritten = add(totalBytesWritten, this.
|
|
747
|
-
sink.
|
|
761
|
+
if (this.bufferField_1.get_size_woubt6_k$() > 0n) {
|
|
762
|
+
totalBytesWritten = add(totalBytesWritten, this.bufferField_1.get_size_woubt6_k$());
|
|
763
|
+
sink.write_ob3ym3_k$(this.bufferField_1, this.bufferField_1.get_size_woubt6_k$());
|
|
748
764
|
}
|
|
749
765
|
return totalBytesWritten;
|
|
750
766
|
}
|
|
751
|
-
|
|
752
|
-
this.
|
|
753
|
-
return this.
|
|
767
|
+
readShort_ilpyey_k$() {
|
|
768
|
+
this.require_37jki9_k$(2n);
|
|
769
|
+
return this.bufferField_1.readShort_ilpyey_k$();
|
|
754
770
|
}
|
|
755
|
-
|
|
756
|
-
this.
|
|
757
|
-
return this.
|
|
771
|
+
readLong_ecnd8u_k$() {
|
|
772
|
+
this.require_37jki9_k$(8n);
|
|
773
|
+
return this.bufferField_1.readLong_ecnd8u_k$();
|
|
758
774
|
}
|
|
759
|
-
|
|
775
|
+
peek_21nx7_k$() {
|
|
760
776
|
// Inline function 'kotlinx.io.RealSource.checkNotClosed' call
|
|
761
777
|
// Inline function 'kotlin.check' call
|
|
762
|
-
if (!!this.
|
|
778
|
+
if (!!this.closed_1) {
|
|
763
779
|
var message = 'Source is closed.';
|
|
764
|
-
throw IllegalStateException.
|
|
780
|
+
throw IllegalStateException.new_kotlin_IllegalStateException_w47ei6_k$(toString(message));
|
|
765
781
|
}
|
|
766
782
|
return buffered(new PeekSource(this));
|
|
767
783
|
}
|
|
768
|
-
|
|
769
|
-
if (this.
|
|
784
|
+
close_yn9xrc_k$() {
|
|
785
|
+
if (this.closed_1)
|
|
770
786
|
return Unit_instance;
|
|
771
|
-
this.
|
|
772
|
-
this.
|
|
773
|
-
this.
|
|
787
|
+
this.closed_1 = true;
|
|
788
|
+
this.source_1.close_yn9xrc_k$();
|
|
789
|
+
this.bufferField_1.clear_j9egeb_k$();
|
|
774
790
|
}
|
|
775
791
|
toString() {
|
|
776
|
-
return 'buffered(' + toString(this.
|
|
792
|
+
return 'buffered(' + toString(this.source_1) + ')';
|
|
777
793
|
}
|
|
778
794
|
}
|
|
779
795
|
class Companion {
|
|
780
796
|
constructor() {
|
|
781
|
-
this.
|
|
782
|
-
this.
|
|
797
|
+
this.SIZE_1 = 8192;
|
|
798
|
+
this.SHARE_MINIMUM_1 = 1024;
|
|
783
799
|
}
|
|
784
|
-
|
|
785
|
-
return Segment.
|
|
800
|
+
new_79u2a0_k$() {
|
|
801
|
+
return Segment.new_kotlinx_io_Segment_7zufdr_k$();
|
|
786
802
|
}
|
|
787
803
|
}
|
|
788
804
|
class Segment {
|
|
789
|
-
|
|
790
|
-
var tmp0_safe_receiver = this.
|
|
791
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
805
|
+
get_shared_lt0222_k$() {
|
|
806
|
+
var tmp0_safe_receiver = this.copyTracker_1;
|
|
807
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.get_shared_jgtlda_k$();
|
|
792
808
|
return tmp1_elvis_lhs == null ? false : tmp1_elvis_lhs;
|
|
793
809
|
}
|
|
794
|
-
static
|
|
810
|
+
static new_kotlinx_io_Segment_7zufdr_k$() {
|
|
795
811
|
var $this = createThis(this);
|
|
796
812
|
init_kotlinx_io_Segment($this);
|
|
797
|
-
$this.
|
|
798
|
-
$this.
|
|
799
|
-
$this.
|
|
813
|
+
$this.data_1 = new Int8Array(8192);
|
|
814
|
+
$this.owner_1 = true;
|
|
815
|
+
$this.copyTracker_1 = null;
|
|
800
816
|
return $this;
|
|
801
817
|
}
|
|
802
|
-
static
|
|
818
|
+
static new_kotlinx_io_Segment_athlzy_k$(data, pos, limit, shareToken, owner) {
|
|
803
819
|
var $this = createThis(this);
|
|
804
820
|
init_kotlinx_io_Segment($this);
|
|
805
|
-
$this.
|
|
806
|
-
$this.
|
|
807
|
-
$this.
|
|
808
|
-
$this.
|
|
809
|
-
$this.
|
|
821
|
+
$this.data_1 = data;
|
|
822
|
+
$this.pos_1 = pos;
|
|
823
|
+
$this.limit_1 = limit;
|
|
824
|
+
$this.copyTracker_1 = shareToken;
|
|
825
|
+
$this.owner_1 = owner;
|
|
810
826
|
return $this;
|
|
811
827
|
}
|
|
812
|
-
|
|
813
|
-
var tmp0_elvis_lhs = this.
|
|
828
|
+
sharedCopy_efss0u_k$() {
|
|
829
|
+
var tmp0_elvis_lhs = this.copyTracker_1;
|
|
814
830
|
var tmp;
|
|
815
831
|
if (tmp0_elvis_lhs == null) {
|
|
816
832
|
// Inline function 'kotlin.also' call
|
|
817
|
-
var this_0 = SegmentPool_instance.
|
|
818
|
-
this.
|
|
833
|
+
var this_0 = SegmentPool_instance.tracker_hnhzgo_k$();
|
|
834
|
+
this.copyTracker_1 = this_0;
|
|
819
835
|
tmp = this_0;
|
|
820
836
|
} else {
|
|
821
837
|
tmp = tmp0_elvis_lhs;
|
|
822
838
|
}
|
|
823
839
|
var t = tmp;
|
|
824
|
-
var tmp_0 = this.
|
|
825
|
-
var tmp_1 = this.
|
|
840
|
+
var tmp_0 = this.pos_1;
|
|
841
|
+
var tmp_1 = this.limit_1;
|
|
826
842
|
// Inline function 'kotlin.also' call
|
|
827
|
-
t.
|
|
828
|
-
return Segment.
|
|
843
|
+
t.addCopy_6z3v8m_k$();
|
|
844
|
+
return Segment.new_kotlinx_io_Segment_athlzy_k$(this.data_1, tmp_0, tmp_1, t, false);
|
|
829
845
|
}
|
|
830
|
-
|
|
831
|
-
var result = this.
|
|
832
|
-
if (!(this.
|
|
833
|
-
ensureNotNull(this.
|
|
846
|
+
pop_417547_k$() {
|
|
847
|
+
var result = this.next_1;
|
|
848
|
+
if (!(this.prev_1 == null)) {
|
|
849
|
+
ensureNotNull(this.prev_1).next_1 = this.next_1;
|
|
834
850
|
}
|
|
835
|
-
if (!(this.
|
|
836
|
-
ensureNotNull(this.
|
|
851
|
+
if (!(this.next_1 == null)) {
|
|
852
|
+
ensureNotNull(this.next_1).prev_1 = this.prev_1;
|
|
837
853
|
}
|
|
838
|
-
this.
|
|
839
|
-
this.
|
|
854
|
+
this.next_1 = null;
|
|
855
|
+
this.prev_1 = null;
|
|
840
856
|
return result;
|
|
841
857
|
}
|
|
842
|
-
|
|
843
|
-
segment.
|
|
844
|
-
segment.
|
|
845
|
-
if (!(this.
|
|
846
|
-
ensureNotNull(this.
|
|
858
|
+
push_h69db4_k$(segment) {
|
|
859
|
+
segment.prev_1 = this;
|
|
860
|
+
segment.next_1 = this.next_1;
|
|
861
|
+
if (!(this.next_1 == null)) {
|
|
862
|
+
ensureNotNull(this.next_1).prev_1 = segment;
|
|
847
863
|
}
|
|
848
|
-
this.
|
|
864
|
+
this.next_1 = segment;
|
|
849
865
|
return segment;
|
|
850
866
|
}
|
|
851
|
-
|
|
867
|
+
split_p6jwdi_k$(byteCount) {
|
|
852
868
|
// Inline function 'kotlin.require' call
|
|
853
|
-
if (!(byteCount > 0 && byteCount <= (this.
|
|
869
|
+
if (!(byteCount > 0 && byteCount <= (this.limit_1 - this.pos_1 | 0))) {
|
|
854
870
|
var message = 'byteCount out of range';
|
|
855
|
-
throw IllegalArgumentException.
|
|
871
|
+
throw IllegalArgumentException.new_kotlin_IllegalArgumentException_sfqr8_k$(toString(message));
|
|
856
872
|
}
|
|
857
873
|
var prefix;
|
|
858
874
|
if (byteCount >= 1024) {
|
|
859
|
-
prefix = this.
|
|
875
|
+
prefix = this.sharedCopy_efss0u_k$();
|
|
860
876
|
} else {
|
|
861
|
-
prefix = SegmentPool_instance.
|
|
862
|
-
var tmp0 = this.
|
|
863
|
-
var tmp2 = prefix.
|
|
864
|
-
var tmp5 = this.
|
|
877
|
+
prefix = SegmentPool_instance.take_2451j_k$();
|
|
878
|
+
var tmp0 = this.data_1;
|
|
879
|
+
var tmp2 = prefix.data_1;
|
|
880
|
+
var tmp5 = this.pos_1;
|
|
865
881
|
// Inline function 'kotlin.collections.copyInto' call
|
|
866
|
-
var endIndex = this.
|
|
882
|
+
var endIndex = this.pos_1 + byteCount | 0;
|
|
867
883
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
868
884
|
// Inline function 'kotlin.js.asDynamic' call
|
|
869
885
|
var tmp = tmp0;
|
|
@@ -871,57 +887,57 @@ class Segment {
|
|
|
871
887
|
// Inline function 'kotlin.js.asDynamic' call
|
|
872
888
|
arrayCopy(tmp, tmp2, 0, tmp5, endIndex);
|
|
873
889
|
}
|
|
874
|
-
prefix.
|
|
875
|
-
this.
|
|
876
|
-
if (!(this.
|
|
877
|
-
ensureNotNull(this.
|
|
890
|
+
prefix.limit_1 = prefix.pos_1 + byteCount | 0;
|
|
891
|
+
this.pos_1 = this.pos_1 + byteCount | 0;
|
|
892
|
+
if (!(this.prev_1 == null)) {
|
|
893
|
+
ensureNotNull(this.prev_1).push_h69db4_k$(prefix);
|
|
878
894
|
} else {
|
|
879
|
-
prefix.
|
|
880
|
-
this.
|
|
895
|
+
prefix.next_1 = this;
|
|
896
|
+
this.prev_1 = prefix;
|
|
881
897
|
}
|
|
882
898
|
return prefix;
|
|
883
899
|
}
|
|
884
|
-
|
|
900
|
+
compact_he236d_k$() {
|
|
885
901
|
// Inline function 'kotlin.check' call
|
|
886
|
-
if (!!(this.
|
|
902
|
+
if (!!(this.prev_1 == null)) {
|
|
887
903
|
var message = 'cannot compact';
|
|
888
|
-
throw IllegalStateException.
|
|
904
|
+
throw IllegalStateException.new_kotlin_IllegalStateException_w47ei6_k$(toString(message));
|
|
889
905
|
}
|
|
890
|
-
if (!ensureNotNull(this.
|
|
906
|
+
if (!ensureNotNull(this.prev_1).owner_1)
|
|
891
907
|
return this;
|
|
892
|
-
var byteCount = this.
|
|
893
|
-
var availableByteCount = (8192 - ensureNotNull(this.
|
|
908
|
+
var byteCount = this.limit_1 - this.pos_1 | 0;
|
|
909
|
+
var availableByteCount = (8192 - ensureNotNull(this.prev_1).limit_1 | 0) + (ensureNotNull(this.prev_1).get_shared_lt0222_k$() ? 0 : ensureNotNull(this.prev_1).pos_1) | 0;
|
|
894
910
|
if (byteCount > availableByteCount)
|
|
895
911
|
return this;
|
|
896
|
-
var predecessor = this.
|
|
897
|
-
this.
|
|
898
|
-
var successor = this.
|
|
912
|
+
var predecessor = this.prev_1;
|
|
913
|
+
this.writeTo_vgyea0_k$(ensureNotNull(predecessor), byteCount);
|
|
914
|
+
var successor = this.pop_417547_k$();
|
|
899
915
|
// Inline function 'kotlin.check' call
|
|
900
916
|
if (!(successor == null)) {
|
|
901
|
-
throw IllegalStateException.
|
|
917
|
+
throw IllegalStateException.new_kotlin_IllegalStateException_w47ei6_k$('Check failed.');
|
|
902
918
|
}
|
|
903
|
-
SegmentPool_instance.
|
|
919
|
+
SegmentPool_instance.recycle_3mobff_k$(this);
|
|
904
920
|
return predecessor;
|
|
905
921
|
}
|
|
906
|
-
|
|
907
|
-
var _unary__edvuaz = this.
|
|
908
|
-
this.
|
|
909
|
-
this.
|
|
922
|
+
writeByte_naaedl_k$(byte) {
|
|
923
|
+
var _unary__edvuaz = this.limit_1;
|
|
924
|
+
this.limit_1 = _unary__edvuaz + 1 | 0;
|
|
925
|
+
this.data_1[_unary__edvuaz] = byte;
|
|
910
926
|
}
|
|
911
|
-
|
|
912
|
-
var data = this.
|
|
913
|
-
var limit = this.
|
|
927
|
+
writeShort_n1l1d9_k$(short) {
|
|
928
|
+
var data = this.data_1;
|
|
929
|
+
var limit = this.limit_1;
|
|
914
930
|
var _unary__edvuaz = limit;
|
|
915
931
|
limit = _unary__edvuaz + 1 | 0;
|
|
916
932
|
data[_unary__edvuaz] = toByte((short >>> 8 | 0) & 255);
|
|
917
933
|
var _unary__edvuaz_0 = limit;
|
|
918
934
|
limit = _unary__edvuaz_0 + 1 | 0;
|
|
919
935
|
data[_unary__edvuaz_0] = toByte(short & 255);
|
|
920
|
-
this.
|
|
936
|
+
this.limit_1 = limit;
|
|
921
937
|
}
|
|
922
|
-
|
|
923
|
-
var data = this.
|
|
924
|
-
var limit = this.
|
|
938
|
+
writeInt_6bnyio_k$(int) {
|
|
939
|
+
var data = this.data_1;
|
|
940
|
+
var limit = this.limit_1;
|
|
925
941
|
var _unary__edvuaz = limit;
|
|
926
942
|
limit = _unary__edvuaz + 1 | 0;
|
|
927
943
|
data[_unary__edvuaz] = toByte((int >>> 24 | 0) & 255);
|
|
@@ -934,11 +950,11 @@ class Segment {
|
|
|
934
950
|
var _unary__edvuaz_2 = limit;
|
|
935
951
|
limit = _unary__edvuaz_2 + 1 | 0;
|
|
936
952
|
data[_unary__edvuaz_2] = toByte(int & 255);
|
|
937
|
-
this.
|
|
953
|
+
this.limit_1 = limit;
|
|
938
954
|
}
|
|
939
|
-
|
|
940
|
-
var data = this.
|
|
941
|
-
var limit = this.
|
|
955
|
+
writeLong_g7btux_k$(long) {
|
|
956
|
+
var data = this.data_1;
|
|
957
|
+
var limit = this.limit_1;
|
|
942
958
|
var _unary__edvuaz = limit;
|
|
943
959
|
limit = _unary__edvuaz + 1 | 0;
|
|
944
960
|
data[_unary__edvuaz] = convertToByte(shiftRightUnsigned(long, 56) & 255n);
|
|
@@ -963,16 +979,16 @@ class Segment {
|
|
|
963
979
|
var _unary__edvuaz_6 = limit;
|
|
964
980
|
limit = _unary__edvuaz_6 + 1 | 0;
|
|
965
981
|
data[_unary__edvuaz_6] = convertToByte(long & 255n);
|
|
966
|
-
this.
|
|
982
|
+
this.limit_1 = limit;
|
|
967
983
|
}
|
|
968
|
-
|
|
969
|
-
var _unary__edvuaz = this.
|
|
970
|
-
this.
|
|
971
|
-
return this.
|
|
984
|
+
readByte_newmca_k$() {
|
|
985
|
+
var _unary__edvuaz = this.pos_1;
|
|
986
|
+
this.pos_1 = _unary__edvuaz + 1 | 0;
|
|
987
|
+
return this.data_1[_unary__edvuaz];
|
|
972
988
|
}
|
|
973
|
-
|
|
974
|
-
var data = this.
|
|
975
|
-
var pos = this.
|
|
989
|
+
readShort_7b409e_k$() {
|
|
990
|
+
var data = this.data_1;
|
|
991
|
+
var pos = this.pos_1;
|
|
976
992
|
var _unary__edvuaz = pos;
|
|
977
993
|
pos = _unary__edvuaz + 1 | 0;
|
|
978
994
|
// Inline function 'kotlinx.io.and' call
|
|
@@ -982,12 +998,12 @@ class Segment {
|
|
|
982
998
|
// Inline function 'kotlinx.io.and' call
|
|
983
999
|
var tmp$ret$1 = data[_unary__edvuaz_0] & 255;
|
|
984
1000
|
var s = toShort(tmp | tmp$ret$1);
|
|
985
|
-
this.
|
|
1001
|
+
this.pos_1 = pos;
|
|
986
1002
|
return s;
|
|
987
1003
|
}
|
|
988
|
-
|
|
989
|
-
var data = this.
|
|
990
|
-
var pos = this.
|
|
1004
|
+
readInt_wxtzen_k$() {
|
|
1005
|
+
var data = this.data_1;
|
|
1006
|
+
var pos = this.pos_1;
|
|
991
1007
|
var _unary__edvuaz = pos;
|
|
992
1008
|
pos = _unary__edvuaz + 1 | 0;
|
|
993
1009
|
// Inline function 'kotlinx.io.and' call
|
|
@@ -1004,12 +1020,12 @@ class Segment {
|
|
|
1004
1020
|
pos = _unary__edvuaz_2 + 1 | 0;
|
|
1005
1021
|
// Inline function 'kotlinx.io.and' call
|
|
1006
1022
|
var i = tmp_1 | data[_unary__edvuaz_2] & 255;
|
|
1007
|
-
this.
|
|
1023
|
+
this.pos_1 = pos;
|
|
1008
1024
|
return i;
|
|
1009
1025
|
}
|
|
1010
|
-
|
|
1011
|
-
var data = this.
|
|
1012
|
-
var pos = this.
|
|
1026
|
+
readLong_ud3obe_k$() {
|
|
1027
|
+
var data = this.data_1;
|
|
1028
|
+
var pos = this.pos_1;
|
|
1013
1029
|
var _unary__edvuaz = pos;
|
|
1014
1030
|
pos = _unary__edvuaz + 1 | 0;
|
|
1015
1031
|
// Inline function 'kotlinx.io.and' call
|
|
@@ -1057,106 +1073,106 @@ class Segment {
|
|
|
1057
1073
|
// Inline function 'kotlinx.io.and' call
|
|
1058
1074
|
var this_7 = data[_unary__edvuaz_6];
|
|
1059
1075
|
var v = tmp_5 | fromInt(this_7) & 255n;
|
|
1060
|
-
this.
|
|
1076
|
+
this.pos_1 = pos;
|
|
1061
1077
|
return v;
|
|
1062
1078
|
}
|
|
1063
|
-
|
|
1079
|
+
writeTo_vgyea0_k$(sink, byteCount) {
|
|
1064
1080
|
// Inline function 'kotlin.check' call
|
|
1065
|
-
if (!sink.
|
|
1081
|
+
if (!sink.owner_1) {
|
|
1066
1082
|
var message = 'only owner can write';
|
|
1067
|
-
throw IllegalStateException.
|
|
1068
|
-
}
|
|
1069
|
-
if ((sink.
|
|
1070
|
-
if (sink.
|
|
1071
|
-
throw IllegalArgumentException.
|
|
1072
|
-
if (((sink.
|
|
1073
|
-
throw IllegalArgumentException.
|
|
1074
|
-
var tmp0 = sink.
|
|
1075
|
-
var tmp2 = sink.
|
|
1076
|
-
var tmp5 = sink.
|
|
1083
|
+
throw IllegalStateException.new_kotlin_IllegalStateException_w47ei6_k$(toString(message));
|
|
1084
|
+
}
|
|
1085
|
+
if ((sink.limit_1 + byteCount | 0) > 8192) {
|
|
1086
|
+
if (sink.get_shared_lt0222_k$())
|
|
1087
|
+
throw IllegalArgumentException.new_kotlin_IllegalArgumentException_pv5o3f_k$();
|
|
1088
|
+
if (((sink.limit_1 + byteCount | 0) - sink.pos_1 | 0) > 8192)
|
|
1089
|
+
throw IllegalArgumentException.new_kotlin_IllegalArgumentException_pv5o3f_k$();
|
|
1090
|
+
var tmp0 = sink.data_1;
|
|
1091
|
+
var tmp2 = sink.data_1;
|
|
1092
|
+
var tmp5 = sink.pos_1;
|
|
1077
1093
|
// Inline function 'kotlin.collections.copyInto' call
|
|
1078
|
-
var endIndex = sink.
|
|
1094
|
+
var endIndex = sink.limit_1;
|
|
1079
1095
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
1080
1096
|
// Inline function 'kotlin.js.asDynamic' call
|
|
1081
1097
|
var tmp = tmp0;
|
|
1082
1098
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
1083
1099
|
// Inline function 'kotlin.js.asDynamic' call
|
|
1084
1100
|
arrayCopy(tmp, tmp2, 0, tmp5, endIndex);
|
|
1085
|
-
sink.
|
|
1086
|
-
sink.
|
|
1101
|
+
sink.limit_1 = sink.limit_1 - sink.pos_1 | 0;
|
|
1102
|
+
sink.pos_1 = 0;
|
|
1087
1103
|
}
|
|
1088
|
-
var tmp0_0 = this.
|
|
1089
|
-
var tmp2_0 = sink.
|
|
1090
|
-
var tmp4 = sink.
|
|
1091
|
-
var tmp6 = this.
|
|
1104
|
+
var tmp0_0 = this.data_1;
|
|
1105
|
+
var tmp2_0 = sink.data_1;
|
|
1106
|
+
var tmp4 = sink.limit_1;
|
|
1107
|
+
var tmp6 = this.pos_1;
|
|
1092
1108
|
// Inline function 'kotlin.collections.copyInto' call
|
|
1093
|
-
var endIndex_0 = this.
|
|
1109
|
+
var endIndex_0 = this.pos_1 + byteCount | 0;
|
|
1094
1110
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
1095
1111
|
// Inline function 'kotlin.js.asDynamic' call
|
|
1096
1112
|
var tmp_0 = tmp0_0;
|
|
1097
1113
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
1098
1114
|
// Inline function 'kotlin.js.asDynamic' call
|
|
1099
1115
|
arrayCopy(tmp_0, tmp2_0, tmp4, tmp6, endIndex_0);
|
|
1100
|
-
sink.
|
|
1101
|
-
this.
|
|
1116
|
+
sink.limit_1 = sink.limit_1 + byteCount | 0;
|
|
1117
|
+
this.pos_1 = this.pos_1 + byteCount | 0;
|
|
1102
1118
|
}
|
|
1103
|
-
|
|
1119
|
+
readTo_7avxxz_k$(dst, dstStartOffset, dstEndOffset) {
|
|
1104
1120
|
var len = dstEndOffset - dstStartOffset | 0;
|
|
1105
|
-
var tmp0 = this.
|
|
1106
|
-
var tmp6 = this.
|
|
1121
|
+
var tmp0 = this.data_1;
|
|
1122
|
+
var tmp6 = this.pos_1;
|
|
1107
1123
|
// Inline function 'kotlin.collections.copyInto' call
|
|
1108
|
-
var endIndex = this.
|
|
1124
|
+
var endIndex = this.pos_1 + len | 0;
|
|
1109
1125
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
1110
1126
|
// Inline function 'kotlin.js.asDynamic' call
|
|
1111
1127
|
var tmp = tmp0;
|
|
1112
1128
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
1113
1129
|
// Inline function 'kotlin.js.asDynamic' call
|
|
1114
1130
|
arrayCopy(tmp, dst, dstStartOffset, tmp6, endIndex);
|
|
1115
|
-
this.
|
|
1131
|
+
this.pos_1 = this.pos_1 + len | 0;
|
|
1116
1132
|
}
|
|
1117
|
-
|
|
1118
|
-
var tmp2 = this.
|
|
1133
|
+
write_j6nfmf_k$(src, srcStartOffset, srcEndOffset) {
|
|
1134
|
+
var tmp2 = this.data_1;
|
|
1119
1135
|
// Inline function 'kotlin.collections.copyInto' call
|
|
1120
|
-
var destinationOffset = this.
|
|
1136
|
+
var destinationOffset = this.limit_1;
|
|
1121
1137
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
1122
1138
|
// Inline function 'kotlin.js.asDynamic' call
|
|
1123
1139
|
var tmp = src;
|
|
1124
1140
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
1125
1141
|
// Inline function 'kotlin.js.asDynamic' call
|
|
1126
1142
|
arrayCopy(tmp, tmp2, destinationOffset, srcStartOffset, srcEndOffset);
|
|
1127
|
-
this.
|
|
1143
|
+
this.limit_1 = this.limit_1 + (srcEndOffset - srcStartOffset | 0) | 0;
|
|
1128
1144
|
}
|
|
1129
|
-
|
|
1130
|
-
return this.
|
|
1145
|
+
get_size_woubt6_k$() {
|
|
1146
|
+
return this.limit_1 - this.pos_1 | 0;
|
|
1131
1147
|
}
|
|
1132
|
-
|
|
1133
|
-
return this.
|
|
1148
|
+
get_remainingCapacity_c94947_k$() {
|
|
1149
|
+
return this.data_1.length - this.limit_1 | 0;
|
|
1134
1150
|
}
|
|
1135
|
-
|
|
1136
|
-
return this.
|
|
1151
|
+
dataAsByteArray_g1m4im_k$(readOnly) {
|
|
1152
|
+
return this.data_1;
|
|
1137
1153
|
}
|
|
1138
|
-
|
|
1139
|
-
return this.
|
|
1154
|
+
getUnchecked_g7gmig_k$(index) {
|
|
1155
|
+
return this.data_1[this.pos_1 + index | 0];
|
|
1140
1156
|
}
|
|
1141
|
-
|
|
1142
|
-
this.
|
|
1157
|
+
setUnchecked_5zbo2s_k$(index, value) {
|
|
1158
|
+
this.data_1[this.limit_1 + index | 0] = value;
|
|
1143
1159
|
}
|
|
1144
|
-
|
|
1145
|
-
var d = this.
|
|
1146
|
-
var l = this.
|
|
1160
|
+
setUnchecked_fqg8f0_k$(index, b0, b1) {
|
|
1161
|
+
var d = this.data_1;
|
|
1162
|
+
var l = this.limit_1;
|
|
1147
1163
|
d[l + index | 0] = b0;
|
|
1148
1164
|
d[(l + index | 0) + 1 | 0] = b1;
|
|
1149
1165
|
}
|
|
1150
|
-
|
|
1151
|
-
var d = this.
|
|
1152
|
-
var l = this.
|
|
1166
|
+
setUnchecked_lebl98_k$(index, b0, b1, b2) {
|
|
1167
|
+
var d = this.data_1;
|
|
1168
|
+
var l = this.limit_1;
|
|
1153
1169
|
d[l + index | 0] = b0;
|
|
1154
1170
|
d[(l + index | 0) + 1 | 0] = b1;
|
|
1155
1171
|
d[(l + index | 0) + 2 | 0] = b2;
|
|
1156
1172
|
}
|
|
1157
|
-
|
|
1158
|
-
var d = this.
|
|
1159
|
-
var l = this.
|
|
1173
|
+
setUnchecked_8pgckc_k$(index, b0, b1, b2, b3) {
|
|
1174
|
+
var d = this.data_1;
|
|
1175
|
+
var l = this.limit_1;
|
|
1160
1176
|
d[l + index | 0] = b0;
|
|
1161
1177
|
d[(l + index | 0) + 1 | 0] = b1;
|
|
1162
1178
|
d[(l + index | 0) + 2 | 0] = b2;
|
|
@@ -1170,78 +1186,78 @@ class AlwaysSharedCopyTracker extends SegmentCopyTracker {
|
|
|
1170
1186
|
super();
|
|
1171
1187
|
AlwaysSharedCopyTracker_instance = this;
|
|
1172
1188
|
}
|
|
1173
|
-
|
|
1189
|
+
get_shared_jgtlda_k$() {
|
|
1174
1190
|
return true;
|
|
1175
1191
|
}
|
|
1176
|
-
|
|
1192
|
+
addCopy_6z3v8m_k$() {
|
|
1177
1193
|
return Unit_instance;
|
|
1178
1194
|
}
|
|
1179
1195
|
}
|
|
1180
1196
|
class UnsafeBufferOperations {}
|
|
1181
1197
|
class SegmentReadContextImpl$1 {
|
|
1182
|
-
|
|
1183
|
-
return segment.
|
|
1198
|
+
getUnchecked_akrbjy_k$(segment, offset) {
|
|
1199
|
+
return segment.getUnchecked_g7gmig_k$(offset);
|
|
1184
1200
|
}
|
|
1185
1201
|
}
|
|
1186
1202
|
class SegmentWriteContextImpl$1 {
|
|
1187
|
-
|
|
1188
|
-
segment.
|
|
1203
|
+
setUnchecked_b2f64i_k$(segment, offset, value) {
|
|
1204
|
+
segment.setUnchecked_5zbo2s_k$(offset, value);
|
|
1189
1205
|
}
|
|
1190
|
-
|
|
1191
|
-
segment.
|
|
1206
|
+
setUnchecked_3svw1y_k$(segment, offset, b0, b1) {
|
|
1207
|
+
segment.setUnchecked_fqg8f0_k$(offset, b0, b1);
|
|
1192
1208
|
}
|
|
1193
|
-
|
|
1194
|
-
segment.
|
|
1209
|
+
setUnchecked_ofazem_k$(segment, offset, b0, b1, b2) {
|
|
1210
|
+
segment.setUnchecked_lebl98_k$(offset, b0, b1, b2);
|
|
1195
1211
|
}
|
|
1196
|
-
|
|
1197
|
-
segment.
|
|
1212
|
+
setUnchecked_7scgvu_k$(segment, offset, b0, b1, b2, b3) {
|
|
1213
|
+
segment.setUnchecked_8pgckc_k$(offset, b0, b1, b2, b3);
|
|
1198
1214
|
}
|
|
1199
1215
|
}
|
|
1200
1216
|
class BufferIterationContextImpl$1 {
|
|
1201
|
-
|
|
1202
|
-
return get_SegmentReadContextImpl().
|
|
1217
|
+
getUnchecked_akrbjy_k$(segment, offset) {
|
|
1218
|
+
return get_SegmentReadContextImpl().getUnchecked_akrbjy_k$(segment, offset);
|
|
1203
1219
|
}
|
|
1204
1220
|
}
|
|
1205
1221
|
class IOException extends Exception {
|
|
1206
|
-
static
|
|
1207
|
-
var $this = this.
|
|
1222
|
+
static new_kotlinx_io_IOException_28biy1_k$() {
|
|
1223
|
+
var $this = this.new_kotlin_Exception_f32mds_k$();
|
|
1208
1224
|
init_kotlinx_io_IOException($this);
|
|
1209
1225
|
return $this;
|
|
1210
1226
|
}
|
|
1211
|
-
static
|
|
1212
|
-
var $this = this.
|
|
1227
|
+
static new_kotlinx_io_IOException_wvwdyo_k$(message) {
|
|
1228
|
+
var $this = this.new_kotlin_Exception_hsqbop_k$(message);
|
|
1213
1229
|
init_kotlinx_io_IOException($this);
|
|
1214
1230
|
return $this;
|
|
1215
1231
|
}
|
|
1216
|
-
static
|
|
1217
|
-
var $this = this.
|
|
1232
|
+
static new_kotlinx_io_IOException_pmronu_k$(message, cause) {
|
|
1233
|
+
var $this = this.new_kotlin_Exception_9qyiel_k$(message, cause);
|
|
1218
1234
|
init_kotlinx_io_IOException($this);
|
|
1219
1235
|
return $this;
|
|
1220
1236
|
}
|
|
1221
1237
|
}
|
|
1222
1238
|
class EOFException extends IOException {
|
|
1223
|
-
static
|
|
1224
|
-
var $this = this.
|
|
1239
|
+
static new_kotlinx_io_EOFException_pc0t1h_k$() {
|
|
1240
|
+
var $this = this.new_kotlinx_io_IOException_28biy1_k$();
|
|
1225
1241
|
init_kotlinx_io_EOFException($this);
|
|
1226
1242
|
return $this;
|
|
1227
1243
|
}
|
|
1228
|
-
static
|
|
1229
|
-
var $this = this.
|
|
1244
|
+
static new_kotlinx_io_EOFException_1f8u0y_k$(message) {
|
|
1245
|
+
var $this = this.new_kotlinx_io_IOException_wvwdyo_k$(message);
|
|
1230
1246
|
init_kotlinx_io_EOFException($this);
|
|
1231
1247
|
return $this;
|
|
1232
1248
|
}
|
|
1233
1249
|
}
|
|
1234
1250
|
class SegmentPool {
|
|
1235
1251
|
constructor() {
|
|
1236
|
-
this.
|
|
1237
|
-
this.
|
|
1252
|
+
this.MAX_SIZE_1 = 0;
|
|
1253
|
+
this.byteCount_1 = 0;
|
|
1238
1254
|
}
|
|
1239
|
-
|
|
1240
|
-
return Companion_instance.
|
|
1255
|
+
take_2451j_k$() {
|
|
1256
|
+
return Companion_instance.new_79u2a0_k$();
|
|
1241
1257
|
}
|
|
1242
|
-
|
|
1258
|
+
recycle_3mobff_k$(segment) {
|
|
1243
1259
|
}
|
|
1244
|
-
|
|
1260
|
+
tracker_hnhzgo_k$() {
|
|
1245
1261
|
return AlwaysSharedCopyTracker_getInstance();
|
|
1246
1262
|
}
|
|
1247
1263
|
}
|
|
@@ -1254,16 +1270,16 @@ var HEX_DIGIT_CHARS;
|
|
|
1254
1270
|
function checkBounds(size, startIndex, endIndex) {
|
|
1255
1271
|
_init_properties__Util_kt__g8tcl9();
|
|
1256
1272
|
if (startIndex < 0n || endIndex > size) {
|
|
1257
|
-
throw IndexOutOfBoundsException.
|
|
1273
|
+
throw IndexOutOfBoundsException.new_kotlin_IndexOutOfBoundsException_ddr8db_k$('startIndex (' + startIndex.toString() + ') and endIndex (' + endIndex.toString() + ') are not within the range [0..size(' + size.toString() + '))');
|
|
1258
1274
|
}
|
|
1259
1275
|
if (startIndex > endIndex) {
|
|
1260
|
-
throw IllegalArgumentException.
|
|
1276
|
+
throw IllegalArgumentException.new_kotlin_IllegalArgumentException_sfqr8_k$('startIndex (' + startIndex.toString() + ') > endIndex (' + endIndex.toString() + ')');
|
|
1261
1277
|
}
|
|
1262
1278
|
}
|
|
1263
1279
|
function checkOffsetAndCount(size, offset, byteCount) {
|
|
1264
1280
|
_init_properties__Util_kt__g8tcl9();
|
|
1265
1281
|
if (offset < 0n || offset > size || subtract(size, offset) < byteCount || byteCount < 0n) {
|
|
1266
|
-
throw IllegalArgumentException.
|
|
1282
|
+
throw IllegalArgumentException.new_kotlin_IllegalArgumentException_sfqr8_k$('offset (' + offset.toString() + ') and byteCount (' + byteCount.toString() + ') are not within the range [0..size(' + size.toString() + '))');
|
|
1267
1283
|
}
|
|
1268
1284
|
}
|
|
1269
1285
|
var properties_initialized__Util_kt_67kc5b;
|
|
@@ -1275,20 +1291,20 @@ function _init_properties__Util_kt__g8tcl9() {
|
|
|
1275
1291
|
}
|
|
1276
1292
|
}
|
|
1277
1293
|
function throwEof($this, byteCount) {
|
|
1278
|
-
throw EOFException.
|
|
1294
|
+
throw EOFException.new_kotlinx_io_EOFException_1f8u0y_k$("Buffer doesn't contain required number of bytes (size: " + $this.get_size_woubt6_k$().toString() + ', required: ' + byteCount.toString() + ')');
|
|
1279
1295
|
}
|
|
1280
1296
|
function indexOf(_this__u8e3s4, byte, startIndex, endIndex) {
|
|
1281
1297
|
startIndex = startIndex === VOID ? 0n : startIndex;
|
|
1282
|
-
endIndex = endIndex === VOID ? _this__u8e3s4.
|
|
1298
|
+
endIndex = endIndex === VOID ? _this__u8e3s4.get_size_woubt6_k$() : endIndex;
|
|
1283
1299
|
// Inline function 'kotlin.comparisons.minOf' call
|
|
1284
|
-
var b = _this__u8e3s4.
|
|
1300
|
+
var b = _this__u8e3s4.get_size_woubt6_k$();
|
|
1285
1301
|
var endOffset = endIndex <= b ? endIndex : b;
|
|
1286
|
-
checkBounds(_this__u8e3s4.
|
|
1302
|
+
checkBounds(_this__u8e3s4.get_size_woubt6_k$(), startIndex, endOffset);
|
|
1287
1303
|
if (startIndex === endOffset)
|
|
1288
1304
|
return -1n;
|
|
1289
1305
|
$l$block_1: {
|
|
1290
1306
|
// Inline function 'kotlinx.io.seek' call
|
|
1291
|
-
if (_this__u8e3s4.
|
|
1307
|
+
if (_this__u8e3s4.head_1 == null) {
|
|
1292
1308
|
if (-1n === -1n) {
|
|
1293
1309
|
return -1n;
|
|
1294
1310
|
}
|
|
@@ -1297,14 +1313,14 @@ function indexOf(_this__u8e3s4, byte, startIndex, endIndex) {
|
|
|
1297
1313
|
do {
|
|
1298
1314
|
// Inline function 'kotlin.check' call
|
|
1299
1315
|
if (!(endOffset > offset)) {
|
|
1300
|
-
throw IllegalStateException.
|
|
1316
|
+
throw IllegalStateException.new_kotlin_IllegalStateException_w47ei6_k$('Check failed.');
|
|
1301
1317
|
}
|
|
1302
1318
|
ensureNotNull(segment);
|
|
1303
1319
|
var tmp = segment;
|
|
1304
1320
|
// Inline function 'kotlin.comparisons.maxOf' call
|
|
1305
1321
|
var a = convertToInt(subtract(startIndex, offset));
|
|
1306
1322
|
var tmp_0 = Math.max(a, 0);
|
|
1307
|
-
var tmp0 = segment.
|
|
1323
|
+
var tmp0 = segment.get_size_woubt6_k$();
|
|
1308
1324
|
// Inline function 'kotlin.comparisons.minOf' call
|
|
1309
1325
|
var b_0 = convertToInt(subtract(endOffset, offset));
|
|
1310
1326
|
var tmp$ret$5 = Math.min(tmp0, b_0);
|
|
@@ -1314,21 +1330,21 @@ function indexOf(_this__u8e3s4, byte, startIndex, endIndex) {
|
|
|
1314
1330
|
}
|
|
1315
1331
|
var tmp0_0 = offset;
|
|
1316
1332
|
// Inline function 'kotlin.Long.plus' call
|
|
1317
|
-
var other = segment.
|
|
1333
|
+
var other = segment.get_size_woubt6_k$();
|
|
1318
1334
|
offset = add(tmp0_0, fromInt(other));
|
|
1319
|
-
segment = segment.
|
|
1335
|
+
segment = segment.next_1;
|
|
1320
1336
|
}
|
|
1321
1337
|
while (!(segment == null) && offset < endOffset);
|
|
1322
1338
|
return -1n;
|
|
1323
1339
|
}
|
|
1324
|
-
if (subtract(_this__u8e3s4.
|
|
1325
|
-
var s = _this__u8e3s4.
|
|
1326
|
-
var offset_0 = _this__u8e3s4.
|
|
1340
|
+
if (subtract(_this__u8e3s4.get_size_woubt6_k$(), startIndex) < startIndex) {
|
|
1341
|
+
var s = _this__u8e3s4.tail_1;
|
|
1342
|
+
var offset_0 = _this__u8e3s4.get_size_woubt6_k$();
|
|
1327
1343
|
$l$loop: while (!(s == null) && offset_0 > startIndex) {
|
|
1328
|
-
offset_0 = subtract(offset_0, fromInt(s.
|
|
1344
|
+
offset_0 = subtract(offset_0, fromInt(s.limit_1 - s.pos_1 | 0));
|
|
1329
1345
|
if (offset_0 <= startIndex)
|
|
1330
1346
|
break $l$loop;
|
|
1331
|
-
s = s.
|
|
1347
|
+
s = s.prev_1;
|
|
1332
1348
|
}
|
|
1333
1349
|
var tmp0_1 = s;
|
|
1334
1350
|
var o = offset_0;
|
|
@@ -1340,14 +1356,14 @@ function indexOf(_this__u8e3s4, byte, startIndex, endIndex) {
|
|
|
1340
1356
|
do {
|
|
1341
1357
|
// Inline function 'kotlin.check' call
|
|
1342
1358
|
if (!(endOffset > offset_1)) {
|
|
1343
|
-
throw IllegalStateException.
|
|
1359
|
+
throw IllegalStateException.new_kotlin_IllegalStateException_w47ei6_k$('Check failed.');
|
|
1344
1360
|
}
|
|
1345
1361
|
ensureNotNull(segment_0);
|
|
1346
1362
|
var tmp_1 = segment_0;
|
|
1347
1363
|
// Inline function 'kotlin.comparisons.maxOf' call
|
|
1348
1364
|
var a_0 = convertToInt(subtract(startIndex, offset_1));
|
|
1349
1365
|
var tmp_2 = Math.max(a_0, 0);
|
|
1350
|
-
var tmp0_2 = segment_0.
|
|
1366
|
+
var tmp0_2 = segment_0.get_size_woubt6_k$();
|
|
1351
1367
|
// Inline function 'kotlin.comparisons.minOf' call
|
|
1352
1368
|
var b_1 = convertToInt(subtract(endOffset, offset_1));
|
|
1353
1369
|
var tmp$ret$10 = Math.min(tmp0_2, b_1);
|
|
@@ -1357,23 +1373,23 @@ function indexOf(_this__u8e3s4, byte, startIndex, endIndex) {
|
|
|
1357
1373
|
}
|
|
1358
1374
|
var tmp0_3 = offset_1;
|
|
1359
1375
|
// Inline function 'kotlin.Long.plus' call
|
|
1360
|
-
var other_0 = segment_0.
|
|
1376
|
+
var other_0 = segment_0.get_size_woubt6_k$();
|
|
1361
1377
|
offset_1 = add(tmp0_3, fromInt(other_0));
|
|
1362
|
-
segment_0 = segment_0.
|
|
1378
|
+
segment_0 = segment_0.next_1;
|
|
1363
1379
|
}
|
|
1364
1380
|
while (!(segment_0 == null) && offset_1 < endOffset);
|
|
1365
1381
|
return -1n;
|
|
1366
1382
|
} else {
|
|
1367
|
-
var s_0 = _this__u8e3s4.
|
|
1383
|
+
var s_0 = _this__u8e3s4.head_1;
|
|
1368
1384
|
var offset_2 = 0n;
|
|
1369
1385
|
$l$loop_0: while (!(s_0 == null)) {
|
|
1370
1386
|
var tmp0_4 = offset_2;
|
|
1371
1387
|
// Inline function 'kotlin.Long.plus' call
|
|
1372
|
-
var other_1 = s_0.
|
|
1388
|
+
var other_1 = s_0.limit_1 - s_0.pos_1 | 0;
|
|
1373
1389
|
var nextOffset = add(tmp0_4, fromInt(other_1));
|
|
1374
1390
|
if (nextOffset > startIndex)
|
|
1375
1391
|
break $l$loop_0;
|
|
1376
|
-
s_0 = s_0.
|
|
1392
|
+
s_0 = s_0.next_1;
|
|
1377
1393
|
offset_2 = nextOffset;
|
|
1378
1394
|
}
|
|
1379
1395
|
var tmp0_5 = s_0;
|
|
@@ -1386,14 +1402,14 @@ function indexOf(_this__u8e3s4, byte, startIndex, endIndex) {
|
|
|
1386
1402
|
do {
|
|
1387
1403
|
// Inline function 'kotlin.check' call
|
|
1388
1404
|
if (!(endOffset > offset_3)) {
|
|
1389
|
-
throw IllegalStateException.
|
|
1405
|
+
throw IllegalStateException.new_kotlin_IllegalStateException_w47ei6_k$('Check failed.');
|
|
1390
1406
|
}
|
|
1391
1407
|
ensureNotNull(segment_1);
|
|
1392
1408
|
var tmp_3 = segment_1;
|
|
1393
1409
|
// Inline function 'kotlin.comparisons.maxOf' call
|
|
1394
1410
|
var a_1 = convertToInt(subtract(startIndex, offset_3));
|
|
1395
1411
|
var tmp_4 = Math.max(a_1, 0);
|
|
1396
|
-
var tmp0_6 = segment_1.
|
|
1412
|
+
var tmp0_6 = segment_1.get_size_woubt6_k$();
|
|
1397
1413
|
// Inline function 'kotlin.comparisons.minOf' call
|
|
1398
1414
|
var b_2 = convertToInt(subtract(endOffset, offset_3));
|
|
1399
1415
|
var tmp$ret$16 = Math.min(tmp0_6, b_2);
|
|
@@ -1403,9 +1419,9 @@ function indexOf(_this__u8e3s4, byte, startIndex, endIndex) {
|
|
|
1403
1419
|
}
|
|
1404
1420
|
var tmp0_7 = offset_3;
|
|
1405
1421
|
// Inline function 'kotlin.Long.plus' call
|
|
1406
|
-
var other_2 = segment_1.
|
|
1422
|
+
var other_2 = segment_1.get_size_woubt6_k$();
|
|
1407
1423
|
offset_3 = add(tmp0_7, fromInt(other_2));
|
|
1408
|
-
segment_1 = segment_1.
|
|
1424
|
+
segment_1 = segment_1.next_1;
|
|
1409
1425
|
}
|
|
1410
1426
|
while (!(segment_1 == null) && offset_3 < endOffset);
|
|
1411
1427
|
return -1n;
|
|
@@ -1413,7 +1429,7 @@ function indexOf(_this__u8e3s4, byte, startIndex, endIndex) {
|
|
|
1413
1429
|
}
|
|
1414
1430
|
}
|
|
1415
1431
|
function readByteString(_this__u8e3s4, byteCount) {
|
|
1416
|
-
return UnsafeByteStringOperations_instance.
|
|
1432
|
+
return UnsafeByteStringOperations_instance.wrapUnsafe_3fobxs_k$(readByteArray_0(_this__u8e3s4, byteCount));
|
|
1417
1433
|
}
|
|
1418
1434
|
function buffered(_this__u8e3s4) {
|
|
1419
1435
|
return new RealSource(_this__u8e3s4);
|
|
@@ -1423,15 +1439,15 @@ function Companion_getInstance() {
|
|
|
1423
1439
|
return Companion_instance;
|
|
1424
1440
|
}
|
|
1425
1441
|
function init_kotlinx_io_Segment(_this__u8e3s4) {
|
|
1426
|
-
_this__u8e3s4.
|
|
1427
|
-
_this__u8e3s4.
|
|
1428
|
-
_this__u8e3s4.
|
|
1429
|
-
_this__u8e3s4.
|
|
1430
|
-
_this__u8e3s4.
|
|
1431
|
-
_this__u8e3s4.
|
|
1442
|
+
_this__u8e3s4.pos_1 = 0;
|
|
1443
|
+
_this__u8e3s4.limit_1 = 0;
|
|
1444
|
+
_this__u8e3s4.copyTracker_1 = null;
|
|
1445
|
+
_this__u8e3s4.owner_1 = false;
|
|
1446
|
+
_this__u8e3s4.next_1 = null;
|
|
1447
|
+
_this__u8e3s4.prev_1 = null;
|
|
1432
1448
|
}
|
|
1433
1449
|
function isEmpty(_this__u8e3s4) {
|
|
1434
|
-
return _this__u8e3s4.
|
|
1450
|
+
return _this__u8e3s4.get_size_woubt6_k$() === 0;
|
|
1435
1451
|
}
|
|
1436
1452
|
var AlwaysSharedCopyTracker_instance;
|
|
1437
1453
|
function AlwaysSharedCopyTracker_getInstance() {
|
|
@@ -1441,17 +1457,17 @@ function AlwaysSharedCopyTracker_getInstance() {
|
|
|
1441
1457
|
}
|
|
1442
1458
|
function indexOf_0(_this__u8e3s4, byte, startOffset, endOffset) {
|
|
1443
1459
|
// Inline function 'kotlin.require' call
|
|
1444
|
-
if (!(0 <= startOffset ? startOffset < _this__u8e3s4.
|
|
1460
|
+
if (!(0 <= startOffset ? startOffset < _this__u8e3s4.get_size_woubt6_k$() : false)) {
|
|
1445
1461
|
var message = '' + startOffset;
|
|
1446
|
-
throw IllegalArgumentException.
|
|
1462
|
+
throw IllegalArgumentException.new_kotlin_IllegalArgumentException_sfqr8_k$(toString(message));
|
|
1447
1463
|
}
|
|
1448
1464
|
// Inline function 'kotlin.require' call
|
|
1449
|
-
if (!(startOffset <= endOffset ? endOffset <= _this__u8e3s4.
|
|
1465
|
+
if (!(startOffset <= endOffset ? endOffset <= _this__u8e3s4.get_size_woubt6_k$() : false)) {
|
|
1450
1466
|
var message_0 = '' + endOffset;
|
|
1451
|
-
throw IllegalArgumentException.
|
|
1467
|
+
throw IllegalArgumentException.new_kotlin_IllegalArgumentException_sfqr8_k$(toString(message_0));
|
|
1452
1468
|
}
|
|
1453
|
-
var p = _this__u8e3s4.
|
|
1454
|
-
var data = _this__u8e3s4.
|
|
1469
|
+
var p = _this__u8e3s4.pos_1;
|
|
1470
|
+
var data = _this__u8e3s4.dataAsByteArray_g1m4im_k$(true);
|
|
1455
1471
|
var inductionVariable = startOffset;
|
|
1456
1472
|
if (inductionVariable < endOffset)
|
|
1457
1473
|
do {
|
|
@@ -1469,7 +1485,7 @@ function writeUByte(_this__u8e3s4, byte) {
|
|
|
1469
1485
|
_init_properties_Sinks_kt__92ml72();
|
|
1470
1486
|
// Inline function 'kotlin.UByte.toByte' call
|
|
1471
1487
|
var tmp$ret$0 = _UByte___get_data__impl__jof9qr(byte);
|
|
1472
|
-
_this__u8e3s4.
|
|
1488
|
+
_this__u8e3s4.writeByte_9ih3z3_k$(tmp$ret$0);
|
|
1473
1489
|
}
|
|
1474
1490
|
function writeUShortLe(_this__u8e3s4, short) {
|
|
1475
1491
|
_init_properties_Sinks_kt__92ml72();
|
|
@@ -1485,11 +1501,11 @@ function writeULongLe(_this__u8e3s4, long) {
|
|
|
1485
1501
|
}
|
|
1486
1502
|
function writeLongLe(_this__u8e3s4, long) {
|
|
1487
1503
|
_init_properties_Sinks_kt__92ml72();
|
|
1488
|
-
_this__u8e3s4.
|
|
1504
|
+
_this__u8e3s4.writeLong_vk8q1z_k$(reverseBytes(long));
|
|
1489
1505
|
}
|
|
1490
1506
|
function writeShortLe(_this__u8e3s4, short) {
|
|
1491
1507
|
_init_properties_Sinks_kt__92ml72();
|
|
1492
|
-
_this__u8e3s4.
|
|
1508
|
+
_this__u8e3s4.writeShort_vn2jsb_k$(reverseBytes_0(short));
|
|
1493
1509
|
}
|
|
1494
1510
|
var properties_initialized_Sinks_kt_u7wmts;
|
|
1495
1511
|
function _init_properties_Sinks_kt__92ml72() {
|
|
@@ -1520,7 +1536,7 @@ function readByteArray(_this__u8e3s4) {
|
|
|
1520
1536
|
}
|
|
1521
1537
|
function readUByte(_this__u8e3s4) {
|
|
1522
1538
|
// Inline function 'kotlin.toUByte' call
|
|
1523
|
-
var this_0 = _this__u8e3s4.
|
|
1539
|
+
var this_0 = _this__u8e3s4.readByte_ectjk2_k$();
|
|
1524
1540
|
return _UByte___init__impl__g9hnc4(this_0);
|
|
1525
1541
|
}
|
|
1526
1542
|
function readUShortLe(_this__u8e3s4) {
|
|
@@ -1534,7 +1550,7 @@ function readByteArray_0(_this__u8e3s4, byteCount) {
|
|
|
1534
1550
|
// Inline function 'kotlin.require' call
|
|
1535
1551
|
if (!(byteCount_0 >= 0n)) {
|
|
1536
1552
|
var message = 'byteCount (' + byteCount_0.toString() + ') < 0';
|
|
1537
|
-
throw IllegalArgumentException.
|
|
1553
|
+
throw IllegalArgumentException.new_kotlin_IllegalArgumentException_sfqr8_k$(toString(message));
|
|
1538
1554
|
}
|
|
1539
1555
|
return readByteArrayImpl(_this__u8e3s4, byteCount);
|
|
1540
1556
|
}
|
|
@@ -1544,7 +1560,7 @@ function readULongLe(_this__u8e3s4) {
|
|
|
1544
1560
|
return _ULong___init__impl__c78o9k(this_0);
|
|
1545
1561
|
}
|
|
1546
1562
|
function readLongLe(_this__u8e3s4) {
|
|
1547
|
-
return reverseBytes(_this__u8e3s4.
|
|
1563
|
+
return reverseBytes(_this__u8e3s4.readLong_ecnd8u_k$());
|
|
1548
1564
|
}
|
|
1549
1565
|
function indexOf_1(_this__u8e3s4, byte, startIndex, endIndex) {
|
|
1550
1566
|
startIndex = startIndex === VOID ? 0n : startIndex;
|
|
@@ -1558,7 +1574,7 @@ function indexOf_1(_this__u8e3s4, byte, startIndex, endIndex) {
|
|
|
1558
1574
|
tmp = 'startIndex (' + startIndex.toString() + ') is not within the range [0..endIndex(' + endIndex.toString() + '))';
|
|
1559
1575
|
}
|
|
1560
1576
|
var message = tmp;
|
|
1561
|
-
throw IllegalArgumentException.
|
|
1577
|
+
throw IllegalArgumentException.new_kotlin_IllegalArgumentException_sfqr8_k$(toString(message));
|
|
1562
1578
|
}
|
|
1563
1579
|
if (startIndex === endIndex)
|
|
1564
1580
|
return -1n;
|
|
@@ -1569,23 +1585,23 @@ function indexOf_1(_this__u8e3s4, byte, startIndex, endIndex) {
|
|
|
1569
1585
|
// Inline function 'kotlin.Long.plus' call
|
|
1570
1586
|
var this_0 = offset;
|
|
1571
1587
|
var tmp$ret$2 = add(this_0, fromInt(1));
|
|
1572
|
-
tmp_0 = _this__u8e3s4.
|
|
1588
|
+
tmp_0 = _this__u8e3s4.request_hj5jqj_k$(tmp$ret$2);
|
|
1573
1589
|
} else {
|
|
1574
1590
|
tmp_0 = false;
|
|
1575
1591
|
}
|
|
1576
1592
|
if (!tmp_0) {
|
|
1577
1593
|
break $l$loop;
|
|
1578
1594
|
}
|
|
1579
|
-
var tmp_1 = _this__u8e3s4.
|
|
1595
|
+
var tmp_1 = _this__u8e3s4.get_buffer_bmaafd_k$();
|
|
1580
1596
|
var tmp_2 = offset;
|
|
1581
1597
|
// Inline function 'kotlin.comparisons.minOf' call
|
|
1582
|
-
var b = _this__u8e3s4.
|
|
1598
|
+
var b = _this__u8e3s4.get_buffer_bmaafd_k$().get_size_woubt6_k$();
|
|
1583
1599
|
var tmp$ret$3 = endIndex <= b ? endIndex : b;
|
|
1584
1600
|
var idx = indexOf(tmp_1, byte, tmp_2, tmp$ret$3);
|
|
1585
1601
|
if (!(idx === -1n)) {
|
|
1586
1602
|
return idx;
|
|
1587
1603
|
}
|
|
1588
|
-
offset = _this__u8e3s4.
|
|
1604
|
+
offset = _this__u8e3s4.get_buffer_bmaafd_k$().get_size_woubt6_k$();
|
|
1589
1605
|
}
|
|
1590
1606
|
return -1n;
|
|
1591
1607
|
}
|
|
@@ -1593,26 +1609,26 @@ function readByteArrayImpl(_this__u8e3s4, size) {
|
|
|
1593
1609
|
var arraySize = size;
|
|
1594
1610
|
if (size === -1) {
|
|
1595
1611
|
var fetchSize = 2147483647n;
|
|
1596
|
-
while (_this__u8e3s4.
|
|
1612
|
+
while (_this__u8e3s4.get_buffer_bmaafd_k$().get_size_woubt6_k$() < 2147483647n && _this__u8e3s4.request_hj5jqj_k$(fetchSize)) {
|
|
1597
1613
|
// Inline function 'kotlin.Long.times' call
|
|
1598
1614
|
var this_0 = fetchSize;
|
|
1599
1615
|
fetchSize = multiply(this_0, fromInt(2));
|
|
1600
1616
|
}
|
|
1601
1617
|
// Inline function 'kotlin.check' call
|
|
1602
|
-
if (!(_this__u8e3s4.
|
|
1603
|
-
var message = "Can't create an array of size " + _this__u8e3s4.
|
|
1604
|
-
throw IllegalStateException.
|
|
1618
|
+
if (!(_this__u8e3s4.get_buffer_bmaafd_k$().get_size_woubt6_k$() < 2147483647n)) {
|
|
1619
|
+
var message = "Can't create an array of size " + _this__u8e3s4.get_buffer_bmaafd_k$().get_size_woubt6_k$().toString();
|
|
1620
|
+
throw IllegalStateException.new_kotlin_IllegalStateException_w47ei6_k$(toString(message));
|
|
1605
1621
|
}
|
|
1606
|
-
arraySize = convertToInt(_this__u8e3s4.
|
|
1622
|
+
arraySize = convertToInt(_this__u8e3s4.get_buffer_bmaafd_k$().get_size_woubt6_k$());
|
|
1607
1623
|
} else {
|
|
1608
|
-
_this__u8e3s4.
|
|
1624
|
+
_this__u8e3s4.require_37jki9_k$(fromInt(size));
|
|
1609
1625
|
}
|
|
1610
1626
|
var array = new Int8Array(arraySize);
|
|
1611
|
-
readTo(_this__u8e3s4.
|
|
1627
|
+
readTo(_this__u8e3s4.get_buffer_bmaafd_k$(), array);
|
|
1612
1628
|
return array;
|
|
1613
1629
|
}
|
|
1614
1630
|
function readShortLe(_this__u8e3s4) {
|
|
1615
|
-
return reverseBytes_0(_this__u8e3s4.
|
|
1631
|
+
return reverseBytes_0(_this__u8e3s4.readShort_ilpyey_k$());
|
|
1616
1632
|
}
|
|
1617
1633
|
function readTo(_this__u8e3s4, sink, startIndex, endIndex) {
|
|
1618
1634
|
startIndex = startIndex === VOID ? 0 : startIndex;
|
|
@@ -1622,20 +1638,23 @@ function readTo(_this__u8e3s4, sink, startIndex, endIndex) {
|
|
|
1622
1638
|
checkBounds(fromInt(size), fromInt(startIndex), fromInt(endIndex));
|
|
1623
1639
|
var offset = startIndex;
|
|
1624
1640
|
while (offset < endIndex) {
|
|
1625
|
-
var bytesRead = _this__u8e3s4.
|
|
1641
|
+
var bytesRead = _this__u8e3s4.readAtMostTo_kub29z_k$(sink, offset, endIndex);
|
|
1626
1642
|
if (bytesRead === -1) {
|
|
1627
|
-
throw EOFException.
|
|
1643
|
+
throw EOFException.new_kotlinx_io_EOFException_1f8u0y_k$('Source exhausted before reading ' + (endIndex - startIndex | 0) + ' bytes. ' + ('Only ' + bytesRead + ' bytes were read.'));
|
|
1628
1644
|
}
|
|
1629
1645
|
offset = offset + bytesRead | 0;
|
|
1630
1646
|
}
|
|
1631
1647
|
}
|
|
1632
1648
|
function readString(_this__u8e3s4, byteCount) {
|
|
1633
|
-
_this__u8e3s4.
|
|
1634
|
-
return commonReadUtf8(_this__u8e3s4.
|
|
1649
|
+
_this__u8e3s4.require_37jki9_k$(byteCount);
|
|
1650
|
+
return commonReadUtf8(_this__u8e3s4.get_buffer_bmaafd_k$(), byteCount);
|
|
1635
1651
|
}
|
|
1636
1652
|
function readString_0(_this__u8e3s4) {
|
|
1637
|
-
_this__u8e3s4.
|
|
1638
|
-
|
|
1653
|
+
return commonReadUtf8(_this__u8e3s4, _this__u8e3s4.get_size_woubt6_k$());
|
|
1654
|
+
}
|
|
1655
|
+
function readString_1(_this__u8e3s4) {
|
|
1656
|
+
_this__u8e3s4.request_hj5jqj_k$(9223372036854775807n);
|
|
1657
|
+
return commonReadUtf8(_this__u8e3s4.get_buffer_bmaafd_k$(), _this__u8e3s4.get_buffer_bmaafd_k$().get_size_woubt6_k$());
|
|
1639
1658
|
}
|
|
1640
1659
|
function writeString(_this__u8e3s4, string, startIndex, endIndex) {
|
|
1641
1660
|
startIndex = startIndex === VOID ? 0 : startIndex;
|
|
@@ -1645,7 +1664,7 @@ function writeString(_this__u8e3s4, string, startIndex, endIndex) {
|
|
|
1645
1664
|
checkBounds(fromInt(size), fromInt(startIndex), fromInt(endIndex));
|
|
1646
1665
|
// Inline function 'kotlinx.io.writeToInternalBuffer' call
|
|
1647
1666
|
// Inline function 'kotlinx.io.commonWriteUtf8' call
|
|
1648
|
-
var this_0 = _this__u8e3s4.
|
|
1667
|
+
var this_0 = _this__u8e3s4.get_buffer_bmaafd_k$();
|
|
1649
1668
|
var i = startIndex;
|
|
1650
1669
|
while (i < endIndex) {
|
|
1651
1670
|
var p0 = i;
|
|
@@ -1655,15 +1674,15 @@ function writeString(_this__u8e3s4, string, startIndex, endIndex) {
|
|
|
1655
1674
|
if (c < 128) {
|
|
1656
1675
|
$l$block_0: {
|
|
1657
1676
|
// Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.writeToTail' call
|
|
1658
|
-
var tail = this_0.
|
|
1677
|
+
var tail = this_0.writableSegment_voqx71_k$(1);
|
|
1659
1678
|
var ctx = get_SegmentWriteContextImpl();
|
|
1660
1679
|
var segmentOffset = -i | 0;
|
|
1661
1680
|
// Inline function 'kotlin.comparisons.minOf' call
|
|
1662
|
-
var b = i + tail.
|
|
1681
|
+
var b = i + tail.get_remainingCapacity_c94947_k$() | 0;
|
|
1663
1682
|
var runLimit = Math.min(endIndex, b);
|
|
1664
1683
|
var _unary__edvuaz = i;
|
|
1665
1684
|
i = _unary__edvuaz + 1 | 0;
|
|
1666
|
-
ctx.
|
|
1685
|
+
ctx.setUnchecked_b2f64i_k$(tail, segmentOffset + _unary__edvuaz | 0, toByte(c));
|
|
1667
1686
|
$l$loop: while (i < runLimit) {
|
|
1668
1687
|
var p0_0 = i;
|
|
1669
1688
|
// Inline function 'kotlin.code' call
|
|
@@ -1673,95 +1692,95 @@ function writeString(_this__u8e3s4, string, startIndex, endIndex) {
|
|
|
1673
1692
|
break $l$loop;
|
|
1674
1693
|
var _unary__edvuaz_0 = i;
|
|
1675
1694
|
i = _unary__edvuaz_0 + 1 | 0;
|
|
1676
|
-
ctx.
|
|
1695
|
+
ctx.setUnchecked_b2f64i_k$(tail, segmentOffset + _unary__edvuaz_0 | 0, toByte(c));
|
|
1677
1696
|
}
|
|
1678
1697
|
var bytesWritten = i + segmentOffset | 0;
|
|
1679
1698
|
if (bytesWritten === 1) {
|
|
1680
|
-
tail.
|
|
1699
|
+
tail.limit_1 = tail.limit_1 + bytesWritten | 0;
|
|
1681
1700
|
var tmp = this_0;
|
|
1682
1701
|
// Inline function 'kotlin.Long.plus' call
|
|
1683
|
-
var this_3 = this_0.
|
|
1684
|
-
tmp.
|
|
1702
|
+
var this_3 = this_0.sizeMut_1;
|
|
1703
|
+
tmp.sizeMut_1 = add(this_3, fromInt(bytesWritten));
|
|
1685
1704
|
break $l$block_0;
|
|
1686
1705
|
}
|
|
1687
1706
|
// Inline function 'kotlin.check' call
|
|
1688
|
-
if (!(0 <= bytesWritten ? bytesWritten <= tail.
|
|
1689
|
-
var message = 'Invalid number of bytes written: ' + bytesWritten + '. Should be in 0..' + tail.
|
|
1690
|
-
throw IllegalStateException.
|
|
1707
|
+
if (!(0 <= bytesWritten ? bytesWritten <= tail.get_remainingCapacity_c94947_k$() : false)) {
|
|
1708
|
+
var message = 'Invalid number of bytes written: ' + bytesWritten + '. Should be in 0..' + tail.get_remainingCapacity_c94947_k$();
|
|
1709
|
+
throw IllegalStateException.new_kotlin_IllegalStateException_w47ei6_k$(toString(message));
|
|
1691
1710
|
}
|
|
1692
1711
|
if (!(bytesWritten === 0)) {
|
|
1693
|
-
tail.
|
|
1712
|
+
tail.limit_1 = tail.limit_1 + bytesWritten | 0;
|
|
1694
1713
|
var tmp_0 = this_0;
|
|
1695
1714
|
// Inline function 'kotlin.Long.plus' call
|
|
1696
|
-
var this_4 = this_0.
|
|
1697
|
-
tmp_0.
|
|
1715
|
+
var this_4 = this_0.sizeMut_1;
|
|
1716
|
+
tmp_0.sizeMut_1 = add(this_4, fromInt(bytesWritten));
|
|
1698
1717
|
break $l$block_0;
|
|
1699
1718
|
}
|
|
1700
1719
|
if (isEmpty(tail)) {
|
|
1701
|
-
this_0.
|
|
1720
|
+
this_0.recycleTail_61sxi3_k$();
|
|
1702
1721
|
}
|
|
1703
1722
|
}
|
|
1704
1723
|
} else if (c < 2048) {
|
|
1705
1724
|
$l$block_2: {
|
|
1706
1725
|
// Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.writeToTail' call
|
|
1707
|
-
var tail_0 = this_0.
|
|
1708
|
-
get_SegmentWriteContextImpl().
|
|
1726
|
+
var tail_0 = this_0.writableSegment_voqx71_k$(2);
|
|
1727
|
+
get_SegmentWriteContextImpl().setUnchecked_3svw1y_k$(tail_0, 0, toByte(c >> 6 | 192), toByte(c & 63 | 128));
|
|
1709
1728
|
var bytesWritten_0 = 2;
|
|
1710
1729
|
if (bytesWritten_0 === 2) {
|
|
1711
|
-
tail_0.
|
|
1730
|
+
tail_0.limit_1 = tail_0.limit_1 + bytesWritten_0 | 0;
|
|
1712
1731
|
var tmp_1 = this_0;
|
|
1713
1732
|
// Inline function 'kotlin.Long.plus' call
|
|
1714
|
-
var this_5 = this_0.
|
|
1715
|
-
tmp_1.
|
|
1733
|
+
var this_5 = this_0.sizeMut_1;
|
|
1734
|
+
tmp_1.sizeMut_1 = add(this_5, fromInt(bytesWritten_0));
|
|
1716
1735
|
break $l$block_2;
|
|
1717
1736
|
}
|
|
1718
1737
|
// Inline function 'kotlin.check' call
|
|
1719
|
-
if (!(0 <= bytesWritten_0 ? bytesWritten_0 <= tail_0.
|
|
1720
|
-
var message_0 = 'Invalid number of bytes written: ' + bytesWritten_0 + '. Should be in 0..' + tail_0.
|
|
1721
|
-
throw IllegalStateException.
|
|
1738
|
+
if (!(0 <= bytesWritten_0 ? bytesWritten_0 <= tail_0.get_remainingCapacity_c94947_k$() : false)) {
|
|
1739
|
+
var message_0 = 'Invalid number of bytes written: ' + bytesWritten_0 + '. Should be in 0..' + tail_0.get_remainingCapacity_c94947_k$();
|
|
1740
|
+
throw IllegalStateException.new_kotlin_IllegalStateException_w47ei6_k$(toString(message_0));
|
|
1722
1741
|
}
|
|
1723
1742
|
if (!(bytesWritten_0 === 0)) {
|
|
1724
|
-
tail_0.
|
|
1743
|
+
tail_0.limit_1 = tail_0.limit_1 + bytesWritten_0 | 0;
|
|
1725
1744
|
var tmp_2 = this_0;
|
|
1726
1745
|
// Inline function 'kotlin.Long.plus' call
|
|
1727
|
-
var this_6 = this_0.
|
|
1728
|
-
tmp_2.
|
|
1746
|
+
var this_6 = this_0.sizeMut_1;
|
|
1747
|
+
tmp_2.sizeMut_1 = add(this_6, fromInt(bytesWritten_0));
|
|
1729
1748
|
break $l$block_2;
|
|
1730
1749
|
}
|
|
1731
1750
|
if (isEmpty(tail_0)) {
|
|
1732
|
-
this_0.
|
|
1751
|
+
this_0.recycleTail_61sxi3_k$();
|
|
1733
1752
|
}
|
|
1734
1753
|
}
|
|
1735
1754
|
i = i + 1 | 0;
|
|
1736
1755
|
} else if (c < 55296 || c > 57343) {
|
|
1737
1756
|
$l$block_4: {
|
|
1738
1757
|
// Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.writeToTail' call
|
|
1739
|
-
var tail_1 = this_0.
|
|
1740
|
-
get_SegmentWriteContextImpl().
|
|
1758
|
+
var tail_1 = this_0.writableSegment_voqx71_k$(3);
|
|
1759
|
+
get_SegmentWriteContextImpl().setUnchecked_ofazem_k$(tail_1, 0, toByte(c >> 12 | 224), toByte(c >> 6 & 63 | 128), toByte(c & 63 | 128));
|
|
1741
1760
|
var bytesWritten_1 = 3;
|
|
1742
1761
|
if (bytesWritten_1 === 3) {
|
|
1743
|
-
tail_1.
|
|
1762
|
+
tail_1.limit_1 = tail_1.limit_1 + bytesWritten_1 | 0;
|
|
1744
1763
|
var tmp_3 = this_0;
|
|
1745
1764
|
// Inline function 'kotlin.Long.plus' call
|
|
1746
|
-
var this_7 = this_0.
|
|
1747
|
-
tmp_3.
|
|
1765
|
+
var this_7 = this_0.sizeMut_1;
|
|
1766
|
+
tmp_3.sizeMut_1 = add(this_7, fromInt(bytesWritten_1));
|
|
1748
1767
|
break $l$block_4;
|
|
1749
1768
|
}
|
|
1750
1769
|
// Inline function 'kotlin.check' call
|
|
1751
|
-
if (!(0 <= bytesWritten_1 ? bytesWritten_1 <= tail_1.
|
|
1752
|
-
var message_1 = 'Invalid number of bytes written: ' + bytesWritten_1 + '. Should be in 0..' + tail_1.
|
|
1753
|
-
throw IllegalStateException.
|
|
1770
|
+
if (!(0 <= bytesWritten_1 ? bytesWritten_1 <= tail_1.get_remainingCapacity_c94947_k$() : false)) {
|
|
1771
|
+
var message_1 = 'Invalid number of bytes written: ' + bytesWritten_1 + '. Should be in 0..' + tail_1.get_remainingCapacity_c94947_k$();
|
|
1772
|
+
throw IllegalStateException.new_kotlin_IllegalStateException_w47ei6_k$(toString(message_1));
|
|
1754
1773
|
}
|
|
1755
1774
|
if (!(bytesWritten_1 === 0)) {
|
|
1756
|
-
tail_1.
|
|
1775
|
+
tail_1.limit_1 = tail_1.limit_1 + bytesWritten_1 | 0;
|
|
1757
1776
|
var tmp_4 = this_0;
|
|
1758
1777
|
// Inline function 'kotlin.Long.plus' call
|
|
1759
|
-
var this_8 = this_0.
|
|
1760
|
-
tmp_4.
|
|
1778
|
+
var this_8 = this_0.sizeMut_1;
|
|
1779
|
+
tmp_4.sizeMut_1 = add(this_8, fromInt(bytesWritten_1));
|
|
1761
1780
|
break $l$block_4;
|
|
1762
1781
|
}
|
|
1763
1782
|
if (isEmpty(tail_1)) {
|
|
1764
|
-
this_0.
|
|
1783
|
+
this_0.recycleTail_61sxi3_k$();
|
|
1765
1784
|
}
|
|
1766
1785
|
}
|
|
1767
1786
|
i = i + 1 | 0;
|
|
@@ -1780,77 +1799,77 @@ function writeString(_this__u8e3s4, string, startIndex, endIndex) {
|
|
|
1780
1799
|
// Inline function 'kotlin.code' call
|
|
1781
1800
|
var this_10 = _Char___init__impl__6a9atx(63);
|
|
1782
1801
|
var tmp$ret$29 = Char__toInt_impl_vasixd(this_10);
|
|
1783
|
-
this_0.
|
|
1802
|
+
this_0.writeByte_9ih3z3_k$(toByte(tmp$ret$29));
|
|
1784
1803
|
i = i + 1 | 0;
|
|
1785
1804
|
} else {
|
|
1786
1805
|
var codePoint = 65536 + ((c & 1023) << 10 | low & 1023) | 0;
|
|
1787
1806
|
$l$block_6: {
|
|
1788
1807
|
// Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.writeToTail' call
|
|
1789
|
-
var tail_2 = this_0.
|
|
1790
|
-
get_SegmentWriteContextImpl().
|
|
1808
|
+
var tail_2 = this_0.writableSegment_voqx71_k$(4);
|
|
1809
|
+
get_SegmentWriteContextImpl().setUnchecked_7scgvu_k$(tail_2, 0, toByte(codePoint >> 18 | 240), toByte(codePoint >> 12 & 63 | 128), toByte(codePoint >> 6 & 63 | 128), toByte(codePoint & 63 | 128));
|
|
1791
1810
|
var bytesWritten_2 = 4;
|
|
1792
1811
|
if (bytesWritten_2 === 4) {
|
|
1793
|
-
tail_2.
|
|
1812
|
+
tail_2.limit_1 = tail_2.limit_1 + bytesWritten_2 | 0;
|
|
1794
1813
|
var tmp_6 = this_0;
|
|
1795
1814
|
// Inline function 'kotlin.Long.plus' call
|
|
1796
|
-
var this_11 = this_0.
|
|
1797
|
-
tmp_6.
|
|
1815
|
+
var this_11 = this_0.sizeMut_1;
|
|
1816
|
+
tmp_6.sizeMut_1 = add(this_11, fromInt(bytesWritten_2));
|
|
1798
1817
|
break $l$block_6;
|
|
1799
1818
|
}
|
|
1800
1819
|
// Inline function 'kotlin.check' call
|
|
1801
|
-
if (!(0 <= bytesWritten_2 ? bytesWritten_2 <= tail_2.
|
|
1802
|
-
var message_2 = 'Invalid number of bytes written: ' + bytesWritten_2 + '. Should be in 0..' + tail_2.
|
|
1803
|
-
throw IllegalStateException.
|
|
1820
|
+
if (!(0 <= bytesWritten_2 ? bytesWritten_2 <= tail_2.get_remainingCapacity_c94947_k$() : false)) {
|
|
1821
|
+
var message_2 = 'Invalid number of bytes written: ' + bytesWritten_2 + '. Should be in 0..' + tail_2.get_remainingCapacity_c94947_k$();
|
|
1822
|
+
throw IllegalStateException.new_kotlin_IllegalStateException_w47ei6_k$(toString(message_2));
|
|
1804
1823
|
}
|
|
1805
1824
|
if (!(bytesWritten_2 === 0)) {
|
|
1806
|
-
tail_2.
|
|
1825
|
+
tail_2.limit_1 = tail_2.limit_1 + bytesWritten_2 | 0;
|
|
1807
1826
|
var tmp_7 = this_0;
|
|
1808
1827
|
// Inline function 'kotlin.Long.plus' call
|
|
1809
|
-
var this_12 = this_0.
|
|
1810
|
-
tmp_7.
|
|
1828
|
+
var this_12 = this_0.sizeMut_1;
|
|
1829
|
+
tmp_7.sizeMut_1 = add(this_12, fromInt(bytesWritten_2));
|
|
1811
1830
|
break $l$block_6;
|
|
1812
1831
|
}
|
|
1813
1832
|
if (isEmpty(tail_2)) {
|
|
1814
|
-
this_0.
|
|
1833
|
+
this_0.recycleTail_61sxi3_k$();
|
|
1815
1834
|
}
|
|
1816
1835
|
}
|
|
1817
1836
|
i = i + 2 | 0;
|
|
1818
1837
|
}
|
|
1819
1838
|
}
|
|
1820
1839
|
}
|
|
1821
|
-
_this__u8e3s4.
|
|
1840
|
+
_this__u8e3s4.hintEmit_6b2e5m_k$();
|
|
1822
1841
|
}
|
|
1823
1842
|
function commonReadUtf8(_this__u8e3s4, byteCount) {
|
|
1824
1843
|
if (byteCount === 0n)
|
|
1825
1844
|
return '';
|
|
1826
1845
|
// Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.forEachSegment' call
|
|
1827
|
-
var curr = _this__u8e3s4.
|
|
1846
|
+
var curr = _this__u8e3s4.head_1;
|
|
1828
1847
|
while (!(curr == null)) {
|
|
1829
1848
|
get_SegmentReadContextImpl();
|
|
1830
|
-
if (fromInt(curr.
|
|
1849
|
+
if (fromInt(curr.get_size_woubt6_k$()) >= byteCount) {
|
|
1831
1850
|
var result = '';
|
|
1832
1851
|
// Inline function 'kotlinx.io.unsafe.withData' call
|
|
1833
|
-
var tmp0 = curr.
|
|
1834
|
-
var tmp2 = curr.
|
|
1835
|
-
var tmp0_0 = curr.
|
|
1852
|
+
var tmp0 = curr.dataAsByteArray_g1m4im_k$(true);
|
|
1853
|
+
var tmp2 = curr.pos_1;
|
|
1854
|
+
var tmp0_0 = curr.limit_1;
|
|
1836
1855
|
// Inline function 'kotlin.math.min' call
|
|
1837
1856
|
var b = tmp2 + convertToInt(byteCount) | 0;
|
|
1838
1857
|
var tmp$ret$4 = Math.min(tmp0_0, b);
|
|
1839
1858
|
result = commonToUtf8String(tmp0, tmp2, tmp$ret$4);
|
|
1840
|
-
_this__u8e3s4.
|
|
1859
|
+
_this__u8e3s4.skip_csbv9x_k$(byteCount);
|
|
1841
1860
|
return result;
|
|
1842
1861
|
}
|
|
1843
1862
|
return commonToUtf8String(readByteArray_0(_this__u8e3s4, convertToInt(byteCount)));
|
|
1844
1863
|
}
|
|
1845
1864
|
// Inline function 'kotlin.error' call
|
|
1846
1865
|
var message = 'Unreacheable';
|
|
1847
|
-
throw IllegalStateException.
|
|
1866
|
+
throw IllegalStateException.new_kotlin_IllegalStateException_w47ei6_k$(toString(message));
|
|
1848
1867
|
}
|
|
1849
1868
|
function commonToUtf8String(_this__u8e3s4, beginIndex, endIndex) {
|
|
1850
1869
|
beginIndex = beginIndex === VOID ? 0 : beginIndex;
|
|
1851
1870
|
endIndex = endIndex === VOID ? _this__u8e3s4.length : endIndex;
|
|
1852
1871
|
if (beginIndex < 0 || endIndex > _this__u8e3s4.length || beginIndex > endIndex) {
|
|
1853
|
-
throw IndexOutOfBoundsException.
|
|
1872
|
+
throw IndexOutOfBoundsException.new_kotlin_IndexOutOfBoundsException_ddr8db_k$('size=' + _this__u8e3s4.length + ' beginIndex=' + beginIndex + ' endIndex=' + endIndex);
|
|
1854
1873
|
}
|
|
1855
1874
|
var chars = charArray(endIndex - beginIndex | 0);
|
|
1856
1875
|
var length = 0;
|
|
@@ -2214,10 +2233,10 @@ function _init_properties_UnsafeBufferOperations_kt__xw75gy() {
|
|
|
2214
2233
|
}
|
|
2215
2234
|
}
|
|
2216
2235
|
function init_kotlinx_io_IOException(_this__u8e3s4) {
|
|
2217
|
-
captureStack(_this__u8e3s4, _this__u8e3s4
|
|
2236
|
+
captureStack(_this__u8e3s4, _this__u8e3s4.$throwableCtor_2);
|
|
2218
2237
|
}
|
|
2219
2238
|
function init_kotlinx_io_EOFException(_this__u8e3s4) {
|
|
2220
|
-
captureStack(_this__u8e3s4, _this__u8e3s4
|
|
2239
|
+
captureStack(_this__u8e3s4, _this__u8e3s4.$throwableCtor_3);
|
|
2221
2240
|
}
|
|
2222
2241
|
var SegmentPool_instance;
|
|
2223
2242
|
function SegmentPool_getInstance() {
|
|
@@ -2236,7 +2255,7 @@ function reverseBytes_0(_this__u8e3s4) {
|
|
|
2236
2255
|
//region block: post-declaration
|
|
2237
2256
|
initMetadataForInterface(Source, 'Source', VOID, VOID, [AutoCloseable]);
|
|
2238
2257
|
initMetadataForInterface(Sink, 'Sink', VOID, VOID, [AutoCloseable]);
|
|
2239
|
-
protoOf(Buffer).
|
|
2258
|
+
protoOf(Buffer).write$default_fa5nq1_k$ = write$default;
|
|
2240
2259
|
initMetadataForClass(Buffer, 'Buffer', Buffer, VOID, [Source, Sink]);
|
|
2241
2260
|
initMetadataForClass(PeekSource, 'PeekSource', VOID, VOID, [AutoCloseable]);
|
|
2242
2261
|
initMetadataForClass(RealSource, 'RealSource', VOID, VOID, [Source]);
|
|
@@ -2248,8 +2267,8 @@ initMetadataForObject(UnsafeBufferOperations, 'UnsafeBufferOperations');
|
|
|
2248
2267
|
initMetadataForClass(SegmentReadContextImpl$1);
|
|
2249
2268
|
initMetadataForClass(SegmentWriteContextImpl$1);
|
|
2250
2269
|
initMetadataForClass(BufferIterationContextImpl$1);
|
|
2251
|
-
initMetadataForClass(IOException, 'IOException', IOException.
|
|
2252
|
-
initMetadataForClass(EOFException, 'EOFException', EOFException.
|
|
2270
|
+
initMetadataForClass(IOException, 'IOException', IOException.new_kotlinx_io_IOException_28biy1_k$);
|
|
2271
|
+
initMetadataForClass(EOFException, 'EOFException', EOFException.new_kotlinx_io_EOFException_pc0t1h_k$);
|
|
2253
2272
|
initMetadataForObject(SegmentPool, 'SegmentPool');
|
|
2254
2273
|
//endregion
|
|
2255
2274
|
//region block: init
|
|
@@ -2268,8 +2287,9 @@ export {
|
|
|
2268
2287
|
readByteArray as readByteArray1ri21h2rciakw,
|
|
2269
2288
|
readByteString as readByteString2hnsbql6t4ads,
|
|
2270
2289
|
readLongLe as readLongLe2rie7ma7nvb8l,
|
|
2271
|
-
|
|
2290
|
+
readString_1 as readString2nvggcfaijfhd,
|
|
2272
2291
|
readString as readString3v6duspiz33tv,
|
|
2292
|
+
readString_0 as readStringo8i62qxt5m4m,
|
|
2273
2293
|
readUByte as readUByte1bk383bbml78s,
|
|
2274
2294
|
readULongLe as readULongLe85hcoxmq2r21,
|
|
2275
2295
|
readUShortLe as readUShortLe2ulpsf04o6sle,
|