mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
chore: Remove InputStreamFetcher
This commit is contained in:
parent
3568c7720c
commit
10fae753ec
1 changed files with 0 additions and 33 deletions
|
@ -1,33 +0,0 @@
|
|||
package eu.kanade.tachiyomi.data.coil
|
||||
|
||||
import coil3.ImageLoader
|
||||
import coil3.decode.DataSource
|
||||
import coil3.decode.ImageSource
|
||||
import coil3.fetch.FetchResult
|
||||
import coil3.fetch.Fetcher
|
||||
import coil3.fetch.SourceFetchResult
|
||||
import coil3.request.Options
|
||||
import okio.Buffer
|
||||
import java.io.InputStream
|
||||
|
||||
class InputStreamFetcher(
|
||||
private val stream: InputStream,
|
||||
private val options: Options,
|
||||
) : Fetcher {
|
||||
override suspend fun fetch(): FetchResult {
|
||||
return SourceFetchResult(
|
||||
source = ImageSource(
|
||||
source = stream.use { Buffer().readFrom(it) },
|
||||
fileSystem = options.fileSystem,
|
||||
),
|
||||
mimeType = null,
|
||||
dataSource = DataSource.MEMORY,
|
||||
)
|
||||
}
|
||||
|
||||
class Factory : Fetcher.Factory<InputStream> {
|
||||
override fun create(data: InputStream, options: Options, imageLoader: ImageLoader): Fetcher {
|
||||
return InputStreamFetcher(data, options)
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue