Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Korge memory split #2170

Merged
merged 12 commits into from
Mar 1, 2024
Merged
6 changes: 3 additions & 3 deletions korge-foundation/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ dependencies {
//add("commonTestApi", project(":korge-test"))
commonTestApi(libs.kotlinx.coroutines.test)
commonMainApi(project(":korlibs-time"))
commonMainApi(project(":korlibs-datastructure"))
commonMainApi(project(":korlibs-crypto"))
commonMainApi(project(":korlibs-platform"))
commonMainApi(project(":korlibs-datastructure"))
commonMainApi(project(":korlibs-util"))
commonMainApi(project(":korlibs-math-core"))
commonMainApi(project(":korlibs-inject"))
commonMainApi(project(":korlibs-memory"))
commonMainApi(project(":korlibs-logger"))
commonMainApi(project(":korlibs-inject"))
}
14 changes: 14 additions & 0 deletions korge-foundation/src/korlibs/memory/ByteArrayBuilderExtentions.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package korlibs.memory

import korlibs.number.*

/**
* Analogous to [StringBuilder] but for [ByteArray]. Allows to [append] values to end calling [toByteArray].
* Provides some methods like [s16LE] or [f32BE] to append specific bit representations easily.
*/
fun ByteArrayBuilder.f16(v: Half, little: Boolean): ByteArrayBuilder = s16(v.rawBits.toInt(), little)
fun ByteArrayBuilder.f16LE(v: Half): ByteArrayBuilder = s16LE(v.rawBits.toInt())
fun ByteArrayBuilder.f16BE(v: Half): ByteArrayBuilder = s16BE(v.rawBits.toInt())

fun ByteArrayBuilderLE.f16(v: Half): ByteArrayBuilder = bab.f16LE(v)
fun ByteArrayBuilderBE.f16(v: Half): ByteArrayBuilder = bab.f16BE(v)
17 changes: 17 additions & 0 deletions korge-foundation/src/korlibs/memory/ByteArrayExtention.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package korlibs.memory

import korlibs.number.Half

private fun ByteArray.u8(offset: Int): Int = this[offset].toInt() and 0xFF
private inline fun ByteArray.get16LE(offset: Int): Int = (u8(offset + 0) shl 0) or (u8(offset + 1) shl 8)
private inline fun ByteArray.get16BE(offset: Int): Int = (u8(offset + 1) shl 0) or (u8(offset + 0) shl 8)
Comment on lines +5 to +7
Copy link
Member

@soywiz soywiz Mar 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't these exposed publicly already in other file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont know about that. They were private in the original class


// Signed
fun ByteArray.getF16LE(offset: Int): Half = Half.fromBits(get16LE(offset))
fun ByteArray.getF16BE(offset: Int): Half = Half.fromBits(get16BE(offset))

// Custom Endian
fun ByteArray.getF16(offset: Int, littleEndian: Boolean): Half = if (littleEndian) getF16LE(offset) else getF16BE(offset)
fun ByteArray.setF16(offset: Int, value: Half, littleEndian: Boolean) { if (littleEndian) setF16LE(offset, value) else setF16BE(offset, value) }
fun ByteArray.setF16LE(offset: Int, value: Half) { set16LE(offset + 0, value.toRawBits().toInt()) }
fun ByteArray.setF16BE(offset: Int, value: Half) { set16BE(offset + 0, value.toRawBits().toInt()) }
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package korlibs.memory

import korlibs.number.Half

@Deprecated("", ReplaceWith("getF16LE(o)"))
fun ByteArray.readF16LE(o: Int): Half = getF16LE(o)
@Deprecated("", ReplaceWith("getF16BE(o)"))
fun ByteArray.readF16BE(o: Int): Half = getF16BE(o)
@Deprecated("", ReplaceWith("getF16(o, little)"))
fun ByteArray.readF16(o: Int, little: Boolean): Half = getF16(o, little)
@Deprecated("", ReplaceWith("setF16(o, v, little)"))
fun ByteArray.writeF16(o: Int, v: Half, little: Boolean) = setF16(o, v, little)
@Deprecated("", ReplaceWith("setF16LE(o, v)"))
fun ByteArray.writeF16LE(o: Int, v: Half) = setF16LE(o, v)
@Deprecated("", ReplaceWith("setF16BE(o, v)"))
fun ByteArray.writeF16BE(o: Int, v: Half) = setF16BE(o, v)
10 changes: 10 additions & 0 deletions korge-foundation/src/korlibs/memory/ByteArrayReaderExtention.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package korlibs.memory

import korlibs.number.*


fun ByteArrayReader.f16(little: Boolean): Half = Half.fromBits(s16(little))
fun ByteArrayReader.f16LE(): Half = Half.fromBits(s16LE())
fun ByteArrayReader.f16BE(): Half = Half.fromBits(s16BE())
fun ByteArrayReaderLE.f16(): Half = bar.f16LE()
fun ByteArrayReaderBE.f16(): Half = bar.f16BE()
2 changes: 1 addition & 1 deletion korge-foundation/src/korlibs/number/Half.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package korlibs.number

import korlibs.memory.*
import korlibs.memory.reinterpretAsFloat

/**
* Represents a floating point value of 16 bits. Also known as Half-precision floating-point format (IEEE 754-2008).
Expand Down
1 change: 1 addition & 0 deletions korlibs-memory/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
21 changes: 21 additions & 0 deletions korlibs-memory/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import korlibs.*

description = "Korlibs Memory"

project.extensions.extraProperties.properties.apply {
applyProjectProperties(
"https://raw.githubusercontent.com/korlibs/korge/main/korlibs-memory",
"Public Domain",
"https://raw.githubusercontent.com/korlibs/korge/main/korlibs-memory/LICENSE"
)
}

dependencies {
commonMainApi(libs.kotlinx.coroutines.core)
commonMainApi(libs.kotlinx.atomicfu)
commonTestApi(libs.kotlinx.coroutines.test)
commonMainApi(project(":korlibs-math-core"))
commonMainApi(project(":korlibs-platform"))
commonMainApi(project(":korlibs-util"))
commonMainApi(project(":korlibs-crypto"))
}
Comment on lines +14 to +21
Copy link
Member

@soywiz soywiz Mar 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should evaluate those.

  • kotlinx-coroutines are not used at all
  • math-core might be used, but maybe we can internally copy stuff to remove that dependency?
  • util and crypto probably not?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

util and math-core are used. We should avoid copiing stuff to private. I check the other two

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, let's keep it as it is for now. We can optimize dependencies later.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could not remove any of them

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

package korlibs.memory

import korlibs.math.*
import korlibs.math.clamp01
import korlibs.math.toInt
import kotlin.rotateLeft as rotateLeftKotlin
import kotlin.rotateRight as rotateRightKotlin

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

package korlibs.memory

import korlibs.math.*
import korlibs.math.unsigned
import korlibs.math.clampUByte
import korlibs.math.clampUShort
import kotlin.jvm.*

typealias DataView = Buffer
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package korlibs.memory

import korlibs.number.*
import kotlin.math.*
import kotlin.math.max

/**
* Analogous to [StringBuilder] but for [ByteArray]. Allows to [append] values to end calling [toByteArray].
Expand Down Expand Up @@ -83,11 +82,6 @@ public class ByteArrayBuilder(public var data: ByteArray, size: Int = data.size,
public fun s32(v: Int, little: Boolean): ByteArrayBuilder = this.apply { prepare(4) { data.set32(_size, v, little) } }
public fun s32LE(v: Int): ByteArrayBuilder = this.apply { prepare(4) { data.set32LE(_size, v) } }
public fun s32BE(v: Int): ByteArrayBuilder = this.apply { prepare(4) { data.set32BE(_size, v) } }

public fun f16(v: Half, little: Boolean): ByteArrayBuilder = this.apply { prepare(2) { data.setF16(_size, v, little) } }
public fun f16LE(v: Half): ByteArrayBuilder = this.apply { prepare(2) { data.setF16LE(_size, v) } }
public fun f16BE(v: Half): ByteArrayBuilder = this.apply { prepare(2) { data.setF16BE(_size, v) } }

public fun f32(v: Float, little: Boolean): ByteArrayBuilder = this.apply { prepare(4) { data.setF32(_size, v, little) } }
public fun f32LE(v: Float): ByteArrayBuilder = this.apply { prepare(4) { data.setF32LE(_size, v) } }
public fun f32BE(v: Float): ByteArrayBuilder = this.apply { prepare(4) { data.setF32BE(_size, v) } }
Expand Down Expand Up @@ -115,7 +109,6 @@ public fun ByteArrayBuilderLE.s8(v: Int): ByteArrayBuilder = bab.s8(v)
public fun ByteArrayBuilderLE.s16(v: Int): ByteArrayBuilder = bab.s16LE(v)
public fun ByteArrayBuilderLE.s24(v: Int): ByteArrayBuilder = bab.s24LE(v)
public fun ByteArrayBuilderLE.s32(v: Int): ByteArrayBuilder = bab.s32LE(v)
public fun ByteArrayBuilderLE.f16(v: Half): ByteArrayBuilder = bab.f16LE(v)
public fun ByteArrayBuilderLE.f32(v: Float): ByteArrayBuilder = bab.f32LE(v)
public fun ByteArrayBuilderLE.f64(v: Double): ByteArrayBuilder = bab.f64LE(v)
public fun ByteArrayBuilderLE.clear(): Unit = bab.clear()
Expand All @@ -133,7 +126,6 @@ public fun ByteArrayBuilderBE.s8(v: Int): ByteArrayBuilder = bab.s8(v)
public fun ByteArrayBuilderBE.s16(v: Int): ByteArrayBuilder = bab.s16BE(v)
public fun ByteArrayBuilderBE.s24(v: Int): ByteArrayBuilder = bab.s24BE(v)
public fun ByteArrayBuilderBE.s32(v: Int): ByteArrayBuilder = bab.s32BE(v)
public fun ByteArrayBuilderBE.f16(v: Half): ByteArrayBuilder = bab.f16BE(v)
public fun ByteArrayBuilderBE.f32(v: Float): ByteArrayBuilder = bab.f32BE(v)
public fun ByteArrayBuilderBE.f64(v: Double): ByteArrayBuilder = bab.f64BE(v)
public fun ByteArrayBuilderBE.clear(): Unit = bab.clear()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package korlibs.memory

import korlibs.math.*
import korlibs.number.*
import korlibs.math.unsigned

/////////////////////////////////////////
/////////////////////////////////////////
Expand Down Expand Up @@ -34,14 +33,12 @@ public fun ByteArray.getS16LE(offset: Int): Int = get16LE(offset).signExtend(16)
public fun ByteArray.getS24LE(offset: Int): Int = get24LE(offset).signExtend(24)
public fun ByteArray.getS32LE(offset: Int): Int = get32LE(offset)
public fun ByteArray.getS64LE(offset: Int): Long = get64LE(offset)
public fun ByteArray.getF16LE(offset: Int): Half = Half.fromBits(get16LE(offset))
public fun ByteArray.getF32LE(offset: Int): Float = Float.fromBits(get32LE(offset))
public fun ByteArray.getF64LE(offset: Int): Double = Double.fromBits(get64LE(offset))
public fun ByteArray.getS16BE(offset: Int): Int = get16BE(offset).signExtend(16)
public fun ByteArray.getS24BE(offset: Int): Int = get24BE(offset).signExtend(24)
public fun ByteArray.getS32BE(offset: Int): Int = get32BE(offset)
public fun ByteArray.getS64BE(offset: Int): Long = get64BE(offset)
public fun ByteArray.getF16BE(offset: Int): Half = Half.fromBits(get16BE(offset))
public fun ByteArray.getF32BE(offset: Int): Float = Float.fromBits(get32BE(offset))
public fun ByteArray.getF64BE(offset: Int): Double = Double.fromBits(get64BE(offset))

Expand All @@ -53,7 +50,6 @@ public fun ByteArray.getS16(offset: Int, littleEndian: Boolean): Int = if (littl
public fun ByteArray.getS24(offset: Int, littleEndian: Boolean): Int = if (littleEndian) getS24LE(offset) else getS24BE(offset)
public fun ByteArray.getS32(offset: Int, littleEndian: Boolean): Int = if (littleEndian) getS32LE(offset) else getS32BE(offset)
public fun ByteArray.getS64(offset: Int, littleEndian: Boolean): Long = if (littleEndian) getS64LE(offset) else getS64BE(offset)
public fun ByteArray.getF16(offset: Int, littleEndian: Boolean): Half = if (littleEndian) getF16LE(offset) else getF16BE(offset)
public fun ByteArray.getF32(offset: Int, littleEndian: Boolean): Float = if (littleEndian) getF32LE(offset) else getF32BE(offset)
public fun ByteArray.getF64(offset: Int, littleEndian: Boolean): Double = if (littleEndian) getF64LE(offset) else getF64BE(offset)

Expand Down Expand Up @@ -92,7 +88,6 @@ public fun ByteArray.set16(offset: Int, value: Int, littleEndian: Boolean) { if
public fun ByteArray.set24(offset: Int, value: Int, littleEndian: Boolean) { if (littleEndian) set24LE(offset, value) else set24BE(offset, value) }
public fun ByteArray.set32(offset: Int, value: Int, littleEndian: Boolean) { if (littleEndian) set32LE(offset, value) else set32BE(offset, value) }
public fun ByteArray.set64(offset: Int, value: Long, littleEndian: Boolean) { if (littleEndian) set64LE(offset, value) else set64BE(offset, value) }
public fun ByteArray.setF16(offset: Int, value: Half, littleEndian: Boolean) { if (littleEndian) setF16LE(offset, value) else setF16BE(offset, value) }
public fun ByteArray.setF32(offset: Int, value: Float, littleEndian: Boolean) { if (littleEndian) setF32LE(offset, value) else setF32BE(offset, value) }
public fun ByteArray.setF64(offset: Int, value: Double, littleEndian: Boolean) { if (littleEndian) setF64LE(offset, value) else setF64BE(offset, value) }

Expand All @@ -101,7 +96,6 @@ public fun ByteArray.set24LE(offset: Int, value: Int) { this[offset + 0] = value
public fun ByteArray.set32LE(offset: Int, value: Int) { this[offset + 0] = value.extractByte(0); this[offset + 1] = value.extractByte(8); this[offset + 2] = value.extractByte(16); this[offset + 3] = value.extractByte(24) }
public fun ByteArray.set32LE(offset: Int, value: Long) { set32LE(offset, value.toInt()) }
public fun ByteArray.set64LE(offset: Int, value: Long) { set32LE(offset + 0, (value ushr 0).toInt()); set32LE(offset + 4, (value ushr 32).toInt()) }
public fun ByteArray.setF16LE(offset: Int, value: Half) { set16LE(offset + 0, value.toRawBits().toInt()) }
public fun ByteArray.setF32LE(offset: Int, value: Float) { set32LE(offset + 0, value.toRawBits()) }
public fun ByteArray.setF64LE(offset: Int, value: Double) { set64LE(offset + 0, value.toRawBits()) }

Expand All @@ -110,7 +104,6 @@ public fun ByteArray.set24BE(offset: Int, value: Int) { this[offset + 2] = value
public fun ByteArray.set32BE(offset: Int, value: Int) { this[offset + 3] = value.extractByte(0); this[offset + 2] = value.extractByte(8); this[offset + 1] = value.extractByte(16); this[offset + 0] = value.extractByte(24) }
public fun ByteArray.set32BE(offset: Int, value: Long) { set32BE(offset, value.toInt()) }
public fun ByteArray.set64BE(offset: Int, value: Long) { set32BE(offset + 0, (value ushr 32).toInt()); set32BE(offset + 4, (value ushr 0).toInt()) }
public fun ByteArray.setF16BE(offset: Int, value: Half) { set16BE(offset + 0, value.toRawBits().toInt()) }
public fun ByteArray.setF32BE(offset: Int, value: Float) { set32BE(offset + 0, value.toRawBits()) }
public fun ByteArray.setF64BE(offset: Int, value: Double) { set64BE(offset + 0, value.toRawBits()) }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package korlibs.memory

import korlibs.number.*

/////////////////////////////////////////
/////////////////////////////////////////
/////////////////////////////////////////
Expand All @@ -21,14 +19,12 @@ import korlibs.number.*
@Deprecated("", ReplaceWith("getS24LE(o)")) public fun ByteArray.readS24LE(o: Int): Int = getS24LE(o)
@Deprecated("", ReplaceWith("getS32LE(o)")) public fun ByteArray.readS32LE(o: Int): Int = getS32LE(o)
@Deprecated("", ReplaceWith("getS64LE(o)")) public fun ByteArray.readS64LE(o: Int): Long = getS64LE(o)
@Deprecated("", ReplaceWith("getF16LE(o)")) public fun ByteArray.readF16LE(o: Int): Half = getF16LE(o)
@Deprecated("", ReplaceWith("getF32LE(o)")) public fun ByteArray.readF32LE(o: Int): Float = getF32LE(o)
@Deprecated("", ReplaceWith("getF64LE(o)")) public fun ByteArray.readF64LE(o: Int): Double = getF64LE(o)
@Deprecated("", ReplaceWith("getS16BE(o)")) public fun ByteArray.readS16BE(o: Int): Int = getS16BE(o)
@Deprecated("", ReplaceWith("getS24BE(o)")) public fun ByteArray.readS24BE(o: Int): Int = getS24BE(o)
@Deprecated("", ReplaceWith("getS32BE(o)")) public fun ByteArray.readS32BE(o: Int): Int = getS32BE(o)
@Deprecated("", ReplaceWith("getS64BE(o)")) public fun ByteArray.readS64BE(o: Int): Long = getS64BE(o)
@Deprecated("", ReplaceWith("getF16BE(o)")) public fun ByteArray.readF16BE(o: Int): Half = getF16BE(o)
@Deprecated("", ReplaceWith("getF32BE(o)")) public fun ByteArray.readF32BE(o: Int): Float = getF32BE(o)
@Deprecated("", ReplaceWith("getF64BE(o)")) public fun ByteArray.readF64BE(o: Int): Double = getF64BE(o)

Expand All @@ -40,7 +36,6 @@ import korlibs.number.*
@Deprecated("", ReplaceWith("getS24(o, little)")) public fun ByteArray.readS24(o: Int, little: Boolean): Int = getS24(o, little)
@Deprecated("", ReplaceWith("getS32(o, little)")) public fun ByteArray.readS32(o: Int, little: Boolean): Int = getS32(o, little)
@Deprecated("", ReplaceWith("getS64(o, little)")) public fun ByteArray.readS64(o: Int, little: Boolean): Long = getS64(o, little)
@Deprecated("", ReplaceWith("getF16(o, little)")) public fun ByteArray.readF16(o: Int, little: Boolean): Half = getF16(o, little)
@Deprecated("", ReplaceWith("getF32(o, little)")) public fun ByteArray.readF32(o: Int, little: Boolean): Float = getF32(o, little)
@Deprecated("", ReplaceWith("getF64(o, little)")) public fun ByteArray.readF64(o: Int, little: Boolean): Double = getF64(o, little)

Expand Down Expand Up @@ -75,7 +70,6 @@ import korlibs.number.*
@Deprecated("", ReplaceWith("set24(o, v, little)")) public fun ByteArray.write24(o: Int, v: Int, little: Boolean) = set24(o, v, little)
@Deprecated("", ReplaceWith("set32(o, v, little)")) public fun ByteArray.write32(o: Int, v: Int, little: Boolean) = set32(o, v, little)
@Deprecated("", ReplaceWith("set64(o, v, little)")) public fun ByteArray.write64(o: Int, v: Long, little: Boolean) = set64(o, v, little)
@Deprecated("", ReplaceWith("setF16(o, v, little)")) public fun ByteArray.writeF16(o: Int, v: Half, little: Boolean) = setF16(o, v, little)
@Deprecated("", ReplaceWith("setF32(o, v, little)")) public fun ByteArray.writeF32(o: Int, v: Float, little: Boolean) = setF32(o, v, little)
@Deprecated("", ReplaceWith("setF64(o, v, little)")) public fun ByteArray.writeF64(o: Int, v: Double, little: Boolean) = setF64(o, v, little)

Expand All @@ -84,7 +78,6 @@ import korlibs.number.*
@Deprecated("", ReplaceWith("set32LE(o, v)")) public fun ByteArray.write32LE(o: Int, v: Int) = set32LE(o, v)
@Deprecated("", ReplaceWith("set32LE(o, v)")) public fun ByteArray.write32LE(o: Int, v: Long) = set32LE(o, v)
@Deprecated("", ReplaceWith("set64LE(o, v)")) public fun ByteArray.write64LE(o: Int, v: Long) = set64LE(o, v)
@Deprecated("", ReplaceWith("setF16LE(o, v)")) public fun ByteArray.writeF16LE(o: Int, v: Half) = setF16LE(o, v)
@Deprecated("", ReplaceWith("setF32LE(o, v)")) public fun ByteArray.writeF32LE(o: Int, v: Float) = setF32LE(o, v)
@Deprecated("", ReplaceWith("setF64LE(o, v)")) public fun ByteArray.writeF64LE(o: Int, v: Double) = setF64LE(o, v)

Expand All @@ -93,7 +86,6 @@ import korlibs.number.*
@Deprecated("", ReplaceWith("set32BE(o, v)")) public fun ByteArray.write32BE(o: Int, v: Int) = set32BE(o, v)
@Deprecated("", ReplaceWith("set32BE(o, v)")) public fun ByteArray.write32BE(o: Int, v: Long) = set32BE(o, v)
@Deprecated("", ReplaceWith("set64BE(o, v)")) public fun ByteArray.write64BE(o: Int, v: Long) = set64BE(o, v)
@Deprecated("", ReplaceWith("setF16BE(o, v)")) public fun ByteArray.writeF16BE(o: Int, v: Half) = setF16BE(o, v)
@Deprecated("", ReplaceWith("setF32BE(o, v)")) public fun ByteArray.writeF32BE(o: Int, v: Float) = setF32BE(o, v)
@Deprecated("", ReplaceWith("setF64BE(o, v)")) public fun ByteArray.writeF64BE(o: Int, v: Double) = setF64BE(o, v)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package korlibs.memory

import korlibs.number.*

public class ByteArrayReader(public val data: ByteArray, public val start: Int, public val size: Int = 0) {
private var offset = start
public val remaining: Int get() = size - offset
Expand Down Expand Up @@ -36,10 +34,6 @@ public class ByteArrayReader(public val data: ByteArray, public val start: Int,
public fun s32LE(): Int = move(4) { getS32LE(it) }
public fun u32BE(): Long = move(4) { getU32BE(it) }
public fun s32BE(): Int = move(4) { getS32BE(it) }

public fun f16(little: Boolean): Half = move(2) { getF16(it, little) }
public fun f16LE(): Half = move(2) { getF16LE(it) }
public fun f16BE(): Half = move(2) { getF16BE(it) }
public fun f32(little: Boolean): Float = move(4) { getF32(it, little) }
public fun f32LE(): Float = move(4) { getF32LE(it) }
public fun f32BE(): Float = move(4) { getF32BE(it) }
Expand All @@ -61,7 +55,6 @@ public fun ByteArrayReaderLE.u24(): Int = bar.u24LE()
public fun ByteArrayReaderLE.s24(): Int = bar.s24LE()
public fun ByteArrayReaderLE.u32(): Long = bar.u32LE()
public fun ByteArrayReaderLE.s32(): Int = bar.s32LE()
public fun ByteArrayReaderLE.f16(): Half = bar.f16LE()
public fun ByteArrayReaderLE.f32(): Float = bar.f32LE()
public fun ByteArrayReaderLE.f64(): Double = bar.f64LE()

Expand All @@ -78,7 +71,6 @@ public fun ByteArrayReaderBE.u24(): Int = bar.u24BE()
public fun ByteArrayReaderBE.s24(): Int = bar.s24BE()
public fun ByteArrayReaderBE.u32(): Long = bar.u32BE()
public fun ByteArrayReaderBE.s32(): Int = bar.s32BE()
public fun ByteArrayReaderBE.f16(): Half = bar.f16BE()
public fun ByteArrayReaderBE.f32(): Float = bar.f32BE()
public fun ByteArrayReaderBE.f64(): Double = bar.f64BE()

Expand Down
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ include(":korlibs-concurrent")
include(":korlibs-logger")
include(":korlibs-platform")
include(":korlibs-datastructure")
include(":korlibs-memory")
include(":korlibs-util")
include(":korlibs-math-core")
include(":korlibs-inject")
Expand Down
Loading