altavir
10/17/2019, 7:09 AMaltavir
11/20/2019, 7:06 AMBytes
interface provides input by input
method. The problem is that it could leak an Input that could survive closing of parent Bytes
and will be invalid. I propose to replace it with consumer function like described here: https://github.com/Kotlin/kotlinx-io/issues/71
Also Bytes
has size
function. I can't see a way to change size after creation, so I propose to change it to value and use lazy
delegate to compute it on first call.altavir
11/21/2019, 7:30 AMaltavir
11/25/2019, 2:30 PMaltavir
12/11/2019, 8:24 PMOleg Yukhnevich
12/12/2019, 7:14 PMaltavir
12/20/2019, 4:51 PMBytes
is not a suted to be a temporary data container due to its volatility. I still do want to be able to copy part of input to a temporary storage object which later could be read from as Input and written to output as a whole. We can certainly do it via ByteArray
, but it means additional copy on any such operation.
Instead I am thinking about following thing: we can add additional Binary reading operation into `Input`: By default it reads byte array of given length, but when read from a random-access entity like file or ByteArray
it is overwritten by method that does not copy array, but instead creates a Binary
which references initial structure and holds offset and size. Thus it could be read and written without additional copy.kevin.cianfarini
01/04/2020, 11:23 PMDominaezzz
01/29/2020, 12:07 PMBuffer
now uses a ByteArray
instead of CPointer<ByteVar>
. Is <http://kotlinx.io|kotlinx.io>
still going to provide an abstraction for off-heap memory or should I be looking into implementing my own?Derek Berner
02/03/2020, 10:42 PM<http://kotlinx.io|kotlinx.io>
from a commonMain
sourceset in a MPP project?kevin.cianfarini
02/10/2020, 5:52 PMsockets
module going to be async? If so, is it planned for these async sockets to support TCP/IP backpressure via suspending functions?altavir
02/24/2020, 8:38 AMBytes
though. Will it be possible to use bytes for multi-read operations? The major problem for me so far was that once input is called on Bytes
, it becomes invalid. If this is still the case, I will still need to introduce Binary
for lazy multi-read and I think that the API should be somehow changed to avoid rereading Bytes
object.Dominaezzz
03/11/2020, 12:00 AM<http://kotlinx.io|kotlinx.io>
anymore and there's an io-2
going to be published soon, but can we get one more version of the original kotlinx-io
for 1.3.70?kevin.cianfarini
03/25/2020, 6:41 PMkevin.cianfarini
04/20/2020, 2:12 PMkevin.cianfarini
04/22/2020, 8:43 PMBytes
to go internal, do we plan to have any equivalent to ByteString
from okio? Input doesn't seem to entirely fit the billaltavir
04/24/2020, 8:33 AMidea.active
flag is set in the system. Could you explain what does it mean?Shawn Witte
10/30/2020, 8:35 PMAndrey Martynov
02/09/2021, 8:28 AMaltavir
02/28/2021, 3:30 PMreadBytes
method does not actually advance the input read pointer. Is it intentional?Imran/Malic
08/27/2021, 5:19 AMImran/Malic
01/24/2022, 1:45 PMDidier Villevalois
07/09/2022, 8:53 AMktor-network
socket, (2) parse a message using google-flatbuffers
which contains a packed scalar array, (3) that is itself fed to multik
to make a multi-dimensional array of it. Along all this processing line, it is possible to have a single byte array backing multiple buffers and not have to copy any bytes.
However, it is a lot of work currently because there is no standard buffer API. For instance, google-flatbuffers
is defining their own Buffer API to support this no-copy principle: https://github.com/google/flatbuffers/blob/master/kotlin/flatbuffers-kotlin/src/commonMain/kotlin/com/google/flatbuffers/kotlin/Buffers.kt
In the above-mentioned use-case for instance, I have to implement my own com.google.flatbuffers.kotlin.ReadBuffer
above `ktor-io`'s <http://io.ktor.utils.io|io.ktor.utils.io>.core.ByteReadPacket
, etc
Isn't it time that people from Okio, Ktor and others get together to define a standard Buffer API and revive kotlinx-io
??
(Sorry for the kinda rant but it is a little irritating...)Didier Villevalois
12/21/2022, 11:45 AMWe’re extracting the IO functionality into a separate library. This is a long-standing task that we’ve been working on gradually, and aim to finalize in 2023.❤️ :kotlin-intensifies-purple: @e5l, @Oleg Yukhnevich Will this also include
ktor-network
?Didier Villevalois
12/21/2022, 11:45 AMWe’re extracting the IO functionality into a separate library. This is a long-standing task that we’ve been working on gradually, and aim to finalize in 2023.❤️ :kotlin-intensifies-purple: @e5l, @Oleg Yukhnevich Will this also include
ktor-network
?Dominaezzz
12/21/2022, 12:30 PMkotlinx-io
or ktor-io
. I reckon it's the latter.Oleg Yukhnevich
12/21/2022, 1:06 PMaltavir
12/22/2022, 7:17 AMDidier Villevalois
12/22/2022, 1:36 PM