desktopMain.com.seiko.imageloader.component.fetcher.FileFetcher.kt Maven / Gradle / Ivy
package com.seiko.imageloader.component.fetcher
import com.seiko.imageloader.request.Options
import okio.buffer
import okio.source
import java.io.File
internal class FileFetcher(private val data: File) : Fetcher {
override suspend fun fetch(): FetchResult {
return FetchSourceResult(
source = data.source().buffer(),
mimeType = null,
)
}
class Factory : Fetcher.Factory {
override fun create(data: Any, options: Options): Fetcher? {
if (data !is File) return null
return FileFetcher(data)
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy