Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 29 for Integer (0.15 sec)

  1. okhttp/src/test/java/okhttp3/WebPlatformUrlTest.kt

          return
        }
    
        assertThat(url, "Expected URL to parse successfully, but was null")
          .isNotNull()
        val effectivePort =
          when {
            url!!.port != defaultPort(url.scheme) -> Integer.toString(url.port)
            else -> ""
          }
        val effectiveQuery =
          when {
            url.encodedQuery != null -> "?" + url.encodedQuery
            else -> ""
          }
        val effectiveFragment =
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.7K bytes
    - Viewed (0)
  2. okhttp/src/main/kotlin/okhttp3/internal/-UtilJvm.kt

      require(millis <= Integer.MAX_VALUE) { "$name too large" }
      require(millis != 0L || duration <= 0L) { "$name too small" }
      return millis.toInt()
    }
    
    internal fun checkDuration(
      name: String,
      duration: Duration,
    ): Int {
      check(!duration.isNegative()) { "$name < 0" }
      val millis = duration.inWholeMilliseconds
      require(millis <= Integer.MAX_VALUE) { "$name too large" }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Tue Jan 09 12:33:05 GMT 2024
    - 10.5K bytes
    - Viewed (0)
  3. okhttp/src/main/kotlin/okhttp3/CacheControl.kt

        /**
         * Sets the maximum age of a cached response. If the cache response's age exceeds [maxAge], it
         * will not be used and a network request will be made.
         *
         * @param maxAge a non-negative integer. This is stored and transmitted with [TimeUnit.SECONDS]
         *     precision; finer precision will be lost.
         */
        fun maxAge(
          maxAge: Int,
          timeUnit: TimeUnit,
        ) = apply {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 15 13:41:01 GMT 2024
    - 10K bytes
    - Viewed (0)
  4. okhttp/src/test/java/okhttp3/CacheControlJvmTest.kt

      }
    
      @Test
      @Throws(Exception::class)
      fun timeDurationTruncatedToMaxValue() {
        val cacheControl =
          CacheControl.Builder()
            .maxAge(365 * 100, TimeUnit.DAYS) // Longer than Integer.MAX_VALUE seconds.
            .build()
        assertThat(cacheControl.maxAgeSeconds).isEqualTo(Int.MAX_VALUE)
      }
    
      @Test
      @Throws(Exception::class)
      fun secondsMustBeNonNegative() {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 7.3K bytes
    - Viewed (0)
  5. okhttp/src/main/kotlin/okhttp3/OkHttpClient.kt

            this.certificatePinner = certificatePinner
          }
    
        /**
         * Sets the default timeout for complete calls. A value of 0 means no timeout, otherwise values
         * must be between 1 and [Integer.MAX_VALUE] when converted to milliseconds.
         *
         * The call timeout spans the entire call: resolving DNS, connecting, writing the request body,
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 06 04:21:33 GMT 2024
    - 52K bytes
    - Viewed (0)
  6. okhttp/src/main/kotlin/okhttp3/internal/http/RetryAndFollowUpInterceptor.kt

        // https://tools.ietf.org/html/rfc7231#section-7.1.3
        // currently ignores a HTTP-date, and assumes any non int 0 is a delay
        if (header.matches("\\d+".toRegex())) {
          return Integer.valueOf(header)
        }
        return Integer.MAX_VALUE
      }
    
      companion object {
        /**
         * How many redirects and auth challenges should we attempt? Chrome follows 21 redirects; Firefox,
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 15 13:24:48 GMT 2024
    - 12.1K bytes
    - Viewed (4)
  7. okhttp/src/main/kotlin/okhttp3/Cache.kt

        internal fun readInt(source: BufferedSource): Int {
          try {
            val result = source.readDecimalLong()
            val line = source.readUtf8LineStrict()
            if (result < 0L || result > Integer.MAX_VALUE || line.isNotEmpty()) {
              throw IOException("expected an int but was \"$result$line\"")
            }
            return result.toInt()
          } catch (e: NumberFormatException) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 10 19:46:48 GMT 2024
    - 26.8K bytes
    - Viewed (0)
  8. okhttp/src/main/kotlin/okhttp3/FormBody.kt

       * do double-duty to make sure the counting and content are consistent, particularly when it comes
       * to awkward operations like measuring the encoded length of header strings, or the
       * length-in-digits of an encoded integer.
       */
      private fun writeOrCountBytes(
        sink: BufferedSink?,
        countBytes: Boolean,
      ): Long {
        var byteCount = 0L
        val buffer: Buffer = if (countBytes) Buffer() else sink!!.buffer
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Tue Jan 09 12:33:05 GMT 2024
    - 4.3K bytes
    - Viewed (0)
  9. okhttp/src/test/java/okhttp3/KotlinDeprecationErrorTest.kt

        val certificatePinner: CertificatePinner? = address.certificatePinner()
      }
    
      @Test @Disabled
      fun cache() {
        val cache = Cache(File("/cache/"), Integer.MAX_VALUE.toLong())
        val directory: File = cache.directory()
      }
    
      @Test @Disabled
      fun cacheControl() {
        val cacheControl: CacheControl = CacheControl.Builder().build()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 13.3K bytes
    - Viewed (0)
  10. okhttp/src/main/kotlin/okhttp3/internal/-UtilCommon.kt

    }
    
    fun String.toLongOrDefault(defaultValue: Long): Long {
      return try {
        toLong()
      } catch (_: NumberFormatException) {
        defaultValue
      }
    }
    
    /**
     * Returns this as a non-negative integer, or 0 if it is negative, or [Int.MAX_VALUE] if it is too
     * large, or [defaultValue] if it cannot be parsed.
     */
    internal fun String?.toNonNegativeInt(defaultValue: Int): Int {
      try {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 11K bytes
    - Viewed (0)
Back to top