Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for readUtf8 (0.36 sec)

  1. okhttp/src/test/java/okhttp3/internal/cache2/RelayTest.kt

        val source1 = relay.newSource()!!.buffer()
        val source2 = relay.newSource()!!.buffer()
        assertThat(source1.readUtf8(5)).isEqualTo("abcde")
        assertThat(source2.readUtf8(5)).isEqualTo("abcde")
        assertThat(source2.readUtf8(5)).isEqualTo("fghij")
        assertThat(source1.readUtf8(5)).isEqualTo("fghij")
        assertThat(source1.exhausted()).isTrue()
        assertThat(source2.exhausted()).isTrue()
        source1.close()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 11 22:09:35 GMT 2024
    - 8.1K bytes
    - Viewed (0)
  2. okhttp/src/main/kotlin/okhttp3/internal/idn/Punycode.kt

            return null
          }
    
          if (dot < limit) {
            result.writeByte('.'.code)
            pos = dot + 1
          } else {
            break
          }
        }
    
        return result.readUtf8()
      }
    
      private fun encodeLabel(
        string: String,
        pos: Int,
        limit: Int,
        result: Buffer,
      ): Boolean {
        if (!string.requiresEncode(pos, limit)) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 03 03:04:50 GMT 2024
    - 8.5K bytes
    - Viewed (0)
  3. container-tests/src/test/java/okhttp3/containers/BasicProxyTest.kt

        testRequest {
          val url = URI(mockServer.endpoint + "/person?name=peter").toURL()
    
          val connection = url.openConnection() as HttpURLConnection
    
          assertThat(connection.inputStream.source().buffer().readUtf8()).contains("Peter the person")
        }
      }
    
      @Test
      fun testUrlConnectionPlaintextProxied() {
        testRequest {
          val proxy =
            Proxy(
              Proxy.Type.HTTP,
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Fri Apr 05 03:30:42 GMT 2024
    - 5.9K bytes
    - Viewed (0)
  4. okhttp/src/test/java/okhttp3/CallTest.kt

        assertThat(recordedRequest1.method).isEqualTo("POST")
        assertThat(recordedRequest1.body.readUtf8()).isEqualTo(body)
        assertThat(recordedRequest1.headers["Authorization"]).isNull()
        val recordedRequest2 = server.takeRequest()
        assertThat(recordedRequest2.method).isEqualTo("POST")
        assertThat(recordedRequest2.body.readUtf8()).isEqualTo(body)
        assertThat(recordedRequest2.headers["Authorization"]).isEqualTo(credential)
      }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 10 19:46:48 GMT 2024
    - 142.5K bytes
    - Viewed (0)
  5. regression-test/src/androidTest/java/okhttp/regression/compare/AndroidHttpEngineTest.kt

                info: UrlResponseInfo,
              ) {
                println("onSucceeded ${info.headers.asMap}")
                completableFuture.complete(Response(info.httpStatusCode, info.negotiatedProtocol, buffer.readUtf8()))
              }
    
              override fun onFailed(
                request: UrlRequest,
                info: UrlResponseInfo?,
                error: HttpException,
              ) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Mar 24 13:19:43 GMT 2024
    - 6.2K bytes
    - Viewed (0)
  6. samples/tlssurvey/src/main/kotlin/okhttp3/survey/Clients.kt

            ianaSuites.fromJavaName(it.javaName)
          },
      )
    }
    
    fun historicOkHttp(version: String): Client {
      val enabled =
        FileSystem.RESOURCES.read("okhttp_$version.txt".toPath()) {
          this.readUtf8().lines().filter { it.isNotBlank() }.map {
            SuiteId(id = null, name = it.trim())
          }
        }
      return Client(
        userAgent = "OkHttp",
        version = version,
        enabled = enabled,
      )
    }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Tue Apr 02 01:44:15 GMT 2024
    - 2.5K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/internal/http2/HttpOverHttp2Test.kt

        val response1 = call1.execute()
        val response2 = call2.execute()
        assertThat(response1.body.source().readUtf8(3)).isEqualTo("ABC")
        assertThat(response2.body.source().readUtf8(3)).isEqualTo("GHI")
        assertThat(response1.body.source().readUtf8(3)).isEqualTo("DEF")
        assertThat(response2.body.source().readUtf8(3)).isEqualTo("JKL")
        assertThat(server.takeRequest().sequenceNumber).isEqualTo(0)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 11 22:09:35 GMT 2024
    - 75.3K bytes
    - Viewed (0)
  8. okhttp/src/test/java/okhttp3/SocksProxy.kt

              InetAddress.getByAddress(fromSource.readByteArray(4L))
            }
    
            ADDRESS_TYPE_DOMAIN_NAME -> {
              val domainNameLength: Int = fromSource.readByte() and 0xff
              val domainName = fromSource.readUtf8(domainNameLength.toLong())
              // Resolve HOSTNAME_THAT_ONLY_THE_PROXY_KNOWS to localhost.
              when {
                domainName.equals(HOSTNAME_THAT_ONLY_THE_PROXY_KNOWS, ignoreCase = true) -> {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 11 22:09:35 GMT 2024
    - 7.7K bytes
    - Viewed (0)
  9. okhttp/src/test/java/okhttp3/CacheTest.kt

        val response1 = client.newCall(request).execute()
        val in1 = response1.body.source()
        assertThat(in1.readUtf8("I love ".length.toLong())).isEqualTo("I love ")
        in1.skip("puppies but hate ".length.toLong())
        assertThat(in1.readUtf8("spiders".length.toLong())).isEqualTo("spiders")
        assertThat(in1.exhausted()).isTrue()
        in1.close()
        assertThat(cache.writeSuccessCount()).isEqualTo(1)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 10 19:46:48 GMT 2024
    - 108.6K bytes
    - Viewed (0)
  10. okhttp/src/test/java/okhttp3/internal/cache/DiskLruCacheTest.kt

      ) = cacheDir / "$key.$index.tmp"
    
      private fun readFile(file: Path): String {
        return filesystem.read(file) {
          readUtf8()
        }
      }
    
      private fun readFileOrNull(file: Path): String? {
        return try {
          filesystem.read(file) {
            readUtf8()
          }
        } catch (_: FileNotFoundException) {
          null
        }
      }
    
      fun writeFile(
        file: Path,
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 15 14:55:09 GMT 2024
    - 75.8K bytes
    - Viewed (0)
Back to top