Support ping bedrock
This commit is contained in:
30 files changed
+736
-77
No files matched your search
@@ -9,7 +9,7 @@ package cn.rtast.mcping.platform
|
||||
import io.ktor.utils.io.*
|
||||
import kotlinx.coroutines.runBlocking
|
||||
|
||||
internal actual class PlatformReadChannel {
|
||||
internal actual class ReadChannel {
|
||||
private val _readChannel: ByteReadChannel
|
||||
|
||||
constructor(readChannel: ByteReadChannel) {
|
||||
@@ -19,9 +19,10 @@ internal actual class PlatformReadChannel {
|
||||
actual fun readByte(): Byte = runBlocking { _readChannel.readByte() }
|
||||
actual fun readBytes(length: Int): ByteArray = runBlocking { _readChannel.readByteArray(length) }
|
||||
actual fun readFully(out: ByteArray, start: Int, end: Int) = runBlocking { _readChannel.readFully(out, start, end) }
|
||||
actual fun readLong(): Long = runBlocking { _readChannel.readLong() }
|
||||
}
|
||||
|
||||
internal actual class PlatformWriteChannel {
|
||||
internal actual class WriteChannel {
|
||||
private val _writeChannel: ByteWriteChannel
|
||||
|
||||
constructor(writeChannel: ByteWriteChannel) {
|
||||
|
||||
Reference in New Issue
Block a user