Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 52 for readUTF8 (0.05 sec)

  1. okhttp/src/jvmTest/kotlin/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()
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 8.1K bytes
    - Viewed (0)
  2. okhttp/src/jvmTest/kotlin/okhttp3/TrailersTest.kt

          assertThat(source.readUtf8()).isEqualTo("Hello")
          assertThat(response.trailers()).isEqualTo(headersOf("t1", "v2"))
        }
    
        val call2 = client.newCall(Request(server.url("/")))
        call2.execute().use { response ->
          val source = response.body.source()
          assertThat(response.header("h1")).isEqualTo("v1")
          assertThat(source.readUtf8()).isEqualTo("Hello")
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Mon Jul 07 18:57:05 UTC 2025
    - 18K bytes
    - Viewed (0)
  3. okhttp/src/jvmTest/kotlin/okhttp3/internal/cache2/FileOperatorTest.kt

        operatorA.write(36, bufferA, 33)
        operatorB.read(0, bufferB, 9)
        assertThat(bufferB.readUtf8()).isEqualTo("Dodgson!\n")
        operatorA.read(9, bufferA, 27)
        assertThat(bufferA.readUtf8()).isEqualTo("You shouldn't use my name.\n")
        operatorB.read(36, bufferB, 33)
        assertThat(bufferB.readUtf8()).isEqualTo("Dodgson, we've got Dodgson here!\n")
      }
    
      @Test
      fun largeRead() {
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Fri Dec 27 13:39:56 UTC 2024
    - 5.8K bytes
    - Viewed (0)
  4. container-tests/src/test/java/okhttp3/containers/BasicProxyTest.kt

          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,
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 6.2K bytes
    - Viewed (0)
  5. okhttp/src/jvmTest/kotlin/okhttp3/ResponseBodyTest.kt

        val body = "".decodeHex().toResponseBody(mediaType)
        val source = body.source()
        assertThat(source.exhausted()).isTrue()
        assertThat(source.readUtf8()).isEqualTo("")
      }
    
      @Test
      fun sourceClosesUnderlyingSource() {
        var closed = false
    
        val body: ResponseBody =
          object : ResponseBody() {
            override fun contentType(): MediaType? = null
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 3.9K bytes
    - Viewed (0)
  6. okhttp/src/jvmTest/kotlin/okhttp3/internal/idn/IdnaMappingTableTest.kt

        val buffer = Buffer()
        for (codePoint in 0..0x10ffff) {
          val allowedByTable = table.map(codePoint, buffer)
          val tableMappedTo = buffer.readUtf8()
    
          val allowedByCompactTable = compactTable.map(codePoint, buffer)
          val compactTableMappedTo = buffer.readUtf8()
    
          assertThat(allowedByCompactTable).isEqualTo(allowedByTable)
          assertThat(compactTableMappedTo).isEqualTo(tableMappedTo)
        }
      }
    
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Fri Dec 27 13:39:56 UTC 2024
    - 8.9K bytes
    - Viewed (0)
  7. okhttp/src/jvmTest/kotlin/okhttp3/WholeOperationTimeoutTest.kt

        val call = client.newCall(request)
        call.timeout().timeout(250, TimeUnit.MILLISECONDS)
        val response = call.execute()
        Thread.sleep(500)
        assertFailsWith<IOException> {
          response.body.source().readUtf8()
        }.also { expected ->
          assertThat(expected.message).isEqualTo("timeout")
          assertThat(call.isCanceled()).isTrue()
        }
      }
    
      @Test
      fun timeoutReadingResponseWithEnqueue() {
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Jun 18 12:28:21 UTC 2025
    - 10.6K bytes
    - Viewed (0)
  8. okhttp/src/jvmTest/kotlin/okhttp3/MultipartReaderTest.kt

            "abc",
          ),
        )
        assertThat(partAbc.body.readUtf8()).isEqualTo("abcd\r\nefgh")
    
        val partIjk = parts.nextPart()!!
        assertThat(partIjk.headers).isEqualTo(
          headersOf(
            "Content-Type",
            "text/plain; charset=utf-8",
            "Content-ID",
            "ijk",
          ),
        )
        assertThat(partIjk.body.readUtf8()).isEqualTo("ijkl\r\nmnop\r\n")
    
        assertThat(parts.nextPart()).isNull()
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed May 28 02:11:14 UTC 2025
    - 15.4K bytes
    - Viewed (0)
  9. okhttp/src/jvmTest/kotlin/okhttp3/CacheCorruptionTest.kt

        val metadataFile =
          fileSystem.allPaths.find {
            it.name.endsWith(".0")
          }
    
        if (metadataFile != null) {
          val contents =
            fileSystem.read(metadataFile) {
              readUtf8()
            }
    
          fileSystem.write(metadataFile) {
            writeUtf8(corruptor(contents))
          }
        }
      }
    
      private fun testCorruptingCache(corruptor: () -> Unit): Response {
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Jun 18 12:28:21 UTC 2025
    - 6K bytes
    - Viewed (0)
  10. okhttp/src/jvmTest/kotlin/okhttp3/MultipartBodyTest.kt

        val buffer = Buffer()
        body.writeTo(buffer)
        assertThat(body.contentLength()).isEqualTo(buffer.size)
        assertThat(buffer.readUtf8()).isEqualTo(expected)
    
        val buffer2 = Buffer()
        body.writeTo(buffer2)
        assertThat(body.contentLength()).isEqualTo(buffer2.size)
        assertThat(buffer2.readUtf8()).isEqualTo(expected)
      }
    
      @Test
      fun writeTwiceWithOneShot() {
        val expected =
          """
          |--123
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 10.5K bytes
    - Viewed (0)
Back to top