jvmMain.com.github.insanusmokrassar.TelegramBotAPI.utils.StorageFile.kt Maven / Gradle / Ivy
package com.github.insanusmokrassar.TelegramBotAPI.utils
import io.ktor.utils.io.streams.asInput
import java.io.File
import java.nio.file.Files
fun StorageFile(
file: File
) = StorageFile(
StorageFileInfo(
Files.probeContentType(file.toPath()),
file.name
)
) {
file.inputStream().asInput()
}