<@U0BFDUP0E> Can I specify `BufferedSource` as a r...
# squarelibraries
h
@jw Can I specify
BufferedSource
as a return type of retrofit interface function?
Works like a charm if anyone needs it
Copy code
object : Converter.Factory() {
          override fun responseBodyConverter(type: Type, annotations: Array<Annotation>, retrofit: Retrofit): Converter<ResponseBody, *>? {
            if (type == BufferedSource::class.java) {
              return Converter(ResponseBody::source)
            }
            return super.responseBodyConverter(type, annotations, retrofit)
          }
        }
j
Why do you want this? We could support ByteString
h
I'm loading large files and streaming them directly to disk cache(DiskLruCache to be preciese)
j
Makes sense!