# Libraries

**URL:** https://discuss.kotlinlang.org/c/libraries/11.md?page=4

[Latest](https://discuss.kotlinlang.org/latest.md) · [Categories](https://discuss.kotlinlang.org/categories.md)

**Page:** 5

---

## [Why Array.copyOf() is not covariant?](https://discuss.kotlinlang.org/t/why-array-copyof-is-not-covariant/23165)

<div class="topic-metadata">

**Author:** [@broot](https://discuss.kotlinlang.org/u/broot)\
**Replies:** 11\
**Last updated:** [October 24, 2021, 2:35pm UTC](https://discuss.kotlinlang.org/t/why-array-copyof-is-not-covariant/23165 "2021-10-24T14:35:59Z")

</div>

Is there any reason copyOf() was declared as: inline fun \<T\> Array\<T\>.copyOf(): Array\<T\> And not as: inline fun \<T\> Array\<out T\>.copyOf(): Array\<T\> ? It would make possible to “cast” arrays like this: val animals =…

---

## [Property delegates for bidirectional relationships](https://discuss.kotlinlang.org/t/property-delegates-for-bidirectional-relationships/23238)

<div class="topic-metadata">

**Author:** [@thumannw](https://discuss.kotlinlang.org/u/thumannw)\
**Replies:** 6\
**Last updated:** [October 21, 2021, 6:48pm UTC](https://discuss.kotlinlang.org/t/property-delegates-for-bidirectional-relationships/23238 "2021-10-21T18:48:50Z")

</div>

Sometimes a bidirectional relationship between objects is helpful, but maintaining the consistency manually is verbose and error-prone. This seems to be a good use-case for property delegation. Is the following something…

---

## [Idea: Deprecate casting method from signed integer to larger unsigned integer like Short.toUInt()](https://discuss.kotlinlang.org/t/idea-deprecate-casting-method-from-signed-integer-to-larger-unsigned-integer-like-short-touint/22855)

<div class="topic-metadata">

**Author:** [@anatawa12](https://discuss.kotlinlang.org/u/anatawa12)\
**Replies:** 3\
**Last updated:** [October 17, 2021, 8:14am UTC](https://discuss.kotlinlang.org/t/idea-deprecate-casting-method-from-signed-integer-to-larger-unsigned-integer-like-short-touint/22855 "2021-10-17T08:14:37Z")

</div>

I think the behavior of casting method from signed integer to larger unsigned integer like Short.toUInt() is not clear from function name because we can think two behaviors below: cast to larger signed integer the firs…

---

## [Is there a way to add an 'index' (in the DB sense) to a collection?](https://discuss.kotlinlang.org/t/is-there-a-way-to-add-an-index-in-the-db-sense-to-a-collection/23205)

<div class="topic-metadata">

**Author:** [@rollie42](https://discuss.kotlinlang.org/u/rollie42)\
**Replies:** 1\
**Last updated:** [October 15, 2021, 3:48pm UTC](https://discuss.kotlinlang.org/t/is-there-a-way-to-add-an-index-in-the-db-sense-to-a-collection/23205 "2021-10-15T15:48:50Z")

</div>

So say I have a list of all the train stations in the world, like data class Station( val id: Int, val name: Name, val country: Country, ... ) this list might get pretty large, and some common operations on thi…

---

## [Coroutine/Job that doesn't join its children when cancelled](https://discuss.kotlinlang.org/t/coroutine-job-that-doesnt-join-its-children-when-cancelled/23149)

<div class="topic-metadata">

**Author:** [@broot](https://discuss.kotlinlang.org/u/broot)\
**Replies:** 0\
**Last updated:** [October 7, 2021, 2:02pm UTC](https://discuss.kotlinlang.org/t/coroutine-job-that-doesnt-join-its-children-when-cancelled/23149 "2021-10-07T14:02:11Z")

</div>

Hi, sorry for a long post, but this is because I did some research already, I have some initial thoughts and a POC. You may skip uninteresting parts. Short story I’m looking for a legitimate way to abandon my children …

---

## [Coroutines delay() and cancel()](https://discuss.kotlinlang.org/t/coroutines-delay-and-cancel/23116)

<div class="topic-metadata">

**Author:** [@absoluterookie](https://discuss.kotlinlang.org/u/absoluterookie)\
**Replies:** 6\
**Last updated:** [October 7, 2021, 7:06am UTC](https://discuss.kotlinlang.org/t/coroutines-delay-and-cancel/23116 "2021-10-07T07:06:10Z")

</div>

I made a neverending Loop with delay(time) which i need to end by e.g. a click. cancel() seems to be the wrong function for this.

---

## [Kotlinx serialization with Spring Boot](https://discuss.kotlinlang.org/t/kotlinx-serialization-with-spring-boot/16540)

<div class="topic-metadata">

**Author:** [@huggy](https://discuss.kotlinlang.org/u/huggy)\
**Replies:** 16\
**Last updated:** [October 6, 2021, 4:42pm UTC](https://discuss.kotlinlang.org/t/kotlinx-serialization-with-spring-boot/16540 "2021-10-06T16:42:13Z")

</div>

Has anyone tried this? The code that works great with KTOR rest seems to not work correctly on the spring boot side. I am guessing spring-boot is just using Jackson by default. What verbiage can i search for to figure…

---

## [Kotlin/JS and Coroutines solve an issue that isn't really an issue?](https://discuss.kotlinlang.org/t/kotlin-js-and-coroutines-solve-an-issue-that-isnt-really-an-issue/15628)

<div class="topic-metadata">

**Author:** [@avwie](https://discuss.kotlinlang.org/u/avwie)\
**Replies:** 9\
**Last updated:** [September 17, 2021, 3:50pm UTC](https://discuss.kotlinlang.org/t/kotlin-js-and-coroutines-solve-an-issue-that-isnt-really-an-issue/15628 "2021-09-17T15:50:03Z")

</div>

Let me first state that I understand the use-cases for Coroutines in Android Development and the JVM. iOS I have no experience at all, so can’t say anything about it. Another disclaimer: I’ve read quite a lot in the pas…

---

## [Fatal Exception: connection refused (Fuel.get)](https://discuss.kotlinlang.org/t/fatal-exception-connection-refused-fuel-get/20071)

<div class="topic-metadata">

**Author:** [@tony23](https://discuss.kotlinlang.org/u/tony23)\
**Replies:** 1\
**Last updated:** [September 16, 2021, 10:14am UTC](https://discuss.kotlinlang.org/t/fatal-exception-connection-refused-fuel-get/20071 "2021-09-16T10:14:33Z")

</div>

I’m really new to Kotlin and I think it may be inexperience causing my problem, I’m hoping someone can help enlighten me - I have searched everywhere I can think of and have not been able to come up with a solution. I h…

---

## [I am looking for linear algebra library to use with kotlin-idea](https://discuss.kotlinlang.org/t/i-am-looking-for-linear-algebra-library-to-use-with-kotlin-idea/22851)

<div class="topic-metadata">

**Author:** [@leonardo.catalano72](https://discuss.kotlinlang.org/u/leonardo.catalano72)\
**Replies:** 3\
**Last updated:** [September 1, 2021, 1:53pm UTC](https://discuss.kotlinlang.org/t/i-am-looking-for-linear-algebra-library-to-use-with-kotlin-idea/22851 "2021-09-01T13:53:25Z")

</div>

Hi, i need a suggest… I’m looking for a good library to use with kotlin- intellij Idea. I’ve tried Keigen but i don’t able to install Keigen in Idea. I accept suggests.

---

## [Publishers and coroutines hanging issue](https://discuss.kotlinlang.org/t/publishers-and-coroutines-hanging-issue/22836)

<div class="topic-metadata">

**Author:** [@rawilder](https://discuss.kotlinlang.org/u/rawilder)\
**Replies:** 1\
**Last updated:** [September 1, 2021, 5:26am UTC](https://discuss.kotlinlang.org/t/publishers-and-coroutines-hanging-issue/22836 "2021-09-01T05:26:09Z")

</div>

Hello all, I’m am running into a weird blocking issue with Micronaut 3 + kotlinx-coroutines-reactive with streaming file uploads. Here is the code: mn-multi-file-upload/TestController.kt at await-from-flux · rawilder/mn-…

---

## [channelFlow in Kotlin 1.5](https://discuss.kotlinlang.org/t/channelflow-in-kotlin-1-5/22601)

<div class="topic-metadata">

**Author:** [@SdprWeb](https://discuss.kotlinlang.org/u/SdprWeb)\
**Replies:** 0\
**Last updated:** [August 5, 2021, 6:53am UTC](https://discuss.kotlinlang.org/t/channelflow-in-kotlin-1-5/22601 "2021-08-05T06:53:52Z")

</div>

Hi, I’m looking for clarification on the stability of the channelFlow coroutines API. In Kotlin 1.5.0, the channelFlow API was made stable: public fun \<T\> channelFlow(@BuilderInference block: suspend ProducerScope\<T\>.()…

---

## [ES Kotlin - Elasticsearch Query DSL](https://discuss.kotlinlang.org/t/es-kotlin-elasticsearch-query-dsl/9082)

<div class="topic-metadata">

**Author:** [@mbuhot](https://discuss.kotlinlang.org/u/mbuhot)\
**Replies:** 7\
**Last updated:** [July 29, 2021, 6:04pm UTC](https://discuss.kotlinlang.org/t/es-kotlin-elasticsearch-query-dsl/9082 "2021-07-29T18:04:31Z")

</div>

Elasticsearch Query DSL for Kotlin. This library aims to minimize the gap between the Elasticsearch JSON query DSL, and the API used when writing kotlin applications. This integrates with the existing java API, only pro…

---

## [Serialization: exclude nulls with \`encodeToString\` method while \`encodeDefaults = true](https://discuss.kotlinlang.org/t/serialization-exclude-nulls-with-encodetostring-method-while-encodedefaults-true/22416)

<div class="topic-metadata">

**Author:** [@Psijic](https://discuss.kotlinlang.org/u/Psijic)\
**Replies:** 0\
**Last updated:** [July 14, 2021, 6:10pm UTC](https://discuss.kotlinlang.org/t/serialization-exclude-nulls-with-encodetostring-method-while-encodedefaults-true/22416 "2021-07-14T18:10:59Z")

</div>

How is it possible to exclude nulls with encodeToString method while encodeDefaults = true ? Looks like a popular topic .

---

## [Serialization: Json.encodeToString uses only changed variables](https://discuss.kotlinlang.org/t/serialization-json-encodetostring-uses-only-changed-variables/22241)

<div class="topic-metadata">

**Author:** [@Psijic](https://discuss.kotlinlang.org/u/Psijic)\
**Replies:** 3\
**Last updated:** [July 12, 2021, 6:28pm UTC](https://discuss.kotlinlang.org/t/serialization-json-encodetostring-uses-only-changed-variables/22241 "2021-07-12T18:28:15Z")

</div>

Hello. I’m trying to encode a data class this way: Json.encodeToString(RequestData.serializer(), requestData) But in the result I got only changed variables and it doesn’t include all available vars (or vals) val requ…

---

## [ByteStream, BinaryStream | .toBytes()](https://discuss.kotlinlang.org/t/bytestream-binarystream-tobytes/22316)

<div class="topic-metadata">

**Author:** [@LukaXyx](https://discuss.kotlinlang.org/u/LukaXyx)\
**Replies:** 19\
**Last updated:** [July 10, 2021, 12:01pm UTC](https://discuss.kotlinlang.org/t/bytestream-binarystream-tobytes/22316 "2021-07-10T12:01:03Z")

</div>

I was working once with packets and ect and I needed a way to encode my values into a BinaryStream. After some research and frustration I did not manage to find any standard libraries that contain a BinaryStream or somet…

---

## [Kotlin which Frontend](https://discuss.kotlinlang.org/t/kotlin-which-frontend/19600)

<div class="topic-metadata">

**Author:** [@KaijuDeluxe](https://discuss.kotlinlang.org/u/KaijuDeluxe)\
**Replies:** 5\
**Last updated:** [July 2, 2021, 2:10am UTC](https://discuss.kotlinlang.org/t/kotlin-which-frontend/19600 "2021-07-02T02:10:40Z")

</div>

Dear all, i want to try to use Kotlin in our next project. Right now we are using JSF with Primefaces as Frontend and Spring Boot as Backend. I want to make the frontend more lightwight. What framework you can recommen…

---

## [Ktor: JSON data in POST](https://discuss.kotlinlang.org/t/ktor-json-data-in-post/22221)

<div class="topic-metadata">

**Author:** [@Psijic](https://discuss.kotlinlang.org/u/Psijic)\
**Replies:** 6\
**Last updated:** [June 27, 2021, 9:09am UTC](https://discuss.kotlinlang.org/t/ktor-json-data-in-post/22221 "2021-06-27T09:09:24Z")

</div>

Hello, I’m trying to make a POST request with headers and data. inline fun \<reified T\> post(url: String, headersMap: Map\<String, String\>, data: String) = runBlocking { return@runBlocking httpClient.post\<T\>(u…

---

## [Ktor: Different request methods with file uploading](https://discuss.kotlinlang.org/t/ktor-different-request-methods-with-file-uploading/22189)

<div class="topic-metadata">

**Author:** [@Psijic](https://discuss.kotlinlang.org/u/Psijic)\
**Replies:** 8\
**Last updated:** [June 23, 2021, 1:21pm UTC](https://discuss.kotlinlang.org/t/ktor-different-request-methods-with-file-uploading/22189 "2021-06-23T13:21:16Z")

</div>

Hello, I’m trying to upload a JSON file with a PUT method. But can’t find the proper way to do this. Is there a complete documentation? According to this, I need to use httpClient.submitFormWithBinaryData but can’t find …

---

## [Why toSortedMap changing size of the original map?](https://discuss.kotlinlang.org/t/why-tosortedmap-changing-size-of-the-original-map/22111)

<div class="topic-metadata">

**Author:** [@atonamy](https://discuss.kotlinlang.org/u/atonamy)\
**Replies:** 2\
**Last updated:** [June 14, 2021, 11:53am UTC](https://discuss.kotlinlang.org/t/why-tosortedmap-changing-size-of-the-original-map/22111 "2021-06-14T11:53:54Z")

</div>

Let’s review simple example: val map = mapOf\<String, Int\>("test1" to 1, "test2" to 2) val sorted = map.toSortedMap { a, b -\> map\[b\]?.compareTo(map\[a\] ?: 0) ?: 0 } println(sorted) The output will be…

---

## [Issues on loading local maven files](https://discuss.kotlinlang.org/t/issues-on-loading-local-maven-files/22057)

<div class="topic-metadata">

**Author:** [@alzomins](https://discuss.kotlinlang.org/u/alzomins)\
**Replies:** 0\
**Last updated:** [June 7, 2021, 2:56pm UTC](https://discuss.kotlinlang.org/t/issues-on-loading-local-maven-files/22057 "2021-06-07T14:56:51Z")

</div>

Dear All, I am trying to import local files into empty project, but no success. So, I published to local maven multiplatform project, and I want to use generated libs into another multiplatform project. When I set mav…

---

## [Coroutines - going "backwards," other control flow](https://discuss.kotlinlang.org/t/coroutines-going-backwards-other-control-flow/21928)

<div class="topic-metadata">

**Author:** [@frizzil](https://discuss.kotlinlang.org/u/frizzil)\
**Replies:** 1\
**Last updated:** [May 25, 2021, 9:02pm UTC](https://discuss.kotlinlang.org/t/coroutines-going-backwards-other-control-flow/21928 "2021-05-25T21:02:52Z")

</div>

So I have some code for a command-line based flash card memorization app, and the pattern I came up with before discovering coroutines is very reminiscent of how a suspend function would look after compiler transformatio…

---

## [Looking for a library or an alternative for basic multiplatform File I/O](https://discuss.kotlinlang.org/t/looking-for-a-library-or-an-alternative-for-basic-multiplatform-file-i-o/21472)

<div class="topic-metadata">

**Author:** [@raphael.tarita](https://discuss.kotlinlang.org/u/raphael.tarita)\
**Replies:** 7\
**Last updated:** [May 20, 2021, 1:28pm UTC](https://discuss.kotlinlang.org/t/looking-for-a-library-or-an-alternative-for-basic-multiplatform-file-i-o/21472 "2021-05-20T13:28:37Z")

</div>

Hi all, I posted this question recently on the r/Kotlin subreddit (here). Afterwards I thought that I might get better answers here, since I really enjoy this community. I’d be glad if you could help me! I’m trying to …

---

## [Issue with mapTo() on a sequence](https://discuss.kotlinlang.org/t/issue-with-mapto-on-a-sequence/21832)

<div class="topic-metadata">

**Author:** [@sschuberth](https://discuss.kotlinlang.org/u/sschuberth)\
**Replies:** 4\
**Last updated:** [May 16, 2021, 9:51am UTC](https://discuss.kotlinlang.org/t/issue-with-mapto-on-a-sequence/21832 "2021-05-16T09:51:07Z")

</div>

Hi, when writing code like fun main() { val a = mutableListOf\<Int\>() val b = setOf(1, 2, 3).asSequence().mapTo(a) { it \* 2 }.find { it == 4 } println(a) println(b) } I would have assumed that printing a…

---

## [What's an inline constructor in Kotlin?](https://discuss.kotlinlang.org/t/whats-an-inline-constructor-in-kotlin/21699)

<div class="topic-metadata">

**Author:** [@yamin](https://discuss.kotlinlang.org/u/yamin)\
**Replies:** 4\
**Last updated:** [May 15, 2021, 5:38pm UTC](https://discuss.kotlinlang.org/t/whats-an-inline-constructor-in-kotlin/21699 "2021-05-15T17:38:31Z")

</div>

First of all I have to clarify I’m not asking what’s an inline function is or what’s an inline class is. There’s nowhere in Kotlin Language documentation or specification any reference to an inline constructor but if yo…

---

## [Looking for a cron library for KTor](https://discuss.kotlinlang.org/t/looking-for-a-cron-library-for-ktor/21640)

<div class="topic-metadata">

**Author:** [@ideablender](https://discuss.kotlinlang.org/u/ideablender)\
**Replies:** 5\
**Last updated:** [May 12, 2021, 12:23pm UTC](https://discuss.kotlinlang.org/t/looking-for-a-cron-library-for-ktor/21640 "2021-05-12T12:23:53Z")

</div>

Before i re-engineer the wheel has anyone found a great library to do cron like jobs on KTOR?

---

## [KotlinLab: Development of a simple MATLAB like scientific programming environment for Kotlin](https://discuss.kotlinlang.org/t/kotlinlab-development-of-a-simple-matlab-like-scientific-programming-environment-for-kotlin/21794)

<div class="topic-metadata">

**Author:** [@sterg](https://discuss.kotlinlang.org/u/sterg)\
**Replies:** 3\
**Last updated:** [May 11, 2021, 12:37pm UTC](https://discuss.kotlinlang.org/t/kotlinlab-development-of-a-simple-matlab-like-scientific-programming-environment-for-kotlin/21794 "2021-05-11T12:37:45Z")

</div>

I started to develop KotlinLab, a MATLAB like easy to use scientific programming environment, for Kotlin, Perhaps, other Kotlin programmers will be interested in participating and contributing!

---

## [How to build a jar with Kotlin classes for Java Project?](https://discuss.kotlinlang.org/t/how-to-build-a-jar-with-kotlin-classes-for-java-project/21603)

<div class="topic-metadata">

**Author:** [@czjabc](https://discuss.kotlinlang.org/u/czjabc)\
**Replies:** 1\
**Last updated:** [May 4, 2021, 8:35pm UTC](https://discuss.kotlinlang.org/t/how-to-build-a-jar-with-kotlin-classes-for-java-project/21603 "2021-05-04T20:35:21Z")

</div>

Hello guys.How should I configure the build.gradle to make a jar with Kotlin classes for Java Project calling?

---

## [Looking for tutorials/articles on coroutines from a non Android perspective](https://discuss.kotlinlang.org/t/looking-for-tutorials-articles-on-coroutines-from-a-non-android-perspective/21628)

<div class="topic-metadata">

**Author:** [@ideablender](https://discuss.kotlinlang.org/u/ideablender)\
**Replies:** 7\
**Last updated:** [May 2, 2021, 7:21am UTC](https://discuss.kotlinlang.org/t/looking-for-tutorials-articles-on-coroutines-from-a-non-android-perspective/21628 "2021-05-02T07:21:22Z")

</div>

I am one of the rare non android kotlin developers. All of the tutorials on coroutines are usually from an android perspective, has anyone read any great articles or tutorials that are not android focued?

---

## [Exposed and kotlinx-datetime](https://discuss.kotlinlang.org/t/exposed-and-kotlinx-datetime/21677)

<div class="topic-metadata">

**Author:** [@ideablender](https://discuss.kotlinlang.org/u/ideablender)\
**Replies:** 0\
**Last updated:** [April 29, 2021, 3:49pm UTC](https://discuss.kotlinlang.org/t/exposed-and-kotlinx-datetime/21677 "2021-04-29T15:49:40Z")

</div>

I believe the datetime data type is using java time/date is there any plans in adding kotlinx-datetime as a data type for exposed?

[Previous page](https://discuss.kotlinlang.org/c/libraries/11.md?page=3)

[Next page](https://discuss.kotlinlang.org/c/libraries/11.md?page=5)
