Skip to content

Add support for writing other primitive arrays to Buffers #357

Open
@DRSchlaubi

Description

@DRSchlaubi

Due to the deprecation of the Ktor I/O APIs we need to migrate this code, however with kotlinx-io there is currently no easy way to replace this

internal actual fun formatIntegerFromLittleEndianLongArray(data: LongArray) =
    withBuffer(data.size * Long.SIZE_BYTES) {
        // need to convert from little-endian data to big-endian expected by BigInteger
        writeFully(data.reversedArray())
        BigInteger.fromByteArray(readBytes(), Sign.POSITIVE).toString()
    }

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions