All Downloads are FREE. Search and download functionalities are using the official Maven repository.

desktopMain.com.seiko.imageloader.component.fetcher.FileFetcher.kt Maven / Gradle / Ivy

There is a newer version: 1.9.0
Show newest version
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