Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 21 for minOf (0.13 sec)

  1. okhttp/src/main/kotlin/okhttp3/internal/cache2/Relay.kt

              val bytesToRead = minOf(byteCount, upstreamPos - sourcePos)
              buffer.copyTo(sink, sourcePos - bufferPos, bytesToRead)
              sourcePos += bytesToRead
              return bytesToRead
            }
    
          // Read from the file.
          if (source == SOURCE_FILE) {
            val bytesToRead = minOf(byteCount, upstreamPos - sourcePos)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 11.8K bytes
    - Viewed (0)
  2. okhttp/src/main/kotlin/okhttp3/internal/http2/Http2Writer.kt

        requestHeaders: List<Header>,
      ) {
        this.withLock {
          if (closed) throw IOException("closed")
          hpackWriter.writeHeaders(requestHeaders)
    
          val byteCount = hpackBuffer.size
          val length = minOf(maxFrameSize - 4L, byteCount).toInt()
          frameHeader(
            streamId = streamId,
            length = length + 4,
            type = TYPE_PUSH_PROMISE,
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 20 17:03:43 GMT 2024
    - 11.3K bytes
    - Viewed (0)
  3. mockwebserver/src/main/kotlin/mockwebserver3/internal/ThrottledSink.kt

        while (bytesLeft > 0) {
          if (bytesWrittenSinceLastDelay == bytesPerPeriod) {
            flush()
            sleepNanos(periodDelayNanos)
            bytesWrittenSinceLastDelay = 0
          }
    
          val toWrite = minOf(bytesLeft, bytesPerPeriod - bytesWrittenSinceLastDelay)
          bytesWrittenSinceLastDelay += toWrite
          bytesLeft -= toWrite
          delegate.write(source, toWrite)
        }
      }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.5K bytes
    - Viewed (0)
  4. okhttp/src/main/kotlin/okhttp3/MultipartReader.kt

          source.require(crlfDashDashBoundary.size.toLong())
    
          return when (val delimiterIndex = source.buffer.indexOf(crlfDashDashBoundary)) {
            -1L -> minOf(maxResult, source.buffer.size - crlfDashDashBoundary.size + 1)
            else -> minOf(maxResult, delimiterIndex)
          }
        }
    
        @Throws(IOException::class)
        override fun close() {
          if (closed) return
          closed = true
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 7.1K bytes
    - Viewed (0)
  5. okhttp/src/main/kotlin/okhttp3/internal/http1/Http1ExchangeCodec.kt

          byteCount: Long,
        ): Long {
          require(byteCount >= 0L) { "byteCount < 0: $byteCount" }
          check(!closed) { "closed" }
          if (bytesRemaining == 0L) return -1
    
          val read = super.read(sink, minOf(bytesRemaining, byteCount))
          if (read == -1L) {
            carrier.noNewExchanges() // The server didn't supply the promised content length.
            val e = ProtocolException("unexpected end of stream")
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 16.2K bytes
    - Viewed (0)
  6. okhttp/src/main/kotlin/okhttp3/internal/platform/android/AndroidLog.kt

          var i = 0
          val length = logMessage.length
          while (i < length) {
            var newline = logMessage.indexOf('\n', i)
            newline = if (newline != -1) newline else length
            do {
              val end = minOf(newline, i + MAX_LOG_LENGTH)
              Log.println(logLevel, tag, logMessage.substring(i, end))
              i = end
            } while (i < newline)
            i++
          }
        }
      }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.9K bytes
    - Viewed (0)
  7. okhttp-tls/src/main/kotlin/okhttp3/tls/Certificates.kt

        append("-----END CERTIFICATE-----\n")
      }
    }
    
    internal fun StringBuilder.encodeBase64Lines(data: ByteString) {
      val base64 = data.base64()
      for (i in 0 until base64.length step 64) {
        append(base64, i, minOf(i + 64, base64.length)).append('\n')
      }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.8K bytes
    - Viewed (2)
  8. mockwebserver/src/main/kotlin/mockwebserver3/MockResponse.kt

          maxChunkSize: Int,
        ) = apply {
          removeHeader("Content-Length")
          headers.add(CHUNKED_BODY_HEADER)
    
          val bytesOut = Buffer()
          while (!body.exhausted()) {
            val chunkSize = minOf(body.size, maxChunkSize.toLong())
            bytesOut.writeHexadecimalUnsignedLong(chunkSize)
            bytesOut.writeUtf8("\r\n")
            bytesOut.write(body, chunkSize)
            bytesOut.writeUtf8("\r\n")
          }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Tue Jan 23 14:31:42 GMT 2024
    - 13.3K bytes
    - Viewed (1)
  9. mockwebserver-deprecated/src/main/kotlin/okhttp3/mockwebserver/MockResponse.kt

        maxChunkSize: Int,
      ) = apply {
        removeHeader("Content-Length")
        headersBuilder.add(CHUNKED_BODY_HEADER)
    
        val bytesOut = Buffer()
        while (!body.exhausted()) {
          val chunkSize = minOf(body.size, maxChunkSize.toLong())
          bytesOut.writeHexadecimalUnsignedLong(chunkSize)
          bytesOut.writeUtf8("\r\n")
          bytesOut.write(body, chunkSize)
          bytesOut.writeUtf8("\r\n")
        }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 7.2K bytes
    - Viewed (0)
  10. okhttp/src/main/kotlin/okhttp3/internal/-ResponseCommon.kt

    @Throws(IOException::class)
    fun Response.commonPeekBody(byteCount: Long): ResponseBody {
      val peeked = body.source().peek()
      val buffer = Buffer()
      peeked.request(byteCount)
      buffer.write(peeked, minOf(byteCount, peeked.buffer.size))
      return buffer.asResponseBody(body.contentType(), buffer.size)
    }
    
    fun Response.commonNewBuilder(): Response.Builder = Response.Builder(this)
    
    val Response.commonIsRedirect: Boolean
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 15 13:24:48 GMT 2024
    - 5.2K bytes
    - Viewed (0)
Back to top