Commit 8c4855a1 authored by Him188's avatar Him188

Fix build

parent 1d07650d
......@@ -11,12 +11,15 @@
package net.mamoe.mirai.utils
import kotlinx.io.core.readBytes
import kotlinx.io.core.use
import net.mamoe.mirai.contact.Contact
import net.mamoe.mirai.contact.Group
import net.mamoe.mirai.contact.User
import net.mamoe.mirai.message.MessageReceipt
import net.mamoe.mirai.message.data.Image
import net.mamoe.mirai.message.data.sendTo
import net.mamoe.mirai.message.data.toUHexString
import net.mamoe.mirai.utils.internal.DeferredReusableInput
import net.mamoe.mirai.utils.internal.ReusableInput
import kotlin.jvm.JvmSynthetic
......@@ -30,16 +33,14 @@ import kotlin.jvm.JvmSynthetic
* @See ExternalImage.upload 上传图片并得到 [Image] 消息
*/
public class ExternalImage internal constructor(
override val input: ReusableInput
) : ExternalFile {
public override val formatName: String by lazy {
TODO()
/*
internal val input: ReusableInput
) {
internal val md5: ByteArray get() = input.md5
public val formatName: String by lazy {
val hex = input.asInput().use {
//it.asInput().readBytes(8).toUHexString("")
TODO()
it.readBytes(8).toUHexString("")
}
return@lazy hex.detectFormatName() as String*/
return@lazy hex.detectFormatName()
}
init {
......
......@@ -45,7 +45,7 @@ internal actual class DeferredReusableInput actual constructor(
return delegate?.writeTo(out) ?: error("DeferredReusableInput not yet initialized")
}
override fun asInput(): InputStream {
override fun asInput(): Input {
return delegate?.asInput() ?: error("DeferredReusableInput not yet initialized")
}
......
......@@ -37,8 +37,8 @@ internal actual fun ByteArray.asReusableInput(): ReusableInput {
return this@asReusableInput.size.toLongUnsigned()
}
override fun asInput(): InputStream {
return ByteArrayInputStream(this@asReusableInput)
override fun asInput(): Input {
return ByteArrayInputStream(this@asReusableInput).asInput()
}
}
}
......@@ -63,8 +63,8 @@ internal fun File.asReusableInput(deleteOnClose: Boolean): ReusableInput {
return inputStream().use { it.copyTo(out) }
}
override fun asInput(): InputStream {
return inputStream()
override fun asInput(): Input {
return inputStream().asInput()
}
}
}
......@@ -89,8 +89,8 @@ internal fun File.asReusableInput(deleteOnClose: Boolean, md5: ByteArray): Reusa
return inputStream().use { it.copyTo(out) }
}
override fun asInput(): InputStream {
return inputStream()
override fun asInput(): Input {
return inputStream().asInput()
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment