Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for sizeMapper (0.04 sec)

  1. okhttp/src/main/kotlin/okhttp3/internal/-ResponseBodyCommon.kt

    internal inline fun <T : Any> ResponseBody.commonConsumeSource(
      consumer: (BufferedSource) -> T,
      sizeMapper: (T) -> Int,
    ): T {
      val contentLength = contentLength()
      if (contentLength > Int.MAX_VALUE) {
        throw IOException("Cannot buffer entire body for content length: $contentLength")
      }
    
      val bytes = source().use(consumer)
      val size = sizeMapper(bytes)
      if (contentLength != -1L && contentLength != size.toLong()) {
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 2.3K bytes
    - Viewed (0)
Back to top