Skip to content

Commit

Permalink
refactor: remove unused functions
Browse files Browse the repository at this point in the history
  • Loading branch information
vyfor committed May 2, 2024
1 parent 6f4c0e1 commit 691617b
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions src/commonMain/kotlin/io/github/vyfor/kpresence/utils/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,6 @@ internal fun ByteArray.putInt(value: Int, offset: Int = 0) {
this[offset + 3] = value.toByte()
}

internal fun ByteArray.putIntLE(value: Int, offset: Int = 0) {
this[offset] = value.toByte()
this[offset + 1] = (value shr 8).toByte()
this[offset + 2] = (value shr 16).toByte()
this[offset + 3] = (value shr 24).toByte()
}

internal fun ByteArray.putIntBE(value: Int, offset: Int = 0) {
this[offset] = (value shr 24).toByte()
this[offset + 1] = (value shr 16).toByte()
this[offset + 2] = (value shr 8).toByte()
this[offset + 3] = value.toByte()
}

internal fun ByteArray.getInt(offset: Int = 0): Int {
return (this[offset].toInt() shl 24) or
(this[offset + 1].toInt() shl 16) or
(this[offset + 2].toInt() shl 8) or
(this[offset + 3].toInt())
}

internal fun Int.reverseBytes(): Int {
return (this and -0x1000000 ushr 24) or
Expand Down

0 comments on commit 691617b

Please sign in to comment.